# how many zeroes does 2012! have at the end? [duplicate]

How many zeroes does $2012!$ end with?

My idea is:

402 zeroes come from $2\times 5$, 80 from $2\times 25$, 16 from $2\times 125$ and 3 from $2\times 625$

How can we "show" that this is true?

-

## marked as duplicate by Marvis, Qiaochu YuanMay 5 '12 at 20:00

Asked here the general case for $n!$(Derive a formula to find the number of trailing zeroes in $n!$) –  Américo Tavares Mar 13 '12 at 16:34
You know that you can accept one of the answers by clicking on the tick mark (right?) Doesn't have to be necessarily mine –  Kirthi Raman Mar 14 '12 at 14:30

In order to find the number of zeros is same as finding the number of factors of powers of $5$. There are more factors of powers of $2$ than the factors of powers of $5$.

For instance $10! = 3628800 = \hspace{3pt}2^8 \hspace{3pt} 3^4 \hspace{3pt}5^2\hspace{3pt} 7$

$$\left \lfloor \frac{n}{p} \right \rfloor +\left \lfloor \frac{n}{p^2} \right \rfloor +\left \lfloor \frac{n}{p^3}\right \rfloor + \cdots \left \lfloor \frac{n}{p^{k-1}} \right \rfloor$$

where $\left \lfloor \frac{n}{p^k} \right \rfloor=0$. In this case $k=5$ because $\left \lfloor \frac{2012}{5^5} \right \rfloor=0$

$$\left \lfloor \frac{2012}{5} \right \rfloor =402, \hspace{6pt} \left \lfloor \frac{2012}{5^2} \right \rfloor = \left \lfloor \frac{402}{5} \right \rfloor =80$$

$$\left \lfloor \frac{2012}{5^3} \right \rfloor = \left \lfloor \frac{80}{5} \right \rfloor =16, \hspace{6pt} \left \lfloor \frac{2012}{5^4} \right \rfloor = \left \lfloor \frac{16}{5} \right \rfloor =3$$

$$\left \lfloor \frac{2012}{5} \right \rfloor+ \left \lfloor \frac{2012}{5^2}\right \rfloor +\left \lfloor \frac{2012}{5^3}\right \rfloor +\left \lfloor \frac{2012}{5^4} \right \rfloor = 402+80+16+3=501$$

-
+1 for being reader friendly, Oh, well, we don't expect people to follow suit. But, may I ask you that you'll replace this with a MathJaX version when it recovers? –  user21436 Mar 13 '12 at 13:27
Oh yes, I also would prefer that. –  Kirthi Raman Mar 13 '12 at 13:32
Also, I'd recommend \left \lfloor \frac{...}{...} \right \rfloor for writing the floor of a fraction in LaTeX. –  Ilmari Karonen Mar 13 '12 at 13:55
Thanks Kirthi Raman! –  VVV Mar 14 '12 at 16:15

The power of any prime $p$ in $n!$ is given by

$[\frac{n}{p} ] + [\frac{n}{p^2}] + [\frac{n}{p^3}].......$

The number of zeros in $2012!$is the number of times 5 occurs in its prime factorization

$[\frac{2012}{5} ] + [\frac{2012}{25}] + [\frac{2012}{125}] + [\frac{2012}{625}] + [\frac{2012}{3125}]$= $402 + 16+ 80 + 3 = 501$

hence $2012!$ has $501$ zeros.

-
Thanks 5ToM...! –  VVV Mar 14 '12 at 16:14
Your most welcome tripleV! –  Tomarinator Mar 14 '12 at 16:41

As you have noticed, zeros come only from the product of an even integer with a multiple of 5. Since there are less multiples of 5 than multiples of 2, you only have to consider multiples of 5. Now multiples of powers of 5 contribute more than one zero. So the number of zeros in $n!$ is $$\def\F#1{\left\lfloor \frac{n}{#1}\right\rfloor} \F{5}+ \F{5^2} + \F{5^3} + \cdots$$

-
Please check "there are more multiples of 5 than multiples of 2". I think there is a typo: "there are less multiples of 5 than multiples of 2" –  Américo Tavares Mar 13 '12 at 16:39
@AméricoTavares, fixed, thanks! –  lhf Mar 13 '12 at 18:21
Thanks, lhf... ! –  VVV Mar 14 '12 at 16:14