Solution (source code)

= Solution

The forcing base $-2$ is a root of the <characteristic equation of a linear recurrence>, so a constant multiple of $(-2)^n$ cannot be a <particular solution>. For $P(r)=r^3-3r+2$, direct substitution gives
$$
L[nr^n]=r^n\bigl(nP(r)+rP'(r)\bigr).
$$
For the resonant case of <exponential forcing in a linear recurrence>, at $r=-2$, $P(-2)=0$ and $(-2)P'(-2)=-18$. Hence $-(n/18)(-2)^n$ is a <particular solution> of the <inhomogeneous linear recurrence>. \b[The general solution is]
$$
\boxed{y_n=A+Bn+C(-2)^n-\frac n{18}(-2)^n.}
$$