<s>[INST] 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?
 [/INST] Since $1= 2-1$, you can multiply by $2-1$ and it won't change the value.
$$(2-1)(2^0+2^1+2^2+\cdots + 2^n) $$
$$=2(2^0+2^1+2^2+\cdots + 2^n) -1(2^0+2^1+2^2+\cdots + 2^n)$$
$$= (2^1+2^2+2^3+\cdots + 2^{n+1}) - (2^0+2^1+2^2+\cdots +2^n)$$
$$= 2^{n+1}-2^0.$$
</s>