Is there an $n$ for which the number $n!$ ends with 1971 zeros? Is there an $n$ for which the number of trailing zeros in $n!$ is 1972? (By $n!$ we mean the product of natural numbers from $n$ down to 1.)
An integer $N$ has $s$ zeros at the end of its decimal representation - and a non-zero digit before them - if and only if the number is divisible by the $s$-th power of $10=2 \cdot 5$, but not by the $(s+1)$-th power. This means that if we express $N$ as a product of prime powers - in a well-known phrase: factorize it into prime factors - then the smaller of the exponents of 2 and 5 is exactly $s$, and the other is at least $s$. We will see that taking $N$ in the form of $n!$, it will be enough to achieve that the exponent of the prime factor 5 is 1971 or 1972.

The factors of $n!$ in increasing order, starting from 1, every 5th factor is divisible by 5, thus it brings $1 \mathrm{db} 5$-factor into the prime factorization of $n!$, every 25th factor is divisible by $25=5^{2}$, thus it brings 1 more 5, every $125=5^{3}$, every $5^{4}, 5^{5}$ indexed factor brings 1 more 5, and so on. For example, up to $n=8000$, the number of factors divisible by 5, $5^{2}$, $5^{3}$, $5^{4}$, $5^{5}$ are respectively

$$
\frac{8000}{5}=1600, \quad \frac{8000}{25}=\frac{1600}{5}=320, \quad \frac{320}{5}=64, \quad \frac{64}{5}=12, \ldots, \quad \frac{12}{5}=2, \ldots
$$

in the last two divisions, we only wrote down the integer part of the quotient, since the number divisible by 5, $5^{2}$, ... is always at the end of the sequence of factors $5,5^{2}, \ldots$. ( $5^{6}>8000$, so no factor brings in 6 5s.) Thus, the number of zeros at the end of 8000! is $1600+320+64+12+2=1998$, indeed the number of 2-factors is larger than this, as the number of even factors is 4000.

The result 1998 is slightly more, by 27, than the desired number 1971, so let's try to go back, for example, by 100, to $n=7900$. This way we leave out $100: 5=20 \mathrm{db} 5$-divisible numbers, $20: 5=4 \mathrm{db} 25$-divisible numbers, and since 8000 itself is divisible by $5^{3}$ but not by $5^{4}$, the number of zeros at the end of 7900! is $20+4+1=25$ less, that is 1973, which is only 2, or 1, less than the required number. If we also leave out the 7900, which is divisible by $5^{2}$, the number of zeros decreases by 2, to 1971, and we get answers to both questions:

1971 is the number of zeros if $n=7899,7898,7897,7896,7895$, since stepping back to 7894 also decreases the number by 1, and there is no $n$ for which the number of zeros at the end of $n!$ is 1972.

Looking back, the exponent of the 2-factor in $n!$ is the smallest for the found $n$ values up to 7895, and with [ ] denoting the integer part of the number:

$$
\left[\frac{7895}{2}\right]=3947>1971
$$

Sarolta Máthé (Budapest, Apáczai Csere J. Gyak. Gimn., II. o. t.) Mária Kanyó (Szeged, Ságvári E. Gyak. Gimn., I. o. t.)

Remarks. 1. We outline a path that leads us to the result with fewer trials. According to the above reasoning, taking $n$ as the $k$-th positive integer power of 5, the number of 5-factors (and trailing zero digits) in $n!$ can be expressed with $k$:

$$
\frac{5^{k}}{5}+\frac{5^{k}}{5^{2}}+\frac{5^{k}}{5^{3}}+\ldots+\frac{5^{k}}{5^{k}}=\frac{5^{k}-1}{4}
$$

this can be easily proven by complete induction.

After $5^{k}$, the above reasoning starts from the beginning with each sequence of $5,5^{2}, \ldots, 5^{k}$ consecutive factors, so it is natural - we leave the proof to the reader - to think of $n$ written in the base 5 number system:

$$
n=j_{m} \cdot 5^{m}+j_{m-1} \cdot 5^{m-1}+\ldots+j_{1} \cdot 5+j_{0}
$$

where we denoted the digits with $j_{i}$, $1 \leq j_{m} \leq 4$, and for $0 \leq i \leq m-1$, $0 \leq j_{i} \leq 4$. Then the exponent of 5 in $n!$ can be expressed with $n$ and the sum of the $j$ digits, applying (1) with $k$ taking the values $m, m-1, \ldots, 1,0$.

2. We recommend to the interested readers the study of the 2nd problem of the 1925 Eötvös Loránd Competition of the Mathematical Society 1[^0]

[^0]:    ${ }^{1}$ József Kürschák - György Hajós - Gyula Neukomm - János Surányi: Mathematical Competition Problems, Part I (1894-1928 competitions), 3rd edition, Tankönyvkiadó, Budapest 1965, p. 124.