What is the result of:
summation from one, two, four, eight until $n$ power of two?
Thank you!
What is the result of:
summation from one, two, four, eight until $n$ power of two?
Thank you!
In binary you get the number $\underbrace{11\dots 11}_n$ which is the number that goes before $\underbrace{100\dots 00}_{n+1}=2^{n+1}$
\begin{align} S&=1+2+4+\dotsb+2^n\\ 1+S&=1+1+2+4+\dotsb+2^n\\ &=2+2+4+\dotsb+2^n\\ &=4+4+\dotsb+2^n\\ &=8+\dotsb+2^n\\ &\dotsb\\ &=2^n+2^n\\ 1+S&=2^{n+1}\\ S&=2^{n+1}-1 \end{align} Write it out for a specific example to understand this better.
One can write $$S=1+2+\cdots+2^n,$$ and note that $$S=2S-S.$$ Hence, since $$2S=2(1+2+\cdots+2^n)=2+4+\cdots+2^{n+1}=S-1+2^{n+1},$$ we have $$S=2S-S=S-1+2^{n+1}-S=2^{n+1}-1.$$
Well this is a GP with ratio $2$ Having $n+1$ terms
So the sum will be $$\frac{1\{2^{(n+1)}-1\}}{(2-1)}= 2^{(n+1)}-1$$
Let $S$ this sum, then by difference of $2S$ and $S$ we have: \begin{array}{cccccc} 2S&=& & &2&+&4&+&8&+&\ldots&+&2^n&+&2^{n+1}\\ -S&=&-1&-&2&-&4&-&8&-&\ldots&-&2^n&\\ \hline S&=&-1&+&0&+&0&+&0&+&\ldots&+&0&+&2^{n+1}\\ \end{array} Hence, $$\boxed{\color{blue}{S=2^{n+1}-1}}$$
Here is yet another answer. Your sum is:
$$\sum_{j=0}^n2^j=\frac{1}{2}(2)\sum_{j=0}^n2^j$$ $$=\frac{1}{2}\sum_{j=0}^n2^j(2)$$ $$=\frac{1}{2}\sum_{j=0}^n2^{j+1}$$ $$=\frac{1}{2}\sum_{k=1}^{n+1} 2^k$$ $$=\frac{1}{2}\left(-2^0+2^0+\sum_{k=1}^n2^k+2^{n+1}\right)$$ $$2\sum_{j=0}^n2^j=\sum_{k=0}^n2^k+2^{n+1}-2^0$$ $$\sum_{j=0}^n2^j=2^{n+1}-1$$