Good day everyone
I am in need of help, I was using an online program to solve a sequence, the name of the program is WolframAlpha and using it I was able to get the actual nth term that I was looking for several times. But in order to get that nth term the program used the following generating function
$$\frac{ z(-34z ^ { 2 } +77z-41) }{ (z-1) ^ { 3 } } +25$$
Note my sequence was 25,32,36,39,41 and gave me nth term 42 which is what I actually needed. Now I need to find out how did the program get to find the nth using this generating function, I don't understand how -34z and 77z came to be.
Thank you while I wait for the answer
I think perhaps the fastest way to answer this question is to note that \begin{align*} f(z) = \frac{z(-34z^2 + 77z - 41)}{(z-1)^3} + 25 = -9 + \frac{25}{1-z} + \frac{11}{(1-z)^2} - \frac{2}{(1-z)^3} \end{align*}
The coefficient of $z^n$ in the series expansion of $(1-z)^{-1}, (1-z)^{-2}, (1-z)^{-3}$ are respectively $1, n+1, \frac{(n+1)(n+2)}{2}$. Therefore, the coefficient of $z^n$ in $f(z)$ is \begin{align*} -9\cdot\mathbb{I}_{\{n=0\}} + 25+ 11(n+1) - 2\frac{(n+1)(n+2)}{2} \end{align*} where $\mathbb{I}$ is the indicator function.