8. Given that $n$ !, in decimal notation, has exactly 57 ending zeros, find the sum of all possible values of $n$.
(1 mark)
已知 $n$ ! 以十進制表示時，末尾有剛好 57 個零。求 $n$ 所有可能值之和。
(1 分)
8. 1185
8. For positive integer $n$, let $f(n)$ denote the number of ending zeros of $n$ !. Then $f(n)$ is equal to $\left[\frac{n}{5}\right]+\left[\frac{n}{5^{2}}\right]+\left[\frac{n}{5^{3}}\right]+\cdots$. It is non-decreasing and changes at and only at multiples of 5 . Note also that $f(n)$ is slightly less than $\frac{n}{4}$, by taking its approximation with the greatest integer functions removed and the sum to infinity of the geometric series taken. Hence for $f(n)=57$, $n$ is slightly greater than $57 \times 4=228$. Hence we try $n=230$ and $n=235$ and get
$$
f(230)=\left[\frac{230}{5}\right]+\left[\frac{230}{5^{2}}\right]+\left[\frac{230}{5^{3}}\right]=56 \text { and } f(235)=\left[\frac{235}{5}\right]+\left[\frac{235}{5^{2}}\right]+\left[\frac{235}{5^{3}}\right]=57
$$
respectively. It follows that $f(n)=57$ for and only for $n=235,236,237,238$ and 239. The answer is thus $235+236+237+238+239=1185$.