×

# Number of trailing zeroes in $$10^{n}!$$

Okay, this is something I've noticed. The number of trailing zeroes in

$$1!$$ is $$0$$.

$$10!$$ is $$2$$.

$$100!$$ is $$24$$.

$$1000!$$ is $$249$$.

$$10000!$$ is $$2499$$.

$$100000!$$ is $$24999$$.

Is there, like, a generalisation or a proof or something for this? And is this result, or observation, useful? Comment any of your thoughts you believe add to this.

Note by Omkar Kulkarni
2 years, 6 months ago

Sort by:

Well, I can give you this formula ${ 10 }^{ n }!\Rightarrow \sum _{ k=1 }^{ \infty }{ \left\lfloor \frac { { 10 }^{ n } }{ 5^{ k } } \right\rfloor }$

And the pattern only continues until $$n$$ is $$5$$, beyond that, there will still be a long chain of $$9$$'s but it is not exactly as what you put here. For example, for $$n=200$$, number of trailing $$0$$'s is $$24999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999959$$ · 2 years, 6 months ago

Oh · 2 years, 6 months ago

I can't spot a pattern in how close it is to what you conjectured (it always seems to be quite close though) but I found a reason why the number of trailing zeroes will tend to be very close to 10^n/4.

Clearly, the number of trailing zeroes is simply the exponent of the 5's in the prime factorization of (10^n)!. If we go by from 1 to 10^n in the expansion of (10^n)! (1234...10^n) and write down the exponent of the greatest power of 5 that divides each number, we notice that 4 in every 25 numbers in the series has a 1, 4 in every 125 has a two, and so on. This allows us to make the following approximation for the exponent of the 5's:

4/25 * 10^n +2 * 4/125 * 10^n... = 4 * 10^n * [1/25+2/125+3/625...]

We can evaluate [1/25+2/125+3/625...] pretty easily:

5S= [1/5+1/25...] + [1/25+1/125...]+...

5S=1/4 + 1/20 + 1/100...

S=1/16

Which shows that we'll get about 10^n/4 trailing zeroes. As n becomes larger, the first few terms will become more accurate (percentage wise) because the error is within a certain range. I'll give an example:

   Let's say I'm looking at the 4/25 * k term (where k! is the number you are trying to find the trailing zeroes for). If n is small, say 35, this term is 5.6 (when we wanted 6). If n is large, say 20,035, we get 3205.6 (when we wanted 3206). As you can see, adding 25's makes no difference to the error, but adding 1-24 does. This means that the error, percentage wise, becomes less as n becomes large! The same concept can be applied to the 4/125 * k  term, and the accuracy for each term goes up.


So for a large n, the result of the approximation becomes more accurate. Your observation was mostly true :) · 2 years, 6 months ago