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! 
 A: Let $S=\sum_{k=1}^n k 2^{n-k}$
$ S = 2^{n-1} + 2(2^{n-2}) + 3(2^{n-3}) + \cdots + n(2^0)$
$ {S \over 2} = \quad\quad\quad1(2^{n-2}) + 2(2^{n-3}) + \cdots + (n-1)(2^0) + n(2^{-1})$ 
$\begin{align} (1-{1\over2})S 
&= (2^{n-1} + 2^{n-2} + 2^{n-3} + \cdots + 1) - n(2^{-1})\cr
{S\over2}&= (2^n-1) - n(2^{-1})\cr\cr
S &= 2(2^n-1) - n
\end{align}$
A: 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.
A: Maybe that's what you had in mind?
$s_n=\sum_ {k = 1}^n k 2^{n - k} \\
= 2^n \sum_ {k = 0}^n k 2^{ - k}\\
=2^n \sum_ {k = 0}^n k z^k|_{z\to\frac{1}{2}}\\
=2^n z \frac{d}{dz}\sum_ {k = 0}^n  z^k|_{z\to \frac{1}{2}}\\
=2^n z \frac{d}{dz}\frac{ \left(-1+z^{1+n}\right)}{-1+z}|_{z\to\frac{1}{2}}\\
= \frac{2^n z \left(1-(1+n) z^n+n z^{1+n}\right)}{(-1+z)^2}|_{z\to\frac{1}{2}}\\ = 2^{1+n}-n-2\\
$
