NO MATH ANXIETY ✦ NON-ENGINEERS ONLY ✦ 100% CONCEPT CLARITY ✦ CRACK MBA LIKE A BOSS ✦ NO MATH ANXIETY ✦ NON-ENGINEERS ONLY ✦ 100% CONCEPT CLARITY ✦ CRACK MBA LIKE A BOSS ✦
Number System Module ✦ Concept 13 / 13

Trailing Zeros & Legendre's Formula

Master how to calculate trailing zeros in factorials (N!) and product series, find the highest power of prime or composite numbers, and solve reverse zero questions for CAT.

The Bodhi Vault / Quant Vault / Trailing Zeros
DEFINITION

What Creates a Trailing Zero?

A trailing zero is produced whenever a factor of 2 multiplies a factor of 5 (10 = 2 × 5).

Trailing Zeros = min(Highest Power of 2, Highest Power of 5)
CORE INTUITION 0️⃣

Factorial Limiting Factor

In any factorial N! = 1 × 2 × 3 × ... × N, multiples of 2 are far more abundant than multiples of 5:

  • • Power of 5 is ALWAYS the limiting factor in N!
  • • Trailing zeros in N! = Highest Power of 5 in N!
  • • For general products (e.g. 5 × 10 × 15...): ALWAYS check both 2 and 5 powers!
In series of multiples of 5, powers of 2 can become the limiting factor!
💡 WHY THIS CONCEPT MATTERS IN MBA EXAMS

Trailing zero and factorial power questions are recurring core topics in CAT, XAT, NMAT, and SNAP:

CAT Factorial Powers
Legendre's Formula E_p(N!)
Composite Power Limits
Reverse Trailing Zeros
Non-Factorial Series
Factorials Addition (N! + M!)
SNAP 30-Sec Trailing Hacks
NMAT Factorial Drills
📐 LEGENDRE'S FORMULA (DE POLIGNAC'S THEOREM)

Highest Power of Prime p in N!

Eₚ(N!) = ⌊N/p⌋ + ⌊N/p²⌋ + ⌊N/p³⌋ + ...

Sum of integer divisions until denominator exceeds N. Example for 100! power of 5 → ⌊100/5⌋ + ⌊100/25⌋ = 20 + 4 = 24 zeros.

Highest Power of Composite K in N!

For K = p₁ᵃ · p₂ᵇ:
Power = min( ⌊E_p1/a⌋, ⌊E_p2/b⌋ )

Example: Highest power of 12 (2² × 3) in 50! → min( ⌊47/2⌋, ⌊22/1⌋ ) = min(23, 22) = 22.

Zeros in Sum: N! + M! (N < M)

Zeros(N! + M!) = Zeros(N!)

When adding factorials of different magnitudes, the smaller factorial determines the trailing zeros! Example: 10! + 100! → 2 zeros.

📝 STEP-BY-STEP SOLVED EXAMPLES
LEVEL 1: EASY Factorial Trailing Zeros

Find the number of trailing zeros in 150!.

• Apply Legendre's formula for p = 5:

⌊150 / 5⌋ = 30

⌊30 / 5⌋ = 6

⌊6 / 5⌋ = 1

⌊1 / 5⌋ = 0

• Total trailing zeros = 30 + 6 + 1 = 37.

LEVEL 2: MEDIUM Product Series Zeros

Find trailing zeros in P = 5 × 10 × 15 × ... × 250.

• Factor out 5 from 50 terms: P = 5⁵⁰ × (50!).

• Power of 5 in P = 50 + E₅(50!) = 50 + (10 + 2) = 62.

• Power of 2 in P = E₂(50!) = 25 + 12 + 6 + 3 + 1 = 47.

• Since 2 is the limiting factor: Zeros = min(62, 47) = 47.

LEVEL 3: HARD (CAT PATTERN) Highest Composite Power

Find the highest power of 72 that divides 100!.

• Prime factorize 72 = 2³ × 3².

• Step 1: E₂(100!) = 50 + 25 + 12 + 6 + 3 + 1 = 97 → ⌊97 / 3⌋ = 32.

• Step 2: E₃(100!) = 33 + 11 + 3 + 1 = 48 → ⌊48 / 2⌋ = 24.

• Step 3: Take minimum → min(32, 24) = 24.

• Answer: Highest power of 72 in 100! is 72²⁴.

⚠️ COMMON PITFALLS TO AVOID

Mistake 1: Assuming 5 is Always Limiting

In series like 5 × 10 × 15... or 5 × 15 × 25..., powers of 5 are abundant while powers of 2 are scarce. Always check BOTH 2 and 5 in non-factorial products!

Mistake 2: Forgetting Composite Exponents

When finding highest power of 72 (2³ × 3²), do NOT just find E₂(N!). You MUST divide E₂(N!) by 3 and E₃(N!) by 2 before taking the minimum!

Mistake 3: Reverse Jump Gaps

Every multiple of 5 adds 1 zero, but multiples of 25 add 2 zeros, 125 add 3 zeros! This creates skipped counts (e.g. 5, 11, 17, 23, 29, 30 zeros NEVER exist in any N!).

🎯 PRACTICE QUESTIONS

Q1: How many values of N exist such that N! ends in exactly 30 trailing zeros?

View Solution
• For 124! → ⌊124/5⌋ + ⌊124/25⌋ = 24 + 4 = 28 zeros.
• For 125! → ⌊125/5⌋ + ⌊125/25⌋ + ⌊125/125⌋ = 25 + 5 + 1 = 31 zeros.
• Zeros jump directly from 28 to 31! No value of N produces 29 or 30 zeros.
• Answer: 0 values.

Q2: Find the number of trailing zeros in 100! × 200!.

View Solution

• Zeros in 100! = 20 + 4 = 24 zeros.

• Zeros in 200! = 40 + 8 + 1 = 49 zeros.

• For multiplication, trailing zeros ADD UP: 24 + 49 = 73 zeros.

Q3: Find the number of trailing zeros in (50!)⁵⁰.

View Solution

• Zeros in 50! = 10 + 2 = 12 zeros.

• For (50!)⁵⁰, trailing zeros MULTIPLY by exponent: 12 × 50 = 600 zeros.

❓ FREQUENTLY ASKED QUESTIONS

How do you calculate the number of trailing zeros in N!?

The number of trailing zeros in N! equals the highest power of 5 present in N!, calculated using Legendre's formula: ⌊N/5⌋ + ⌊N/25⌋ + ⌊N/125⌋ + ...

What is Legendre's Formula?

Legendre's Formula gives the highest exponent of a prime p that divides N!, given by E_p(N!) = ⌊N/p⌋ + ⌊N/p²⌋ + ⌊N/p³⌋ + ...

Why do we count powers of 5 instead of powers of 2 for trailing zeros in factorials?

A trailing zero is formed by 10 = 2 × 5. In any factorial N!, multiples of 2 occur every 2 numbers while multiples of 5 occur every 5 numbers. Hence powers of 2 are always more abundant, making 5 the limiting factor.

How do you find the highest power of a composite number K in N!?

Prime factorize K = p₁ᵃ · p₂ᵇ. Compute the highest power of each prime factor p_i in N! using Legendre's formula, then take min(⌊E_p1/a⌋, ⌊E_p2/b⌋).

Can a factorial N! end in 5 trailing zeros?

No! For 24!, trailing zeros = 4. For 25!, 25 = 5² adds 2 factors of 5, making zeros = 6. The number of trailing zeros jumps from 4 to 6, skipping 5!