The idea behind the sum of powers of 2

The binary expansion of $\sum_{k=0}^n2^k$ is a string of $n+1$ 1's: $$\underbrace{111\dots111}_{n+1}$$ If I add a 1 to this number, what do I get? $$1\underbrace{000\dots000}_{n+1}$$ 1 followed by $n+1$ 0's, hence $2^{n+1}$. Therefore $$\sum_{k=0}^n2^k=2^{n+1}-1$$


This works for any partial sum of geometric series.

Let $S = 1 + x + x^2+\ldots +x^n$. Then $xS = x + x^2 + \ldots +x^n + x^{n+1} = S - 1 + x^{n+1}$.

All you have to do now is solve for $S$ (assuming $x\neq 1$).


There is a geometrical explanation.

Take a box long enough to put twice the amount of items equal to the last term of the sum, and try to pack it.

Let's take a box of length $2 * 2^n$.

Let's put the items from the first term ($2^n$) into the box. Now exactly one half of the space is left for the other terms, from $2^{n-1}$ down to $1$, so we repeat this process, starting from the next largest term.

As we put the items from each term, we notice that they take exactly one half of the empty space left in the box, because both the largest term left and the space left decreases in half on each step.

At some point we reach the first term, which is equal to 1, and there are two empty places left in the box for just one item, so after we put the last item into the box, there is still space for one more item.

The length of the box is $2*2^n = 2^{n+1}$, but it could be shorter by one, which is $2^{n+1} - 1$, and this is our formula.

For example, let's pack: $$\sum_{i=0}^3 2^i$$

Box length: $$2 * 2^3 = 16$$

2^3    |● ● ● ● ● ● ● ●|               |
2^2    |○ ○ ○ ○ ○ ○ ○ ○|● ● ● ●|       |
2^1    |○ ○ ○ ○ ○ ○ ○ ○|○ ○ ○ ○|● ●|   |
2^0    |○ ○ ○ ○ ○ ○ ○ ○|○ ○ ○ ○|○ ○|●| |

It could be shorter by one: $$2^{3+1}-1 = 15$$

By the way, similar geometrical explanation can be used for the ever decreasing geometric progression $\sum_{i=0}^\infty 2^{-i}$ with the only difference that we do not need to account for the last piece of empty space, because it tends to 0. Instead, we take some continuous medium as an example, such as a ribbon or a thread, which can be divided virtually infinitely so it sums to exactly a length of 2 units.