65. How many terms of the sum

$$
1+2+3+\ldots
$$

are needed to obtain a three-digit number, all of whose digits are the same?

20

![](https://cdn.mathpix.com/cropped/2024_05_21_00604dc020e3721fc1f4g-022.jpg?height=414&width=417&top_left_y=227&top_left_x=340)

## Search for solutions
65. Let's calculate the sum $1+2+3+\ldots+n$. We can write it in another way, namely $n+(n-1)+\ldots+3+2+1$. By adding the corresponding terms of these sums (the first with the first, the second with the second, etc.), we get $n+1, 2+(n-1)=n+1$, and so on. Therefore, the doubled sum $1+2+3+\ldots+n$ is $(n+1)+(n+1)+\ldots+(n+1)=(n+1) n$, which means

$$
1+2+3+\ldots+n=\frac{(n+1) n}{2}
$$

According to the problem, $\frac{(n+1) n}{2}=\overline{a a a}$. Since $\overline{a a a}=111 \cdot a$ and $111=37 \cdot 3$, then $(n+1) n$ must be divisible by 37. This means either $n=37$, or $n+1=37$. If $n=37$, then $n+1=38$, and thus $\frac{38 \cdot 37}{2}=19 \cdot 37=703$, which does not satisfy the condition. If $n+1=37$, then $n=36$, and thus $\frac{37 \cdot 36}{2}=37 \cdot 18=666 ; 1+2+3+\ldots+36=666$. Therefore, $n=36$, i.e., there are 36 terms.

![](https://cdn.mathpix.com/cropped/2024_05_21_00604dc020e3721fc1f4g-134.jpg?height=414&width=420&top_left_y=233&top_left_x=338)

## Square and Cube of a Number