5

How many values of N exist, such that N! ends with exactly 30 zeros?

2 Answers2

10

The number of zeros at the and of $n!$ is just the number of factors of $5$ in $n!$ (since the number of factors of $2$ in $n!$ is always larger than that). So, we need all $n$ such that the numbers $1$ up to $n$ have a total of $30$ factors of $5$. A first guess would be $30\cdot 5=150$, but then we forget that the multiples of $5^2=25$ have (at least) two factors of $5$. Since there are $5$ multiples of $25$ below $150$, we should try $n=125$. The numbers below $125$ have a total of $$\frac{120}{5}+\left\lfloor\frac{120}{25}\right\rfloor=24+4=28<30$$ factors of $5$. If we include $125=5^3$, the number of factors increases with $3$ so it becomes $31>30$. Thus, we find that the are no $n$ such that $n!$ has $30$ factors of $5$ or s.t. $n!$ ends with $30$ zeros.

Ragnar
  • 6,233
  • I understand that n! must have exactly 30 factors of 5. Then you said first guess will be 30.5...what do you mean by that?..first guess of what? – Gitika Aug 06 '20 at 19:47
  • how did you get the first guess..couldn't understand:| – Gitika Aug 06 '20 at 19:48
  • are you saying that the number of factors of 5 in n! increase as n increases? – Gitika Aug 06 '20 at 19:49
  • Yes. The number of factors of 5 in n! is $\sum_{i \geq 1} \lfloor n/5^i\rfloor$, so n/5 is a rough approximation of this. – Ragnar Aug 11 '20 at 08:51
0

As explained in this answer, for a prime $p$, the number of factors of $p$ in $n!$ is $$ \frac{n-\sigma_p(n)}{p-1} $$ So as an estimate, we can use $n/4$ for the number of factors of $5$ that divide $n!$. For $30$ zeros, we would try $n=120$ ($440_\text{five}$). $$ \frac{120-8}{5-1}=28 $$ Since no factors of $5$ are added until $n=125$ ($1000_\text{five}$), and that adds $3$, we have $31$ factors of $5$: $$ \frac{125-1}{5-1}=31 $$ Thus, there are no integer values of $n$ so that $n!$ ends in $30$ zeros (in decimal).

robjohn
  • 345,667