FANDOM


The 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.")[1] There are many formulas for \(!n\):

\begin{eqnarray*} !n &=& n! \displaystyle\sum^{n}_{i = 0} \frac{(-1)^i}{i!}\\ &=& \displaystyle\sum^{n}_{i = 0} i! (-1)^{n - i} \binom{n}{i}\\ &=& \displaystyle\frac{\Gamma(n + 1, -1)}{e}\\ &=& \left[\frac{n!}{e}\right] \text{ (only for $n > 0$)} \end{eqnarray*}

In the last formula, [n] means the nearest integer to n. (It is a direct consequence of the first formula — the summation converges to \(1/e\).)

The first few values of !n for n = 0, 1, 2, 3, 4, 5, etc. are 1, 0, 1, 2, 9, 44, 265, 18,54, 14,833, ...

In base 10, only one number is equal to the sum of the subfactorials of its digits: 148,349 = !1 + !4 + !8 + !3 + !4 + !9.

Pseudocode Edit

// Standard factorial function
function factorial(z):
    result := 1
    for i from 1 to z:
        result := result * i
    return result

// Subfactorial
function subfactorial(z):
    return floor(factorial(z) / e + 0.5)

Sources Edit

  1. [1]

See also Edit

Main article: Factorial
Multifactorials: Double factorial · Multifactorial
Falling and rising: Falling factorial · Rising factorial
Other mathematical variants: Alternating factorial · Hyperfactorial · q-factorial · Roman factorial · Subfactorial · Weak factorial · Bouncing Factorial
Tetrational growth: Exponential factorial · Expostfacto function · Superfactorial by Clifford Pickover
Array-based extensions: Hyperfactorial array notation · Nested factorial notation
Other googological variants: · Superfactorial by Sloane and Plouffe · Torian · Factorexation · Mixed factorial · Bouncing Factorial

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.