<s>[INST] Solve summation of $\sum_{j=0}^{n-2}2^j (n-j)$ Question
While Solving a recursive equation , i am stuck at this summation and unable to move forward.Summation is 

$$\sum_{j=0}^{n-2}2^j (n-j)$$

My Approach

$$\sum_{j=0}^{n-2}2^j (n-j) = \sum_{j=0}^{n-2}2^j \times n-\sum_{j=0}^{n-2} 
2^{j} \times j$$

$$=n \times (2^{n-1}-1)-\sum_{j=0}^{n-2} 
2^{j} \times j$$
I am unable to move forward , please help me out!
 [/INST] $$\sum_{j=1}^{n-2}j\;2^j=2+2\times 2^2+3\times 2^3+\cdots+(n-2)2^{n-2}$$$$=[2+2^2+2^3+\cdots+2^{n-2}]+[2^2+2^3+\cdots+2^{n-2}]+[2^3+\cdots+2^{n-2}]+\cdots+2^{n-2}$$$$=2(2^{n-2}-1)+2^2(2^{n-3}-1)+2^3(2^{n-4}-1)+\cdots+2^{n-2}(2^{n-(n-1)}-1)$$ $$=(2^{n-1}-2)+(2^{n-1}-2^2)+(2^{n-1}-2^3)+\cdots+(2^{n-1}-2^{n-2})$$ $$=(n-2)2^{n-1}-(2+2^2+\cdots+2^{n-2})=(n-2)2^{n-1}-2(2^{n-2}-1)$$ $$=(n-2)2^{n-1}-2^{n-1}+2=(n-3)2^{n-1}+2$$
</s>