15. Trailing Zeros in n! (Factorial)

Factorial n! me trailing zeros kaise nikalte hain: v5 method, Legendre link, trailing zeros in base 10, base power (10^k) divisibility, ending zeros in expressions, SSC CGL examples & practice with answers.

← Prev: Highest Power in n! (Legendre) Next: Factorial Last Digit →

1) Trailing zeros kya hote hain?

Trailing zeros = number ke end me aane wale continuous zeros. Example: 12000 me trailing zeros = 3.

2) Factorial me zeros kahan se aate hain?

Zero end me tab aata hai jab number me factor 10 ho. Aur 10 = 2 × 5. Factorial (n!) me 2 ka count bahut zyada hota hai, isliye limiting factor 5 hota hai.

So, trailing zeros in n! = number of 5s in n! = v5(n!)

3) Direct formula (most important)

Trailing zeros in n! = ⌊n/5⌋ + ⌊n/25⌋ + ⌊n/125⌋ + ...

Reason: multiples of 5 give one 5, multiples of 25 give extra one 5, multiples of 125 give extra one 5, etc.

4) Examples (SSC CGL)

Example 1: Trailing zeros in 10!

⌊10/5⌋ = 2, ⌊10/25⌋ = 0 ⇒ zeros = 2

Example 2: Trailing zeros in 25!

⌊25/5⌋ + ⌊25/25⌋ = 5 + 1 = 6

Example 3: Trailing zeros in 100!

⌊100/5⌋ + ⌊100/25⌋ + ⌊100/125⌋ = 20 + 4 + 0 = 24

5) “n! is divisible by 10^k” type

Agar n! me trailing zeros = t, to n! divisible by 10k tab hoga jab t ≥ k.

6) Trailing zeros in (n!)^m

(n!)m me factors repeat hote hain, so: zeros = m × zeros(n!)

7) Trailing zeros in product/division type (basic idea)

Product me zeros add up (v5 add), division me subtract (if divisible). SSC me common:

Example 4: Trailing zeros in 100!/50!

8) Tricky but common: trailing zeros in n!!? (not double factorial)

SSC me usually n! hi puchte hain. Agar kabhi “consecutive products” diye ho (like 1×2×...×n) wo n! hi hota hai.

9) Common traps


10) Practice (SSC CGL) + Answers

  1. Find trailing zeros in 30!.
  2. Find trailing zeros in 50!.
  3. Find trailing zeros in 125!.
  4. How many trailing zeros in (20!)2?
  5. How many trailing zeros in 100!/25! ?
  6. Maximum k such that 200! is divisible by 10k?
Show Answers
  1. ⌊30/5⌋+⌊30/25⌋ = 6 + 1 = 7
  2. ⌊50/5⌋+⌊50/25⌋ = 10 + 2 = 12
  3. ⌊125/5⌋+⌊125/25⌋+⌊125/125⌋ = 25 + 5 + 1 = 31
  4. zeros(20!) = ⌊20/5⌋ = 4 ⇒ (20!)2 zeros = 2×4 = 8
  5. v5(100!)=24; v5(25!)=6 ⇒ zeros = 24−6 = 18
  6. zeros(200!) = ⌊200/5⌋+⌊200/25⌋+⌊200/125⌋ = 40 + 8 + 1 = 49
← Prev Next →