Is this already an equation/law that has been found?

So I was messing around with some numbers today and I have found a way to quickly add summations (probably not the first one to discover it but...) this only works when you start at 1 (i.e. $1+2+3+4+5$) The equations are these

If the number ($n$) is odd do this:

$$\sum=\left(\frac{n+1}{2}\right)\cdot{}n$$

If the number ($n$) is even do this:

$$\sum =\left ( \frac{(n/2)+(n/2+1) }{2} \right )\ast n$$

So my question is, is this already a law/equation of some sort that someone has already found out because I think I remember hearing something similar to it but I do not know. Unfortunately I am only a freshman in geometry so have never been exposed to any things having to do with summations :(


Solution 1:

Both formulas amount ot $\frac{n(n+1)}{2}$ (where the numerator is even because one of $n, n+1$ is even). This is a well-known result and anecdotally attributed to Gauß who - as a child - is said to have solved the summation $1+2+\ldots +100$ within seconds, much to the surprise of his teacher who hd posed the problem in order to keep his class busy for a longer while ...

Solution 2:

The formula for the sum of all natural numbers less than or equal to $n$ is well known: and it holds for both odd and even $n$ $$1 + 2 + \cdots + n = \sum_{i = 1}^n i = \dfrac{n(n+1)}{2}$$

Solution 3:

Both results are the same, and are an instance of the formula for the sum of an arithmetic progression, in which each term is obtained from the previous one by adding a constant increment. In general the sum of such a progression is the product of its number of terms times the average of its first and last terms. Maybe you can see right away why this is so (it is a nice exercise); if not the linked article explains it. There also exists a formula for the sum of a geometric progression, in which each term is obtained from the previous one by a multiplying by a constant factor, and indeed for many more types of finite sums.