# Problem 5.

The carriages of the express train "Moscow - Yalta" must be numbered consecutively, starting from one. But in a hurry, two adjacent carriages received the same number. As a result, it turned out that the sum of the numbers of all carriages is 111. How many carriages are in the train and which number was used twice?

#
# Solution.

Let's start calculating the sums sequentially

$$
\begin{aligned}
& 1+2=3 \\
& 1+2+3=6 \\
& \cdots \\
& 1+2+\ldots+14=105 \\
& 1+2+\ldots+14+15=120
\end{aligned}
$$

From this, it is clear that the first 14 wagons had the first 14 sequential numbers, which sum up to 105, and one more wagon had a number equal to \(111-105=6\).

Answer. There were 15 wagons in the train, two of which had the number 6.