For a series $2^n+2^{n-1}+2^{n-2}+2^{n-3}+\dotsb+2^2+2^1+2^0$, is there a formula for calculating the sum of the series for a given value of $n$ aside from manually calculating each result?
$2$ here is just a placeholder, but I need to calculate this for anything up to $1000$ different values of $n$, so would appreciate it if anyone could point me in the right direction.
$(a-1)(a^n + a^{n-1} + \cdots + a + 1) = a^{n+1} - 1$
Verify this for yourself.
$a^n + a^{n-1} + \cdots + a + 1 = \frac {a^{n+1} - 1}{a-1}$