For a given positive integer $n$, let $S(n)$ denote the sum of the digits of $n$ when written in the decimal system. Which positive integers $M$ satisfy $S(M \cdot k) = S(M)$ for every integer $k$ such that $1 \leq k \leq M$?
I. solution. $M=1$ naturally fits, since $k$ can only be 1. For larger $M$s, let's examine the choice $k=2$. We know that a number divided by 9 gives the same remainder as the sum of its digits. Thus,

$$
9 \mid M-S(M), \quad \text { and } \quad 9 \mid 2 M-S(2 M)
$$

from which, by taking their difference,

$$
9 \mid(2 M-S(2 M)-(M-S(M))=M-S(2 M)+S(M)=M
$$

The condition of the problem can therefore only be satisfied for numbers divisible by 9, apart from 1.

Suppose $M$ is an $n$-digit number that satisfies the condition of the problem:

$$
10^{n-1} \leqq MM \geqq 10^{n}-a \geqq 10^{n}-9
$$

only one number divisible by 9 can fall into this range: $10^{n}-1$, which is the number written with $n$ nines. ($n$ is any positive integer.)

We will show that numbers of this form fit. Let $M=10^{n}-1$ and $2 \leqq k \leqq M$. Then

$$
k M=(k-1) 10^{n}+10^{n}-k=(k-1) 10^{n}+\left(10^{n}-1\right)-(k-1)
$$

Here, the first term ends with $n$ zeros, the second is the number written with $n$ nines, and the subtrahend is at most $n$-digit. Thus, the sum of the digits is again the sum of the sum of the digits of the first term and the difference. The sum of the digits of the first term is $S(k-1)$, and in forming the difference, each digit of $k-1$ must be subtracted from 9, so no carrying occurs. Thus, the sum of the digits of the difference is $9 n-S(k-1)$. The sum of the digits of $k M$ is therefore $9 n$, which is equal to $S(M)$. This is what we wanted to show.

II. solution. From the previous solution, we take over that only numbers divisible by 9 come into question, and that the numbers 1 and of the form $10^{n}-1$ fit. Relying on these, we will see that these already give all the suitable numbers.

Let $M$ be a number greater than 1 that fits. Let $n$ be the positive integer for which $\left(10^{n}-1\right) / 9 \leqq M<$ $\left(10^{n+1}-1\right) / 9$. Choosing the lower bound for $k$

$$
S(k M)=S\left((M / 9)\left(10^{n}-1\right)\right)
$$

Here, $M / 9<\left(10^{n+1}-1\right) / 81<\left(10^{n}-1\right)$. Since $\left(10^{n}-1\right)$ fits the condition of the problem,

$$
S\left(\frac{M}{9}\left(10^{n}-1\right)=S\left(10^{n}-1\right)=9 n\right.
$$

If $M$ is $n$-digit, then this can only match $S(M)$ if $M$ is the number written with $n$ nines, $10^{n}-1$. If $M$ is $(n+1)$-digit, then its first digit can only be 1 and the rest of its digits must be 0, because it is smaller than the number written with all ones. In this case, however, its sum of digits would be at most $1+9(n-1)<9 n$. Therefore, indeed only the numbers mentioned fit the condition.

This is the solution by Tamás Fleiner.

Remarks: 1. In the same way, it follows for any base $b$ number system that the numbers 1 and those written with all $(b-1)$ digits have the desired property.

2. We saw that numbers not divisible by 9 do not satisfy the desired equality even for $k=2$. However, it does not seem to be an easy question to determine the smallest $k$ for which this happens for a number divisible by 9. The second solution shows this for a somewhat larger $k$ than the first. However, a "bad" $k$ value can be found for many numbers, which is much smaller than the one provided by the first solution. For example, 2 is such a $k$ for 324, 3 for 126, 4 for 117, 5 for $351$, 6 for 189, but for $198$, the first solution provided 101 as the smallest $k$ value. It is not clear what properties of the number the smallest $k$ value depends on.