<s>[INST] How many values of $n$ are there for which $n!$ ends in $1998$ zeros? 
How many values of $n$ are there for which $n!$ ends in $1998$ zeros?

My Attempt:
Number of zeros at end of $n!$ is
$$\left\lfloor \frac{n}{5}\right\rfloor+\left\lfloor\frac{n}{5^2}\right\rfloor+\dots$$
But is there a method to get converse
 [/INST] As in my comment, let $f(n)$ denote the number of ending zeros of $n!$, for each positive integer $n$.  We define also $r(n)$ to be the largest positive integer $k$ such that $5^k\leq n$.  Then,
$$f(n)=\sum_{k=1}^{r(n)}\,\left\lfloor\frac{n}{5^k}\right\rfloor\,.$$
We see that
$$\frac{n+1}{5^k}-1\leq\left\lfloor\frac{n}{5^k}\right\rfloor \leq \frac{n}{5^k}$$
for every $k=1,2,\ldots,r(n)$.  Thus,
$$f(n)\leq \sum_{k=1}^{r(n)}\,\frac{n}{5^k}<\sum_{k=1}^\infty\,\frac{n}{5^k}=\frac{n}{4}\,.$$
This shows that $n>4\,f(n)$, or $n\geq 4\,f(n)+1$.
On the other hand,
$$f(n)\geq \sum_{k=1}^{r(n)}\,\left(\frac{n+1}{5^k}-1\right)=\frac{n+1}{4}\,\left(1-\frac{1}{5^{r(n)}}\right)-r(n)\,.$$
Because $5^{r(n)}\leq n<5^{r(n)+1}$, we see that
$$\frac{1}{5^{r(n)}}<\frac{5}{n}\,.$$
Thus,
$$f(n)>\frac{n+1}{4}\,\left(1-\frac{5}{n}\right)-r(n)=\frac{n-4}{4}-\frac{5}{4n}-r(n)>\frac{n-5}{4}-\frac{5}{16\,f(n)}-r(n)$$
(recalling that $n>4\,f(n)$).  That is, $n<4\,f(n)+4\,r(n)+5+\dfrac{5}{4\,f(n)}$. 
If $n\geq 10$ or $f(n)\geq 2$, we obtain $\dfrac{5}{4\,f(n)}<1$; therefore,
$$n\leq 4\,f(n)+4\,r(n)+5\,.$$
Because $n\leq 5\,f(n)$ clearly, we get that $$r(n)=\big\lfloor\log_5(n)\big\rfloor\leq 1+\Big\lfloor\log_5\big(f(n)\big)\Big\rfloor\,.$$
Ergo,
$$4\,f(n)+1\leq n \leq 4\,f(n)+4\,\Big\lfloor\log_5\big(f(n)\big)\Big\rfloor +9\,.$$
Note that, for a given positive integer $m$, there are at most $5$ positive integer $n$ such that $$f(n)=m\,,$$ and such integers $n$ are of the form $5t$, $5t+1$, $5t+2$, $5t+3$, and $5t+4$ for some positive integer $t$.  Therefore, if we are given the value of $m\geq 2$, then we can simply search for $t$ from
$$\left\lceil\frac{4m+1}{5}\right\rceil \leq t \leq \left\lfloor\frac{4m+4\,\big\lfloor\log_5(m)\big\rfloor+9}{5}\right\rfloor\,.$$
(The inequality above is good for $m=1$ as well.)
When $m=1998$, we have $5^4\leq m<5^5$, so that $4\leq \log_5(m)<5$.  Ergo,
$$1599\leq t \leq 1603\,.$$
Therefore, we just need to check which $t\in\{1599,1600,1601,1602,1603\}$ works (there will be at most one possible value).  It turns out that $t=1600$ leads to a solution.  Therefore, all values of $n$ are
$$8000\,,\,\,8001\,,\,\,8002\,,\,\,8003\,,\text{ and }8004\,.$$
It is definitely interesting to find a relationship between $m$ and $t$.  I expect that, for the values $m$ such that there exists a positive integer $t$ such that $m=f(5t)$, we have
$$t=\frac{4m}{5}+\lambda\,\log_5(m)+o\big(\log_5(m))$$
for some positive constant $\lambda\leq \dfrac45$.  What is the value of $\lambda$?  (Gareth Ma kindly helped with the numerical simulation.  It seems we can only say $t=\dfrac{4m}{5}+\mathcal{O}\big(\log_5(m)\big)$.)
</s>