Puzzle: Count 000...s

8666 views

Factorial of a number 'a' is defined as:

    a! = a x (a-1) x ... x 2 x 1

How many trailing zeroes are there in 100! (100 factorial) ?

0 Vote Up   |   Post Answer

By  Roshan





Roshan Singh Roshan Singh   11 years ago

Common sense:
For every factor of 10, there will be one trailing zero similarly for every factor of 5 there will be one trailing zero (as 5*2 =10, and there are enough number of 2′s). But we have to take care of repetitions.
10, 20,…., 90 = 9 zeros

100 = 2 zeros

5, 15, 25……95 = 10 zeros

and 1 extra 5 in each of 25, 50 and 75 = 3 zeros

so total 9+2+10+3 = 24 zeros.

Short formula:
total 0s = (100/5) + (100/25) + (100/125) + ... = 24

Reply    1 Vote Up   0 Vote Up