What is the name of this summation formula?

133 Views Asked by At

So recently I derived a formula (obviously not the first... it already existed but that is what got me into summations) that quickly adds all the numbers from 1 to "n" However I recently derived another formula (also not the first I am guessing) that adds all the numbers from any number (not just 1) to "n" (i.e. 14+15+16+17)

Where i= Starting number and n= Ending number

$$\sum_{i}^{n} = \left ( n-i+1 \right )\ast \left ( \left ( n+i \right )/2 \right )$$

What I want to know is what is this formula called? Mine is very complicated looking as well so is there a more compact way?

2

There are 2 best solutions below

0
On

I think this is Gauss' summation trick. Not sure if it has an official name, however.

1
On

Let's suppose we want to add the numbers from $a$ to $b$. There are several ways to approach this. One way is to observe that there are $b-a+1$ numbers, and each one, on average is $\frac12(a+b)$, so the total is the product of these, $$\frac12(b-a+1)(a+b).\tag{1}$$ This is exactly your formula. We might expand the multiplication of the two terms, obtaining $$\frac12(b^2-a^2+a+b).\tag{2}$$

Using the Gauss trick, one can pair up the numbers into $$\begin{align} a&+b,\\ (a+1)&+(b-1),\\(a+2)&+(b-2)\\&\vdots\end{align}$$ obtaining pairs that each total $a+b$. There are $b-a+1$ numbers in the range, so $\frac12(b-a+1)$ such pairs. (Note that if $b-a+1$ is odd, this correctly accounts for the extra “half” of a pair.) So the total is the product of these, again $\frac12(b-a+1)(a+b)$, which is formula (1) again.$

Here's another method. Suppose we already know that $$1+2+\ldots+n = \frac12(n^2+n).\tag{3}$$ Then to sum the numbers from $a$ to $b$ we find the sum of the numbers from $1$ to $b$, which is $$\frac12(b^2+b).$$ From this we must take away again the sum of the numbers from $1$ to $a-1$, which is $$\frac12((a-1)^2+(a-1))$$ obtaining the total $$\frac12(b^2+b) - \frac12((a-1)^2+(a-1))$$ which simplifies to $$\frac12\left(b^2+b-a^2+a\right)$$ which is formula $(2)$ again.

Here's yet another method. Note that if were were to subtract $a$ from each term of $a, a+1, a+2, \ldots, b$, we would obtain $0,1, 2, 3, \ldots, b-a$. Formula (3) tells us that the sum of these is $$\frac12((b-a)^2 + (b-a)).$$ But to this we have to add back the $a$'s we took away; there are $b-a+1$ of these, so the complete total is $$\frac12((b-a)^2 + (b-a)) + a(b-a+1)$$ which, if we work out the algebra, gives us $(2)$ again.

In short, there are a lot of ways to get the same answer, which has been known for a long time.