---
title: "Trailing Zeros of the Superfactorial 1! * 2! * ... * 50!"
organization: "NityaDhi Digital Mathematics Lab (Asa Edtech Private Limited)"
url: "https://www.nityadhi.com/problems/hard-olympiad-nt-w1-legendre-superfactorial-zeros"
board: "Olympiad"
grade: "Olympiad"
published_at: "2026-11-24T15:30:00+05:30"
---

# Trailing Zeros of the Superfactorial 1! * 2! * ... * 50!

Find the number of trailing zeros in base $10$ of the superfactorial product
$$P = 1! \cdot 2! \cdot 3! \cdots 50!.$$

## 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$:
1. 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.$$

2. 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.

## Vedic Shortcut

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

- **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!)$.