Find the closed form of $\sum_{k=0}^n (-3)^k(k+1)$.
So the generating function would be: $$A(x)=1-6x+18x^2-108x^3...$$ So what I did notice is that its closed form is perhaps some variation of $1\over {1+x}$ but I didn't manage to find a general formula.
Thanks for any help in advance!
Let $f(x) = \sum_{k=0}^n x^{k+1} = \frac{x-x^{n+2}}{1-x} $. Then $f'(x) = \sum_{k=0}^n (k+1)x^k$, so $f'(-3) = \sum_{k=0}^n (k+1)(-3)^k$.
So
$\begin{align} f'(x) &= \frac{(x-x^{n+2})'(1-x) - (1-x)'(x-x^{n+2})}{(1-x)^2}\\ &= \frac{(1-x)(1-(n+2)x^{n+1})+x-x^{n+2}}{(1-x)^2}\\ &= \frac{1-(n+2)x^{n+1}-x+(n+2)x^{n+2}+x-x^{n+2}}{(1-x)^2}\\ &= \frac{1-(n+2)x^{n+1}+(n+1)x^{n+2}}{(1-x)^2}\\ \end{align} $
Putting $x = -3$,
$\begin{align} f'(-3) &= \frac{1-(n+2)(-3)^{n+1}+(n+1)(-3)^{n+2}}{4^2}\\ &= \frac{1-(-3)^{n+1}((n+2)+(n+1)3)}{4^2}\\ &= \frac{1-(-3)^{n+1}(4n+5)}{16}\\ \end{align} $
As a check (since I did this off the top of my head):
If $n=0$, $f'(-3) = \frac{1-(-3)^{1}(5)}{16} =\frac{1+15}{16} =1 $ and $1*(-3)^0 = 1$.
If $n=1$, $f'(-3) = \frac{1-(-3)^{2}(4+5)}{16} =\frac{1-9*9}{16} =-5 $ and $1+2*(-3) = -5$.
If $n=2$, $f'(-3) = \frac{1-(-3)^{3}(8+5)}{16} =\frac{1+27*13}{16} =22 $ and $-5+3*(-3)^2 = -5+27 = 22$.