Why is $a+(a+r)+(a+2r)+\cdots+(n-2r)+(n-r)+n=\frac{(n+a)\cdot(n-a+r)}{2r}$?

Let $a, k, p, r$ and $n$ be all members of $\mathbb{Z}$. $p$ is an arbitrary number such that $a+pr=n$

Why does the statement below hold true?

\begin{align} \sum_{k=0}^{p}(a+kr) &=a+(a+r)+(a+2r)+\cdots+\left(a+(p-2)r\right)+\left(a+(p-1)r\right)+(a+pr)\\ &=a+(a+r)+(a+2r)+\cdots+(n-2r)+(n-r)+n\\ &=\color{red}{\frac{(n+a)\cdot(n-a+r)}{2r}} \end{align}

I don't understand the highlighted transformation. I understand that $(n+a)$ should be a factor as it is the sum of two numbers, one from the lower and other from the higher end, e.g. $(n-r)+(a+r)=n+a$.

However, I was unable to keep up with the rest of the operation. Any help would be appreciated. Thanks.

• Uh...where did the $p$ go? Jan 26, 2017 at 22:13
• $n$ is the last term of the finite sum, so $n=a+pr$. Jan 26, 2017 at 22:17
• Ah, ok. Forgot about that :) Jan 26, 2017 at 22:18

One may note that

$$\sum_{k=0}^pa=\underbrace{a+a+a+\dots+a}_{p+1}=a(p+1)$$

and likewise,

$$\sum_{k=0}^pkr=r\left(1+2+3+\dots+p\right)\\=r\frac{p(p+1)}2$$

• Thanks for the input! The sum of the two would essentially be the same thing that @Kiran found, only a different representation, no? Jan 26, 2017 at 22:19
• @Glycerius Yup. But it should come out to be the same with some greasing. Jan 26, 2017 at 22:19
• Understood. Thank you and have a nice day! Jan 26, 2017 at 22:21
• :D You too! :-) Jan 26, 2017 at 22:22

Use formulas of arithmetic progrssion. The given sequence is an arithmetic progression; first term $=a$, last term $=n$, common difference $=r$

$\text{number of terms }\\=\dfrac{\text{last term}-\text{first term}}{\text{common difference}}+1\\=\dfrac{n-a}{r}+1$

$\text{Sum }\\=\dfrac{\text{number of terms}}{2}(\text{first term}+\text{last term})\\=\dfrac{\dfrac{n-a}{r}+1}{2}(a+n)\\=\dfrac{n-a+r}{2r}(a+n)$

• Thank you for the layman's explanation, that made things much easier to understand. Have a great day! Jan 26, 2017 at 22:21