# Why is $!0 = 1$?

The subfactorial function is defined as: $$!n = n!\sum_{i=0}^n\dfrac {(-1)^i} {i!}$$ I was curious and wanted to find out what $!0$ came out to be. Since I couldn't use it in the sum above, I used a different method by figuring out $!1$ first and using $!n = !(n-1)n-1$.

It turned out, that if you plugged in $0$ for this, you got $2$.
This seemed odd, so I used a reverse equation, $!n = \dfrac {!(n+1) +1} {(n+1)}$ and plugged in $2$ for $!0$ and it turned out correct.
This still seemed very odd, so I checked it on Wolfram Alpha, which say that $!0 = 1$

So what did I do wrong? And how exactly does $!0$ turn out to be $1$?

• Why couldn't you use it in the direct definition? $!0=0!\cdot \frac{(-1)^0}{0!}=1\cdot \frac{1}{1}=1$. – user26486 Jun 21 '15 at 0:37
• The sub-factorial is actually defined combinatorially, and that value is what turns up. It is the number of symmetries on $\{1,\dots,n\}$ with no fixed points. There is one bijection from the empty set to itself, and it has no fixed points. – Thomas Andrews Jun 21 '15 at 0:38
• How do you get $2$ by plugging $0$ into that? – Thomas Andrews Jun 21 '15 at 0:40
• @ThomasAndrews $!n = \dfrac {!(n+1)+1} {n+1}$, $!0 = \dfrac {!1 + 1} {1}$, $!0 = \dfrac {2} {1}$ – ZTqvhI5vpo Jun 21 '15 at 0:42
• @JamieSanborn $!1=1!\cdot \frac{(-1)^0}{0!}+1!\frac{(-1)^1}{1!}=0\neq 1$ – user26486 Jun 21 '15 at 0:45

Using the definition you provided:$$!1 = 1! \sum_{i=0}^1\frac{(-1)^i}{i!} = 1 \left(\frac{1}{1} + \frac{-1}{1}\right) = 0$$Then putting this in the other recursive equation you gave:$$!1 = !(1-1)(1) - 1 \implies 0 = !0 - 1 \implies !0 = 1$$