So for reference, I'm just a high school student, who doesn't know that much maths stuff. But I noticed a pattern in binary numbers where, if you have all ones that is one less than if you have the next value (e.g. $1111$ is $1$ less than $10000$ - by definition). I generalised this to be a sum of base $2$ to $n$, and created a very simple sum: $$\sum_{k=0}^{n} 2^k = 2^{n+1} - 1$$ This was pretty simple, and was pretty obvious. I tried generalising and came up with the thing below:
$$\sum_{k=0}^{n} a^k = \frac{a^{n+1}-1}{a-1}$$
I'm not sure if this thing is actually correct, as I was just playing around. If it is correct can someone forward me to the offical proof.
Thanks