Combinatorics • Topic 4
Factorials
Factorials () grow incredibly fast and appear everywhere in counting. In Olympiad math, we often look at their number-theoretic properties, such as trailing zeros and prime factorization.
Definition
Definition (Factorial)
For a non-negative integer :
Legendre's Formula
A crucial tool for finding the prime factorization of . The exponent of a prime in the prime factorization of is denoted .
Theorem (Legendre's Formula)
The sum terminates when .
Example (Trailing Zeros)
How many zeros are at the end of ?
Proof. A zero is produced by a factor of . In , factors of 2 are abundant. The limiting factor is 5. Using Legendre's Formula for :
There are 24 trailing zeros. ∎
Approximation
For very large , we use Stirling's Approximation:Practice Problems
Exercise (Problem 1)
Find the largest power of 2 that divides .
Exercise (Problem 2)
Simplify the expression .
Exercise (Problem 3)
Find the last non-zero digit of .