Find the number of the trailing zeroes in the product of the first 2007 positive integers.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Consider all the prime factors making up 2007!. Each zero we want in our result requires one 2 and one 5. We can easily recognize that we'll have more than enough 2s to go around, and focus only on the 5s.
One-fifth of the numbers rounded down, or 401 of them, will be divisible by five and thus contribute at least one five each to the product.
One-fifth of those rounded down, or 80 of them, will be divisible by 25 and thus contribute a second five each.
One-fifth of those -- 16 -- contribute a third and in the same vein, 3 contribute a fourth.
401 + 80 + 16 + 3 = 500. How fun that the answer itself has a few trailing zeroes!