N! ends with exactly 30 zeros?

13.1k Views Asked by At

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

2

There are 2 best solutions below

4
On

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.

0
On

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).