I am new to generating functions and I know some of the basics how to create them. But now I am not sure how to create a generating function of this sequence:
$$a_0 = 0$$
$$ a_n = n + c (\sum_{k=0}^{n-1} a_k)$$ for n >=1
where c is a real non-zero constant.
I guess I need to add $ \frac {1}{(1-x)^2}$ (which is generating function of the n (sequence 1, 2, 3, 4, ...)) to the rest. But how do I evaluate the rest?
Thank you for any tips.
We denote the generating function of $a_n$ with $A(x)=\sum_{n=0}^\infty a_n x^n$.
Part 2: Generating function of $n$: Using the binomial series expansion we obtain for $n\geq 0$ \begin{align*} \frac{1}{(1-x)^2}&=\sum_{n=0}^\infty\binom{-2}{n}(-x)^n=\sum_{n=0}^\infty\binom{n+1}{n}x^n\\ &=\sum_{n=0}^\infty (n+1)x^n=\sum_{n=0}^\infty nx^n+\frac{1}{1-x} \end{align*} Here we use the binomial identities $\binom{-p}{q}=\binom{p+q-1}{q}(-1)^q$ and $\binom{p}{p-1}=\binom{p}{1}=p$. It follows \begin{align*} \sum_{n=0}^\infty nx^n=\frac{1}{(1-x)^2}-\frac{1}{1-x}=\frac{x}{(1-x)^2}\\ \end{align*} or equivalently \begin{align*} n=[x^n]\frac{x}{(1-x)^2}\qquad\qquad n\geq 0\tag{2} \end{align*}