# How to derive the sum of an arithmetic sequence?

I'm attempting to derive a formula for the sum of all elements of an arithmetic series, given the first term, the limiting term (the number that no number in the sequence is higher than), and the difference between each term; however, I am unable to find one that works. Here is what I have so far:

Let $a_0$ be the first term, $a_n$ be the last term, and $x$ be the difference between each term.

If we have the sequence $a_0, a_0 + x, a_0 + 2x ... a_n$, then we can add the first and last term, the second and second last term, etc., to quickly find the sum based on the number of terms. Thus, the sum of these terms is $n\frac{(a_n + a_0)}{2}$, where $n$ is the total number of terms.

The number of terms must be the number of times the first term was increased by $x$ plus one (to account for the first term), and so $n = \frac{(a_n - a_0)}{x} + 1$.

Thus, the sum is equal to $(\frac{(a_n - a_0)}{x} + 1)\frac{(a_n + a_0)}{2}$.

However, I am unable to integrate the limiting term in the place of $a_n$; any ideas for how to make this work?

In case my definition of a limiting term is ambiguous; an example would be if there was a set $3, 6, 9$; I'd like to be able to replace $a_n$ (which is $9$ in this case) with any number above $9$, and below $12$, and still get the same answer.

• It looks to me as if you want (for increasing sequences) $\left\lfloor \frac{a_n-a_0}{x}\right\rfloor$, instead of $\frac{a_n-a_0}{x}$. Here $\lfloor y\rfloor$ is the "floor" function, the greatest integer which is $\le y$. – André Nicolas May 19 '13 at 22:13

Essentially, you want to "round" $a_n$ down to the greatest number which can be expressed as $a_0 + kx$ for some integer $x$. One way to do so is to replace $a_n$ by $(a_0+x\lfloor\frac{a_n-a_0}{x}\rfloor)$ in your summation formula.

This may be a bit late but I stumbled across this question myself and I thought about this not too long ago, so I might as well post what I managed to derive on here.

We know that a term, can be expressed thusly:

$$a_n = a_{n-1} + d$$ $$a_{n-1} = a_{n-2} + d$$ $$...$$ $$a_{n-k} = a_{n-k-1} + d$$

Where $a_n$ is the $n_{th}$ term, $d$ is the difference between two consecutive terms and $k$ is some integer constant. We can now substitute "lower" degrees (where $k$ is larger) of the recursive definition into the original one to get:

$$a_n = a_{n-2} +d + d$$ $$a_n = a_{n-3} +d + d + d$$ $$...$$

This goes on until $a_{n-k} = a_1$, we can now see that:

$$a_n = a_1 + d(n-1)$$

Because we went from $n-1$ to $1$ this means that we added together $d,$ $n-1$ number of times. Something quite elementary as well is that the sum of the series is all of the terms added together:

$$S = \sum_{i=1}^{n}a_i = \sum_{i=1}^{n}(a_1 + d(n-i))$$

Break out the terms:

$$S = \sum_{i=1}^{n}a_1 + \sum_{i=1}^{n}d(n-i)$$

We can see that when $i = n$ then $n - i = 0$, this means that we can just change the second summations upper bound from $n$ to $n-1$: $$S = \sum_{i=1}^{n}a_1 + \sum_{i=1}^{n-1}d(n-i)$$ $$S = na_1 + \sum_{i=1}^{n-1}dn - \sum_{i=1}^{n-1}di$$ The sum for all natural numbers up to and including $n-1$ is $\frac{n(n-1)}{2}$, use this on the third summation:

$$S = na_1 + dn(n-1) - \frac{dn(n-1)}{2}$$ $$S = na_1 + \frac{2dn(n-1) - dn(n-1)}{2}$$ $$S = na_1 + \frac{dn(n-1)}{2}$$

Q.E.D