<s>[INST] How to Solve Summation by Hand I am having trouble solving the following summation by hand.
$$ \sum_{i=0}^{n-1} 2^i (n-i) $$
Can someone guide me in the right direction, especially for the $i \cdot 2^i$ part?
 [/INST] Here's a hint: 
$$ \sum_{i=0}^k i 2^i = 2 + 2*2^2+ 3*2^3 + \dots + k* 2^k \\ 
 = ( 2 + 2^2 + 2^3 + \dots + 2^k ) \\
   + (2^2+2^3+\dots + 2^k) \\
   + \dots + (2^{k-1}+2^k) + (2^k) \\
 = 2(1+ \dots + 2^{k-1}) + \dots + 2^{k-1}(1+2) + 2^k \\
= 2(2^k-1)+2^2(2^{k-1}-1) + \dots + 2^{k-1}(2^2-1) \\
= (k-1) 2^{k+1} + 2^k - 2(1+2+\dots+2^{k-2}) \\
= (k-1) 2^{k+1} + 2.$$
Can you get it from here? 
</s>