# 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$?

-
Did you try a few values of $n$? –  lhf Nov 29 '11 at 21:22

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,

-
This is the cleverest of the lot. :) –  Guess who it is. Nov 30 '11 at 3:20
Wow. And I was wondering if it was even worth posting. XD Hahahaha –  Patrick Da Silva Nov 30 '11 at 4:30

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.

-

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$$

-

Clue:

If you are searching closed formulas to a series like:

$a+ab+ab^2+ab^3+\ldots+ab^n = S_n$

You can use the follow trick:

$a+ab+ab^2+ab^3+\ldots+ab^n = S_n$

so,

$b(a+ab+ab^2+ab^3+\ldots+ab^n) = bS_n = ab+ab^2+ab^3+ab^4+\ldots+ab^n+ab^{n+1}=$

$a+ab+ab^2+ab^3+\ldots+ab^n -a +ab^{n+1}= bS_n \iff$

$S_n-a+ab^{n+1}=bS_n \iff S_n(b-1)=a(b^{n+1}-b) \iff$

$$S_n=\frac{a(b^{n+1}-b)}{b-1}$$

But, $b=1$ isn't covered by this formula, but if b=1, the series become

$S_n=a+a+a+...+a$ where $a$ appears $n$ times and $S_n=na$.

$a=1=2^0$ and $b=2$,
$S_n=a+ab+ab^2+ab^3+\ldots+ab^n=2^0+2^1+\ldots+2^n=\frac{1(2^{n+1}-1)}{2-1}=2^{n+1}-1$