Trailing Zeros
A trailing zero is produced by a factor of 10, and 10 = 2 × 5. In any factorial the supply of 2s vastly outnumbers the supply of 5s (every second number is even, but only every fifth is a multiple of 5), so the number of trailing zeros in n! is governed entirely by how many times 5 divides n!. That count is ⌊n/5⌋ + ⌊n/25⌋ + ⌊n/125⌋ + …, continuing until the divisor exceeds n. Each term catches the "extra" 5s: numbers like 25, 50, 125 contribute more than one 5. The classic CAT result is that 100! ends in 24 zeros (20 + 4), not 20. A useful sanity check: the answer is always a touch more than n/4, since the 25, 125 terms add a little to the n/5 term.
✅ Solved examples
✏️ Practice — try these, take hints as needed
📝 Topic test — 8 questions
Auto-graded with full solutions; saved to your dashboard. Use the calculator and formula sheet (top-right) any time.
Formula Reference Sheet
Core definitions & identities
| Factorial | n! = 1 × 2 × 3 × … × n |
|---|---|
| Empty product | 0! = 1! = 1 |
| Recurrence | n! = n × (n − 1)! |
| Ratio of factorials | n! / (n − r)! = n(n−1)…(n−r+1) |
| Combination | ⁿCᵣ = n! / [r!(n − r)!] |
Power & zero-counting tools
| Highest power of prime p in n! (Legendre) | ⌊n/p⌋ + ⌊n/p²⌋ + ⌊n/p³⌋ + … |
|---|---|
| Trailing zeros of n! | ⌊n/5⌋ + ⌊n/25⌋ + ⌊n/125⌋ + … |
| Power of composite (e.g. 6 = 2×3) | min of the prime-factor powers in n! |
| Power of pᵏ (e.g. 9 = 3²) | ⌊ (power of p in n!) / k ⌋ |
| Quick count of multiples of m up to n | ⌊n/m⌋ |