Subfactorial

Derangement (SymPy, WMA)


Subfactorial[n]

computes the subfactorial of n.

Here are the first few derangements:

We can handle MachineReal numbers:

Here is how the exponential, Factorial, and Subfactoral grow in comparison:

StieltjesGamma