Subfactorial

The nth subfactorial or left factorial, written $$!n$$, is the number of ways that n objects can be arranged where no object appears in its natural position (known as "derangements.") There are many formulas for $$!n$$:

$$ \begin{array}{ccl} !n &=& n! \cdot \displaystyle\sum^{n}_{i = 0} \frac{(-1)^i}{i!}\\ &&\\  &=& \displaystyle\sum^{n}_{i = 0} i! \cdot (-1)^{n - i} \cdot \binom{n}{i}\\ &&\\  &=& \displaystyle\frac{\Gamma(n + 1, -1)}{e} \end{array} $$