Trailing Zeros of the Superfactorial 1! * 2! * ... * 50!
Board: Olympiad | Grade: Olympiad | Chapter: Legendre's Formula
Problem
Find the number of trailing zeros in base $10$ of the superfactorial product $$P = 1! \cdot 2! \cdot 3! \cdots 50!.$$
Step-by-Step Textbook Solution
Since $v_2(m!) > v_5(m!)$ for every $m \ge 2$, we have $v_2(P) > v_5(P)$, so the number of trailing zeros of $P$ is $v_5(P) = \sum_{m=1}^{50} v_5(m!)$.
For each $m \in {1, 2, \dots, 50}$, Legendre's formula gives $$v_5(m!) = \left\lfloor \frac{m}{5} \right\rfloor + \left\lfloor \frac{m}{25} \right\rfloor.$$ Summing over $m = 1, 2, \dots, 50$:
-
Sum of $\lfloor m/5 \rfloor$:
- For $m = 1..4$: $0$ (4 terms)
- For $m = 5..9$: $1$ (5 terms)
- $\dots$
- For $m = 45..49$: $9$ (5 terms)
- For $m = 50$: $10$ (1 term) $$\sum_{m=1}^{50} \left\lfloor \frac{m}{5} \right\rfloor = 5(1 + 2 + \dots + 9) + 10 = 5(45) + 10 = 235.$$
-
Sum of $\lfloor m/25 \rfloor$:
- For $m = 1..24$: $0$
- For $m = 25..49$: $1$ (25 terms)
- For $m = 50$: $2$ (1 term) $$\sum_{m=1}^{50} \left\lfloor \frac{m}{25} \right\rfloor = 25(1) + 2 = 27.$$
Adding both contributions: $$v_5(P) = 235 + 27 = 262.$$ Thus $P$ ends in $262$ zeros.
NityaDhi Solution (Intuitive Method)
Use Double Counting (Reversing the Order of Contribution): Instead of computing $v_5(m!)$ for each $m$, ask how many factorials $m!$ ($1 \le m \le 50$) contain a given multiple of $5$ or $25$:
- A multiple $5j$ ($1 \le j \le 10$) appears in $m!$ for all $m \in {5j, \dots, 50}$, i.e., $51 - 5j$ times: $$\sum_{j=1}^{10} (51 - 5j) = 510 - 5 \cdot \frac{10 \cdot 11}{2} = 510 - 275 = 235.$$
- Each multiple of $25$ ($25$ and $50$) contributes one extra factor of $5$: $$(51 - 25) + (51 - 50) = 26 + 1 = 27.$$ Total $= 235 + 27 =$ $262$.
Common Mistakes to Avoid
- Using $5$ terms for $m=50$: Treating $\lfloor m/5 \rfloor = 10$ as occurring $5$ times instead of only once (at $m=50$), or forgetting that $50!$ contributes $2$ extra factors from $25$ and $50$ instead of $1$.
- Multiplying by $50$ incorrectly: Confusing $v_5((50!)!)$ with $v_5(\prod_{m=1}^{50} m!)$.