proving with a sequence

36 Views Asked by At

The question is :

Show that if $n$ is a power of $2$, then $$\sum_{i=0}^{\log_2n-1}2^i=n-1\;.$$

Tried induction at first and tried to prove it on 2n but nothing came out of it. Then i tried every possible way with a series and i'm close but still can't prove it.

Thanks in advance !

1

There are 1 best solutions below

0
On BEST ANSWER

If $n$ is a power of $2$ then you have that $n=2^m$ for some $m \in \mathbb N$. Thus $$\log_{2}n=\log_{2} 2^m=m\log_{2}2=m$$ and therefore $$\sum_{i=0}^{(\log_2n)-1}2^i=\sum_{i=0}^{m-1}2^i=^{\text{Geometric sum}}=\frac{1-2^{m-1+1}}{1-2}=\frac{1-2^m}{-1}=2^m-1$$ but since $2^m=n$, the last term is equal to $n-1$.