## Task 3/77  How many zeros does the number 1000! end with?
The question of the task is identical to the question of how often the factor $10=2 \cdot 5$ is contained in the product 1000!. Therefore, it is necessary to determine the number of prime factor pairs $(2 ; 5)$. To do this, we determine the numbers $A_{2}$ and $A_{5}$ of the prime factors 2 and 5, respectively, and the smaller of the two is the one we are looking for.

The number $A_{p}$ of prime factors $p$ in the product $n!=1 \cdot 2 \cdot 3 \cdot \ldots \cdot n$ is

$$
A_{p}=\sum_{k=1}\left[\frac{n}{p^{k}}\right]
$$

where $[x]$ denotes the largest integer $a \leq x$.

Each individual term of this sum gives the number of numbers $i_{k}$ with $1 \leq i_{k} \leq n$ that contain the prime factor $p$ at least $k$ times. (If $k>\log _{p} n=\frac{\lg n}{\lg p}$, then $p^{k}>n$, so $\frac{n}{p^{k}}<1$ and thus $\left[\frac{n}{p^{k}}\right]=0$.) Since $p_{2}$ follows from $\frac{n}{p^{k-1}}=\frac{n}{p^{k-2}}$ for each $k$ and thus $A_{p 1}<A_{p 2}$. Therefore, $A_{5}$ is the number we are looking for:

$$
A_{5}=\left[\frac{1000}{5}\right]+\left[\frac{1000}{25}\right]+\left[\frac{1000}{125}\right]+\left[\frac{1000}{625}\right]=200+40+8+1=249
$$

Thus, the product 1000! ends with 249 zeros.