How to prove that $2^0 + 2^1 + 2^2 + 2^3 + \cdots + 2^n = 2^{n+1} - 1$ When I'm reading Computer Systems: A Programmer's Perspective, I met the sum of binary numbers and failed to prove it:
$$ 2^0 + 2^1 + 2^2 + 2^3 + \cdots + 2^n = 2^{n+1} - 1 $$
This might be preliminary knowledge, I'm not good at mathematics, any body could give me a hint?

Exploiting the binary representation,
$$111\cdots111_2+1_2=1000\cdots000_2$$ because the carry propagates.
This is exactly
$$2^0+2^1+2^2+\cdots2^{n-2}+2^{n-1}+2^n+1=2^{n+1}.$$

The proof generalizes to other bases. Let $a:=b-1$, then
$$a\cdot111\cdots111_b+1_b= aaa\cdots aaa_b+1_b=1000\cdots000_b,$$ which is a rewrite of
$$(b-1)(b^0+b^1+b^2+\cdots b^{n-2}+b^{n-1}+b^n)+1=b^{n+1}$$ or
$$b^0+b^1+b^2+\cdots b^{n-2}+b^{n-1}+b^n=\frac{b^{n+1}-1}{b-1}.$$
