For context, I have been trying to find the subfactorials of numbers lately and am currently stuck on evaluating $!5$.
The subfactorial of a number is defined as$$\dfrac{\Gamma(n+1,-1)}e$$however can be represented in integral form as$$!n=\int_{-1}^\infty x^ne^{-(x+1)}dx=\dfrac1e\int_{-1}^\infty x^ne^{-x}dx$$The first few integral (integer) values of $!n$ are:
For $n=0$:$$!0=\dfrac1e\int_{-1}^\infty e^{-x}dx=-\dfrac1e\left[e^{-x}\right]_{-1}^\infty=-\dfrac1e(0-e)=1$$For $n=1$:$$!1=\dfrac1e\int_{-1}^\infty xe^{-x}dx\overset{IBP}=\dfrac1e\left[-e^{-x}(x+1)\right]_{-1}^\infty\\\dfrac1e\left(-\lim_{\alpha\to\infty}e^{-\alpha}(\alpha+1)-0\right)=\dfrac1e(0-0)=0$$Then we have $!2=1$, $!3=2$ (which is the only prime subfactorial), $!4=9$, and so on and so on.
However, my question is: Is there an easier way to find the subfactorial of a number without having to evaluate increasingly complex integrals, such as for $n=5$ (which I'm currently working on evaluating) or $n=10$?