...

Puzzle: "How many trailing zeros does 1000! have?"




Solution:

- First, it is easy to find out that when 2 multiplies 5, we will have a 10, which will add a trailing zero.

- At the same time, there are 1000 / 2 = 500 --> the number of 2's multiples in 1000, and 5's multiples must be smaller than this number, meaning that whenever once we find a multiple of 5, we can always pair it with a number which can be split into 2 times something.

- We just need to count the number of 5's multiples, 100 / 5 = 200.

- However, we also know that 5*5 = 25, and 5*5*2 = 100 ---> we will have trailing zeros.

- How many numbers with more than one 5 included?

1000 / (5*5) = 40
1000 / (5*5*5) = 8
1000 / (5^4) = 1.6, and we count the integer 1, because we only have one 625.
- Adding them up, the answer is just 249.