Solution (source code)

= Solution

Use <mathematical induction>. For $n=1$, the left side is $2^0=1=2^1-1$. If the identity holds at $n$, then
$$
\sum_{k=0}^{n}2^k
=\left(\sum_{k=0}^{n-1}2^k\right)+2^n
=(2^n-1)+2^n
=2^{n+1}-1.
$$
The base case and induction step establish the <geometric series> identity
$$
\boxed{\sum_{k=0}^{n-1}2^k=2^n-1\quad(n\geq1).}
$$