The sum of powers of $2$ between $2^0$ and $2^n$

Lately, I was wondering if there exists a closed expression for $2^0+2^1+\cdots+2^n$ for any $n$?


Solution 1:

Another nice way to see this is you can write the number in base 2 : The sum $$ 2^0 + 2^1 + \dots + 2^n = (011\dots1)_2 = (100\dots0)_2 - (0\dots 01)_2 = 2^{n+1} - 1. $$ where the writing of that number in base 2 has $n+1$ digits.

Hope that helps,

Solution 2:

As the sum of a geometric sequence, $1+2^1+2^2+\ldots+2^n = \frac{2^{n+1}-1}{2-1}=2^{n+1}-1$.

You can see it by computing $(1+2^1+2^2+\ldots+2^n)(2-1)$ and distribute. All the terms except for $2 \cdot 2^n - 1$ will cancel each other out.

Solution 3:

That is geometric series

$$1+q+...+q^n=\frac{1-q^{n+1}}{1-q}$$

with quotient $q=2$

$$2^{0}+2^{1}+...+2^{n}=\frac{1-2^{n+1}}{1-2}=2^{n+1}-1$$