How many zeros does the number end with, which is equal to the product of the first 10000 numbers?





Translate the above text back into Hungarian, please keep the original text's line breaks and format, output the translation result directly.

In the product $P=1 \cdot 2 \cdot 3 \ldots 9999 \cdot 10000$, the factor 5 appears $k$ times, so 10 will also appear $k$ times, because $5^{k} \cdot 2^{k}=10^{k}$. Therefore, $P$ will end in as many zeros as the number of times 5 appears as a factor $\square^{1}$

Let $R(5a)$ denote the number that indicates how many times 5 appears as a factor in the product

$$
Q=1 \cdot 2 \cdot 3 \ldots (5a-1) 5a
$$

Since 5 is a prime number, 5 appears as many times in $Q$ as a factor as in the product

$$
(5 \cdot 1)(5 \cdot 2)(5 \cdot 3) \ldots (5 \cdot a)=5^{a} \cdot 1 \cdot 2 \cdot 3 \ldots a
$$

Thus,

$$
R(5a)=a+R(a)
$$

Apply this formula to our problem:

$$
\begin{aligned}
& R(10000)=R(5 \cdot 2000)=2000+R(2000) \\
& R(2000)=R(5 \cdot 400)=400+R(400) \\
& R(400)=R(5 \cdot 80)=80 \quad+R(80) \\
& R(80) \quad=R(5 \cdot 16) \quad=16 \quad+R(16) \\
& \text { and } \quad 2 t-10 \\
& R(16) \quad=3
\end{aligned}
$$

Add the left and right sides of these equalities:

$$
\begin{gathered}
R(10000)+R(2000)+R(400)+R(80)+R(16)= \\
=2000+400+80+16+3+R(2000)+R(400)+R(80)+R(16)
\end{gathered}
$$

Thus,

$$
R(10000)=2499
$$

and so $P$ ends in 2499 zeros.

The problem was solved by: Erdős V., Kovács Gy., Neumann L., Paunz A., Sárközy P.[^0]


[^0]:    ${ }^{1}$ See the solution to problem 1034 on page 105.