<s>[INST] How to find $\sum_{k=1}^{n}{3^kk}$ I need hint to find this sum $$\sum_{k=1}^{n}{3^kk}$$  $\sum_{k=1}^{n}{3^k}$ can be easily calculated as it is sum of geometric progression.
 [/INST] An alternative solution:$$\begin{align}\sum 3^kk=3+2\cdot3^2+3\cdot3^3+4\cdot3^4&\ldots\\=3+3^2+3^3+3^4&\ldots\\+3^2+3^3+3^4&\ldots\\ +3^3+3^4&\ldots\\\vdots\\=\sum3^k+3\sum3^k+3^2\sum3^k&\ldots\end{align}$$
So if $S_n=\sum_{k=1}^{n}3^kk$, then $$\begin{align}S_n&=\sum_{k=1}^n3^k\sum_{i=0}^{n-k}3^i\\&=\sum_{k=1}^n3^{k}\frac{3^{n-k+1}-1}{2}\\&=\frac12n3^{n+1}-\frac12\sum_{k=1}^n3^{k}\\&=\frac12n3^{n+1}-\frac32\frac{3^{n}-1}{2}\\
&=\frac{2n3^{n+1}-3^{n+1}+3}{4}\\
&=\frac34\left((2n-1)3^{n}+1\right)\end{align}$$
</s>