How is the following true? Taken from here under ANALYSIS, Large data set. $$ap^1 + ap^2 + ap^3 + ... + ap^k = a\frac{p^{k+1}-1}{p-1}$$ I just can't seem to arrive at the right-hand side. Thanks!
Also please note that this is my first question on here. If this is a stupid question to ask, I'm truly sorry.
Hint: $a+ap+ap^2+\ldots=\frac a{1-p}$ for $|p|<1$. And, $$(a+ap+ap^2+\ldots)-(ap^{k+1}+ap^{k+2}+\ldots)=a+ap+\ldots+ap^k$$