<s>[INST] Find a generating function for $3r^3 - 5r^2 + 4r$ a. Show how $r^2$ and $r^3$ can be written as linear combinations of $P(r,3)$, $P(r,2)$, and $P(r,1)$.
b. Use part (a) to find a generating function for $3r^3 - 5r^2 + 4r$
I believe that I have part a, simply by calculating each of the permutations.
\begin{align*}
P(r,3) &= (r-2)(r-1)r \\
    &= r^3 - 3r^2 + 2r
\end{align*}
\begin{align*}
P(r,2) &= (r-1)r \\
    &= r^2 - r
\end{align*}
\begin{align*}
P(r,1) &= r
\end{align*}
Then we can see that 
\begin{align*}
P(r,2) + P(r,1) &= (r^2 - r) + r\\
    &= r^2
\end{align*}
and 
\begin{align*}
P(r,3) + 3P(r,2) + P(r,1) &= r^3 - 3r^2 + 2r + 3(r^2 - r) + r \\
        &= r^3 - 3r^2 + 2r + 3r^2 - 3r + r \\
        &= r^3
\end{align*}
As for part b, I have found that it can be written with the linear combination $3P(r,3) + 4P(r,2) + 2P(r,1)$. However, I am not sure how to use this to calculate a generating function.
 [/INST] Hint: Take the geometric series i.e., $$\sum _{n=0}^{\infty}x^n=\frac{1}{1-x},$$
differentiate both sides, you will get $$\sum _{n=0}^{\infty}nx^{n-1}=(\frac{1}{1-x})'=\frac{1}{(1-x)^2},$$ multiply both sides by $x,$
$$\sum _{n=0}^{\infty}nx^n=\sum _{n=0}^{\infty}P(n,1)x^n=\frac{x}{(1-x)^2}.$$
Do it for the other ones and use the combination you got.
</s>