$10 \cdot 110$ For a positive integer $n$, let $S(n)$ denote its digit sum. Find all positive integers $M$ such that for every positive integer $k$ not exceeding $M$, we have $S(M k)=S(M)$.
(Hungarian Mathematical Olympiad, 1990)
[Solution] We prove: except for the trivial case $M=1$, (1) holds if and only if $M=10^n-1$.
$$
\begin{array}{c}
S(M k)=S(M). \\
\text { When } M=10^{n}-1, \text{ for } 2 \leqslant k \leqslant M, \\
k M=(k-1) \cdot 10^{n}-(k-1)+\left(10^{n}-1\right).
\end{array}
$$

Therefore, equation (1) holds.
Conversely, if equation (1) holds, suppose $M$ has $n$ digits, and the leading digit is $d$, then
$$
\begin{array}{l}
M=d \cdot 10^{n-1}+m, \\
S(M)=d+S(m).
\end{array}
$$

Take $k=10^{n-1}+1$, then
$$
\begin{array}{l}
k M=m+10^{n-1}(d+M), \\
S(M k)=S(m)+S(M+d) \\
d=S(M+d).
\end{array}
$$

Thus, if $d < 9$, then $S(M+d) > d$, which contradicts (2).

Assume $d=9$. If $M$ has a digit less than 9, then $S(M+d) > d$, which does not satisfy (2). Therefore, all digits of $M$ are 9.