<s>[INST] Simplifying $\sum_{k=1}^n (n-k)2^{k-1}$ via combinatorics in Aigner, A course in Combinatorics I must simplify $\sum_{k=1}^n (n-k)2^{k-1}$ using the rule of sum. How might I go about doing this?
Thank you and regards.
 [/INST] $\sum_{k=1}^n(n-k)2^{k-1} = \sum_{k = 1}^n n2^{k-1} - \sum_{k = 1}^n k2^{k-1}$.
In the first sum, we can factor out $n$ from each term so $\sum_{k=1}^n n2^{k-1} = n(1+2+ \cdots + 2^{n-1}) = n(2^n-1)$.
For the second term, we use a standard calculus argument. $1+x+x^2+ \cdots + x^k = \frac{x^{k+1}-1}{x-1}$.
Then differentiating both sides gives $1+2x+ \cdots + kx^{k-1} = \frac{k x^{k+1}-(k+1) x^k+1}{(x-1)^2}$. Let $x = 2$ for our sum in hand. Its easy to finish from here.
</s>