4

I came across the following sum: $\sum_{m=1}^{\log_2(N)} 2^{m}$. My intuition tells me that this should be bounded by 2N, but how would I prove this?

nhs
  • 43

2 Answers2

2

$$\sum_{n=0}^d x^n= \frac{x^{d+1}-1}{x-1}$$

So we have:

$$\sum_{m=1}^{\log_2 N} 2^m=\sum_{m=0}^{\log_2 N} 2^m-2^0=\sum_{m=0}^{ \log_2 N } 2^m-1 = \frac{2^{\lfloor \log_2N \rfloor +1}-1}{2-1}-1 \leq \frac{N \cdot 2-1}{1}-1 \\=N \cdot 2-2 $$

evinda
  • 7,823
0

For any $p \in \mathbb{N}$ you have: $$\sum_{m=1}^p 2^m = 2^{p+1}-2=2\cdot2^p - 2$$

So: $$\sum_{m=1}^{\log_2(N)} 2^m = 2N-2$$ Which is indeed bounded by $2N$