I am trying to assess the aymptotic behavior for large $n$ of the sequence $(a_n)_{n=1}^\infty$ defined by the recursion \begin{align} a_{n} &= (n+1) a_{n-1} - n a_{n-2}-1, \ \forall n\ge3 \\ a_2 &= 2a_1-3. \end{align} This recursion originates from this question on stats.stackexchange.com.
Define the generating function $f(x):=\sum_{n=0}^\infty a_nx^n,$. $g(x):=x^2f(x)$ satisfies the ODE $$g'-\Big(\frac1{x^2}+\frac1x+\frac1{1-x}\Big)g=\Big(\frac x{1-x}\Big)^2-\frac{a_0}{1-x}+(2a_0-a_1)\frac x{1-x}$$ Multiply both sides by $e^h=\frac{1-x}xe^{\frac1x}$ where $h(x):=\frac1x+\ln\frac{1-x}x$ and get $$\frac{d}{dx}\Big(\frac{1-x}xe^{\frac1x}g\Big)=e^{\frac1x}\Big(\frac x{1-x}-\frac{a_0}x+(2a_0-a_1)\Big).$$ Now $e^{\frac1x}$ seems to prevent me from solving the ODE in a "closed" form.
I read somewhere the complex analysis may help to derive the large $n$ asymptotics of $a_n$. How does one procede?
Define $b_n:=a_n-a_{n-1}$. The original recursion turns into $$b_n=nb_{n-1}-1$$ which is solvable with a generating function.