1

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$?

Ѕᴀᴀᴅ
  • 34,263
CrSb0001
  • 2,532
  • 1
    $!n = \left\lfloor \dfrac{n!}{e}+0.5\right\rfloor$ – JMoravitz Jan 08 '24 at 15:12
  • With regards to "The subfactorial is defined as..." I find a much better definition to work with to be the combinatorial definition... it is the number of permutations in $S_n$ (bijections from ${1,2,\dots,n}$ to itself) with no fixed points. – JMoravitz Jan 08 '24 at 15:15

0 Answers0