<s>[INST] Calculate $\sum_{k=1}^n k2^{n-k}$ I want to Calculate $\sum_{k=1}^n k2^{n-k}$. Here's my attempt:
$$\begin{align} 
&\sum_{k=1}^n k2^{n-k} = \sum_{k=1}^n k2^{n+1}2^{-k-1} =2^{n+1}\sum_{k=1}^n k2^{-k-1} & &\text{(1)} \\
&k2^{-k-1} = -\frac{d}{dk}2^{-k} & &\text{(2)}
\end{align}$$ 
Plugging $(2)$ to $(1)$, 
$$\begin{aligned} 
2^{n+1}\sum_{k=1}^n k2^{-k-1}  &= 2^{n+1}\sum_{k=1}^n-\frac{d}{dk}2^{-k} \\ 
&= -2^{n+1}\sum_{k=1}^n\frac{d}{dk}2^{-k} \\ 
&= -2^{n+1}\frac{d}{dk}\sum_{k=1}^n2^{-k} \\ 
&= -2^{n+1}\frac{d}{dk}(1-2^{-n}) \\
&= -2^{n+1}\cdot 0 \\
&= 0 \end{aligned}$$ 
Obviously, I don't know much about summation and derivative. Can you please let me know where I am doing wrong and give me a hint for this question? Thanks! 
 [/INST] Actually, the answer is quite clean. It is $2^{n+1}-n-2$.  
You can prove this recursively.
Start with, let's say $n=2$. 
This sum is equal to $1(2)+2(1)=2^3-2-2$.
Now, for $n=3$, the sum is equal to $1(4)+2(2)+3(1)$.
How do we get there? First we multiply $1(2)+2(1)$ by $2$, to get $1(4)+2(2)$, and then we add $3$ to get $1(4)+2(2)+3(1)$. 
Now, doing the same steps, for $f(n)=2^{n+1}-n-2$, we have that multiplying by $2$ and adding $n+1$ gives $$f(n+1)=2(2^{n+1}-n-2)+n+1$$ $$=2^{n+2}-n+1-4$$ $$=2^{n+2}-(n+1)-2$$ which works by the rule we just declared.
</s>