Derangement & Difference equations

58 Views Asked by At

I'm studying derangements and came out with this fairly nice difference equation:

Let $A_n= $# of derangements of $n$ objects, then $ \{A_n \}_{n \in \mathbb N}$ satisfies:

$$A_{n+1}= n(A_n + A_{n-1} )$$

With initial conditions $A_0=1, A_1=0$

Now I want to solve this and recover the expression of $!n$

So basically I used the $Z$ transform on it and obtained the ODE:

$$(z+1)a'(z) + (1 + \frac{1}{z}) a(z) =z$$

This one I could solve leading to

$$ a(z) =c_1 e^{-z} + e^{-z-1}z \int_z^\infty \frac{e^{-u}}{u} du$$

Now the problem is that I'm not able anti-transform back to obtain a solution!