Factorial | |
---|---|

Type | Combinatorial |

Based on | Multiplication |

Growth rate | \(f_{2}(n)\) |

The **factorial** is a function applied to whole numbers, defined as^{[1]}^{[2]}

$$n! = \prod^n_{i = 1} i = n \cdot (n - 1) \cdot \ldots \cdot 4 \cdot 3 \cdot 2 \cdot 1.$$

For example, \(6! = 6 \cdot 5 \cdot 4 \cdot 3 \cdot 2 \cdot 1 = 720\). It is equal to the number of ways \(n\) distinct objects can be arranged, because there are \(n\) ways to place the first object, \(n - 1\) ways to place the second object, and so forth. The special case \(0! = 1\) has been set by definition; there is one way to arrange zero objects.

Before the notation \(n!\) was invented, \(n\) was common.

The function can be defined recursively as \(0! = 1\) and \(n! = n \cdot (n - 1)!\). The first few values of \(n!\) for \(n = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11\) are 1, 1 , 2, 6, 24, 120, 720, 5,040, 40,320, 362,880, 3,628,800, and 39,916,800.

## Contents

## Properties

The sum of the reciprocals of the factorials is \(\sum^{\infty}_{i = 0} \frac{1}{i!} = \frac{1}{0!} + \frac{1}{1!} + \frac{1}{2!} + \frac{1}{3!} + \cdots = 2.71828182845904\ldots\), a mathematical constant better known as \(e\). In fact, \(e^x = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \cdots\), which illustrates the important property that \(\frac{d}{dx}e^x = e^x\).

Because \(n! = \Gamma (n + 1)\) (where \(\Gamma (x)\) is the gamma function), \(n! = \int^{\infty}_0 e^{-t} \cdot t^{n} dt\). This identity gives us factorials of positive real numbers (and negative non-integer real numbers), not limited to integers:

- \(\left(\frac{1}{2}\right)! = \frac{\sqrt{\pi}}{2}\)
- \(\left(-\frac{1}{2}\right)! = \sqrt{\pi}\)

The most well-known approximation of n! is \(n!\approx \sqrt{2\pi n}(\frac{n}{e})^n\), and it's called Stirling's approximation.

In base 10, only two non-trivial numbers are equal to the sum of the factorials of their digits: \(145 = 1! + 4! + 5! = 5 × 29\) and \(40,585 = 4! + 0! + 5! + 8! + 5! = 5 × 8,117\).

The number of zeroes at the end of the decimal expansion of \(n!\) is \(\sum_{k = 1} \lfloor n / 5^k\rfloor\).^{[3]} For example, 10,000! has 2,000 + 400 + 80 + 16 + 3 = 2,499 zeroes.

## Specific numbers

**153**is the sum of the factorials of the first five positive numbers, and also the exponent in the short scale quinquagintillion.- 1
^{3}+ 5^{3}+ 3^{3}= 153, thus 153 is a narcissistic number. - The first carrier frequency in the longwave radio band is at
**153**kHz. - It is also the number of fish in the second miraculous catch of fish.

- 1
**154**is the sum of the factorials of the first six nonnegative numbers, and 154! + 1 is a factorial prime.- It is also a central polygonal number and the 7th nonagonal number.
- Its prime factorization is 2 × 7 × 11.
^{[4]} - 153 and 154 are Ruth-Aaron pair.

**720**is an integer equal to 6!, the factorial of 6. Consequently, it is the order of the symmetric group of degree 6, which is isomorphic to B_{2}(2), and has an outer automorphism.- It is also the number of degrees in a hexagon.
- Furthermore, it is the number of hours in a 30-day month (April, June, September or November) not containing a DST transition.
- And some high-definition television services have 720 visible scan lines.
- Finally, it is also the number of pixels in a standard-definition television scan line.

**5,040**is an integer equal to 7!. It is the largest known factorial number which is the predecessor of a square number: 7! = 5,040 = 5,041−1 = 71^{2}−1.- Plato mentioned in his
*Laws*that 5,040 is a convenient number to use for dividing many things (including both the citizens and the land of a city-state or*polis*) into lesser parts, making it an ideal number for the number of citizens (heads of families) making up a*polis*. He remarks that this number can be divided by all the (natural) numbers from 1 to 12 with the single exception of 11 (however, it is not the smallest number to have this property; 2,520 is).

- Plato mentioned in his
**479,001,600**is equal to \(12!\), and therefore the number of possible tone rows in the twelve-tone technique.**1,124,000,727,777,607,680,000**is a positive integer equal to \(22!\). It is notable in computer science for being the largest factorial number which can be represented exactly in the`double`

floating-point format (which has a 53-bit significand).- In the short scale, this number is written as 1 sextillion 124 quintillion 727 trillion 777 billion 607 million 680 thousand.
- In the long scale, this number is written as 1 trilliard 124 trillion 727 billion 777 milliard 607 million 680 thousand.

- 70! is the smallest factorial which is greater than googol, while 69! still has only 99 digits.
- One hundred factorial's decimal expansion is shown below.
- 93,326,215,443,944,152,681,699,238,856,266,700,490,715,968,264,381,621,468,592,963,895,217,599,993,229,915,608,941,463,976,156,518,286,253,697,920,827,223,758,251,185,210,916,864,000,000,000,000,000,000,000,000

- Lawrence Hollom calls 200! faxul.
- One thousand factorial is about 4.0238726007 × 10
^{2,567}. - Aarex Tiaokhiao has proposed the name Myriadbang for 10,000!.
- One million factorial is approximately 8.2639317 × 10
^{5,565,708}. - One billion factorial is approximately 1.57637137 × 10
^{8,565,705,531}.

## Approximations for these numbers

For 5040:

Notation | Lower bound | Upper bound |
---|---|---|

Scientific notation | \(5.04\times10^3\) | |

Arrow notation | \(17\uparrow3\) | \(71\uparrow2\) |

Steinhaus-Moser Notation | 5[3] | 6[3] |

Copy notation | 4[4] | 5[4] |

Chained arrow notation | \(17\rightarrow3\) | \(71\rightarrow2\) |

Taro's multivariable Ackermann function | A(3,9) | A(3,10) |

Pound-Star Notation | #*(50)*2 | #*(51)*2 |

PlantStar's Debut Notation | [2] | [3] |

BEAF | {17,3} | {71,2} |

Bashicu matrix system | (0)[70] | (0)[71] |

Hyperfactorial array notation | 7! | |

Bird's array notation | {17,3} | {71,2} |

Strong array notation | s(17,3) | s(71,2) |

Fast-growing hierarchy | \(f_2(9)\) | \(f_2(10)\) |

Hardy hierarchy | \(H_{\omega^2}(9)\) | \(H_{\omega^2}(10)\) |

Slow-growing hierarchy | \(g_{\omega^3}(17)\) | \(g_{\omega^2}(71)\) |

## Variation

Aalbert Torsius defines a variation on the factorial, where \(x!n = \prod^{x}_{i = 1} i!(n - 1) = 1!(n - 1) \cdot 2!(n - 1) \cdot \ldots \cdot x!(n - 1)\) and \(x!0 = x\).^{[5]}

\(x!n\) is pronounced "*n*th level factorial of *x*." \(x!1\) is simply the ordinary factorial and \(x!2\) is Sloane and Plouffe's superfactorial \(x\$\).

The special case \(x!x\) is a function known as the Torian.

## Pseudocode

// Standard factorial functionfunctionfactorial(z):result:= 1forifrom1toz:result:=result*ireturnresult// Generalized factorial, using Lanczos approximation for gamma functiong:= 7coeffs:= [0.99999999999980993, 676.5203681218851, -1259.1392167224028, 771.32342877765313, -176.61502916214059, 12.507343278686905, -0.13857109526572012, 9.9843695780195716e-6, 1.5056327351493116e-7]functionfactorialReal(z):ag:=coeffs[0]forifrom1tog+ 1:ag:=ag+coeffs[i] / (z+i)zg:=z+g+ 0.5 return sqrt(2 *pi) *zg^{z + 0.5}*e^{-zg}*ag// Torsius' factorial extensionfunctionfactorialTorsius(z,x):ifx= 0:returnzifx= 1:returnfactorial(z)result:= 1forifrom1toz:result:=result*factorialTorsius(i,x- 1)returnresult

## Sources

## See also

**Multifactorials:**Double factorial · Multifactorial

**Falling and rising:**Falling factorial · Rising factorial

**Other mathematical variants:**Alternating factorial · Hyperfactorial · q-factorial · Roman factorial · Subfactorial · Weak factorial · Primorial · Compositorial · Semiprimorial

**Tetrational growth:**Exponential factorial · Expostfacto function · Superfactorial by Clifford Pickover

**Nested Factorials:**Tetorial · Petorial · Ectorial · Zettorial · Yottorial

**Array-based extensions:**Hyperfactorial array notation · Nested factorial notation

**Other googological variants:**· Superfactorial by Sloane and Plouffe · Torian · Factorexation · Mixed factorial · Bouncing Factorial

**By Harvey Friedman:** Mythical tree problem · Friedman's vector reduction problem · Friedman's finite ordered tree problem · block subsequence theorem n(4) · Friedman's circle theorem · TREE sequence TREE(3) · subcubic graph number SCG(13) · transcendental integer · finite promise games · Friedman's finite trees · Greedy clique sequence**Miscellaneous:** Factorial · Folkman's number · Exploding Tree Function · Graham's number · fusible number