How to Solve Advanced Recurrence Relations

Here are two references which might be useful when learning recurrence relations.

Hint: Sometimes we are lucky and can find a solution also by elementary means. Assuming initial values $a_0, a_1$ are given, we derive from \begin{align*} a_n=na_{n-1}-(n-3)a_{n-2}\qquad n\geq 2 \end{align*} successively \begin{align*} \color{blue}{1}a_2&=2a_1+a_0\\ a_3&=\color{blue}{3}a_2\\ a_4&=4a_3-a_2=\color{blue}{11}a_2\\ a_5&=5a_4-2a_3=\color{blue}{49}a_2\\ a_6&=6a_5-3a_4=\color{blue}{261}a_2\\ &\cdots\\ \end{align*}

Looking for the values $1,3,11,49,261$ in OEIS we find the sequence A001339 with representation \begin{align*} a_{n+2}=\sum_{k=0}^n\binom{n}{k}(k+1)!\qquad\qquad n\geq 0 \end{align*}


Hint.

Considering $S(x) = \sum_k a_k x^k$ we have

$$ S(x) -x\frac{d}{dx}\left(x S(x)\right)+x^4\frac{d}{dx}\left(\frac{S(x)}{x}\right) = 0 $$

and solving for $S(x)$ we obtain

$$ S(x) = C_0 (1-x)e^{-\frac 1x} $$