Factorial of a natural number n, written n! and read "n factorial" (or "factorial of n"), is the product of the first n natural numbers:
n!=1×2×3×⋯×n.
The notation n! was introduced by the French mathematician Christian Kramp in 1808. For a positive integer n, factorial unwinds recursively:
n!=n(n−1)! (n>1)=n(n−1)(n−2)! (n>2)=n(n−1)(n−2)(n−3)! (n>3), and so on.
Small values: 1!=1, 2!=2, 3!=6, 4!=24, 5!=120, and 22!=1124000727777607680000 — the number 22 (Ramanujan's birth date) is the least integer N>1 whose factorial has exactly N digits (finding the next such N is left as an exercise for students and teachers alike!).
Why 0!=1. Substituting n=0 into the recursion (n+1)!=(n+1)×n! gives 1!=(0+1)×0!⇒1=1×0!⇒0!=1. This convention extends the idea of factorial to non-negative integers (factorial can in fact be extended further, to certain negative and complex numbers, but that is beyond this course).
Peeling off common factorial factors is the single most useful factorial trick: e.g. 6!−5!=6⋅5!−5!=(6−1)5!=5×120=600, and 5!×2!8!=5!×2!8×7×6×5!=28×7×6=168.
A useful identity (Example 4.24). n!(2n)!=2n(1⋅3⋅5⋯(2n−1)) — proved by splitting (2n)! into its odd factors 1⋅3⋅5⋯(2n−1) and its even factors 2⋅4⋅6⋯(2n)=2n⋅n!, so (2n)!=(1⋅3⋯(2n−1))×2nn!, and dividing by n! gives the stated identity. (This identity resurfaces later to prove 2nCn=n!2n×1×3×5⋯(2n−1).)
Double Factorial. Factorial can be viewed as a function f:N∪{0}→N, f(0)=1, f(n)=n(n−1)(n−2)⋯3⋅2⋅1 for n=0. The double factorial n!! is defined by …