3. The sum of all natural numbers from 1 to $n$ is equal to a three-digit number with identical digits. How many natural numbers are summed?
Solution. From the condition of the problem, we get

$$
\begin{aligned}
& 1+2+3+\ldots+n=\overline{k k k} \\
& \frac{n(n+1)}{2}=111 k
\end{aligned}
$$

$$
n(n+1)=222 k=2 \cdot 3 \cdot 37 k
$$

The left side of the last equation is the product of two consecutive numbers, and on the right side, one of the factors is the number 37, which is a prime number. According to this, the second factor can be 36 or 38. However, the number 38 is not divisible by 3, so the second factor is 36, where $k=6$. Thus, $n(n+1)=36 \cdot 37$, from which we conclude that the sum of the first 36 natural numbers is 666.