How is the following true? Taken from [here](https://codingcompetitions.withgoogle.com/kickstart/round/0000000000051060/0000000000058a56) 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.