The sum of powers of $2$ that are less than or equal to $n$ is less than $2n$. I am working with an amortised analysis problem where the given solution states that
$$\sum\{2^k:0<2^k\le n\}<2n$$
I am not mathematically literate; is there a simple way to prove this or at least calculate said sum?

Assume, that $n\in \{2^m, 2^m+1, ..., 2^{m+1}-1\}$.
We have
$$\sum_{k=0}^{m} 2^k = \frac{1-2^{m+1}}{1-2} = 2^{m+1}-1 < 2^{m+1} =2\cdot 2^m\leq 2n$$
