Factorial

Math The factorial function (\(n!\)) is a function where

\[n!=1\cdot2\cdot\;...\;\cdot (n-1)\cdot n\]

, which is the product of all numbers from 1 to n. Using the product operator,

\[n!=\prod_{k=1}^n k\]

.

The first factorial numbers are 1, 2, 6, 24, 120, ...

It can also be defined by the recurrence relation

\[ n! = \begin{cases} 1 & \text{if } n = 0, \\ (n-1)!\times n & \text{if } n > 0. \end{cases}\]

Other properties
e is a mathematical constant which is the sum of the reciprocals of the factorials. Or,

\[e=\sum_{n=0}^{\infty}\frac1{n!}\]

There are only three numbers that are sums of the factorials of its digits in base 10. They are called factorions and all the factorions in base 10 are 1, 145, and 40585.

Generalized to non-integer values
The gamma function generalizes the factorials to non-integer values.

The gamma function (\(\gamma(n)\)) is defined to be

\[\gamma(n)=\int_0^{\infty}t^{n+1}e^t\;dt\]

0! = 1
The product of no numbers at all is equal to 1.

It can be used by the recurrence relation

\[ n! = \begin{cases} 1 & \text{if } n = 0, \\ (n-1)!\times n & \text{if } n > 0. \end{cases}\]

and as this applies to numbers n > 0, we can use it for n = 0.

(1 - 1)!&times; 1 = 1, so 0! = 1.