TITLE: Finite Sum $\sum_{i=1}^n\frac i {2^i}$
QUESTION [18 upvotes]: I'm trying to find the sum of : 
$$\sum_{i=1}^n\frac i {2^i}$$
I've tried to run $i$ from $1$ to $∞$ , and found that the sum is $2$ , i.e : 
$$\sum_{i=1}^\infty\frac i {2^i} =2$$
since :
$$(1/2 + 1/4 + 1/8 + \cdots) + (1/4 + 1/8 + 1/16 +\cdots) + (1/8 + 1/16 + \cdots) +\cdots = 1+ 1/2 + 1/4 + 1/8 + \cdots = 2 $$
But when I run $i$ to $n$ , it's a little bit different , can anyone please explain ? 
Regards

REPLY [8 votes]: Let $r=1/2$.
Write all the terms being added as
$$ \left.
\matrix{
r& \phantom{2}r^2& \phantom{2}r^3& \phantom{2}r^4&\cdots&\phantom{n}r^n \cr
0 & \phantom{2}r^2& \phantom{2}r^3& \phantom{2}r^4&\cdots& \phantom{2}r^n \cr
0&0& \phantom{2}r^3& \phantom{2}r^4&\cdots& \phantom{2}r^n\cr
& \vdots&&&&\cr
0&0&0&0&\cdots& \phantom{2} r^n\cr
}\ \ \right\}  n-\text{rows}
$$
$$ 
\overline{\matrix{ r&2r^2&3r^3&4r^4&\cdots&nr^n}\phantom{dfgfsdfsfs}}
$$
Using the formula for the sum of a finite Geometric series, the sum of row $i$ is
$$
r^i+r^{i+1}+\cdots+ r^n ={r^i-r^{n+1}\over 1-r }.
$$
The sum of the row sums is
$$\eqalign{
\sum_{i=1}^n {r^i-r^{n+1}\over 1-r } &=
{1\over 1-r}\Bigl(\,\sum_{i=1}^n  r^i-   \sum_{i=1}^nr^{n+1}  \Bigr)\cr
&={1\over 1-r}\cdot \biggl({r-r^{n+1}\over 1-r}-nr^{n+1}\biggr)\cr
&={1\over 1-r}\cdot \biggl({r-r^{n+1}\over 1-r}-{(1-r)nr^{n+1}\over1-r}\biggr)\cr 
&={  r-r^{n+1}-(1-r)nr^{n+1}\over (1-r)^2}\cr
&={r-r^{n+1}(1+n-nr)\over (1-r)^2}.
}
$$