0

I am evaluating the sum $\sum\limits_{i=1}^{n}ip^i$.

in this answer the following identity is used :

$$\sum_{i=1}^n ip^i = \sum_{i=1}^n \sum_{j=i}^n p^j$$

I don't see where this comes from, maybe one could help me out ?

As a computer science student, it looks as if we were doing two loops, but I dont get it

Thanks for the help

T.D
  • 742
  • 1
    Essentially, the following pyramid can be summed by rows then columns or vice versa, $$\begin{array}{}p^1\p^2+p^2\p^3+p^3+p^3\\dots\p^n+p^n+p^n\dots+p^n\end{array}$$ – Vepir Oct 21 '21 at 16:44

1 Answers1

2

Note that $$\sum_{i=1}^n ip^i =\sum_{i=1}^n \underbrace{(p^i+\dots+p^i)}_{\text{repeated $i$ times}} =\sum_{i=1}^n\sum_{j=1}^i p^i=\sum_{1\leq j\leq i\leq n} p^i=\sum_{j=1}^n \sum_{i=j}^n p^i.$$ where at the last step we interchange the sums. The last sum is the same of $\sum_{i=1}^n \sum_{j=i}^n p^j$, just rename the indices.

Robert Z
  • 145,942