# Number of zeroes at the end of factorial (TOMATO Objective 154)

The number 1000! = 1.2.3…1000 ends exactly with

(A) 249 zeroes;

(B) 250 zeroes;

(C) 240 zeroes;

(D) 200 zeroes;
Discussion:

To find the number of zeroes at the end of n! we just need to figure out the number of 5’s occurring in prime factorization of it.  Why? Because there are much more 2’s present than there are 5’s (every second number is even hence contributing at least one 2 to the prime factorization). Every 0 at the end of n! is basically one 10 made of one 2 and one 5.

Every fifth number contributes at least one 5.  This allows for $$\left \lfloor \frac {1000}{5} \right \rfloor$$ = 200 fives.

Again every 25th number contributes an extra 5. This allows for $$\left \lfloor \frac {1000}{25} \right \rfloor$$ = 40 extra fives.

Every 125th number contributes another extra 5. This allows for $$\left \lfloor \frac {1000}{125} \right \rfloor$$ = 8 more extra fives.

Finally every 625th number contribute one more extra 5. This allows for $$\left \lfloor \frac {1000}{625} \right \rfloor$$ = 1 more extra fives.

Hence there are total 249 fives in the prime factorization of 1000!. Hence it ends with 249 zeroes.