5. For which natural numbers $n \geq 3$ can a set of $n$ identical numbers be obtained from the set of numbers $1,2, \ldots, n$ in a finite number of steps, if in one step you can choose two arbitrary numbers and increase each by the same arbitrary natural number?
Answer. For all $n \neq 4k+2$.

Solution. We will show that for $n=4k$ this is possible. In this case, the set of numbers written on the board is:

$$
1,2,3,4,5,6, \ldots, 4k-3,4k-2,4k-1,4k
$$

We proceed as follows: $(1; 3) \rightarrow (2; 4), (5; 7) \rightarrow (6; 8), \ldots, (4k-3; 4k-1) \rightarrow (4k-2; 4k)$.

Now on the board, all even numbers are written, and each number appears exactly twice:

$$
2,2,4,4,6,6, \ldots, 4k-2,4k-2,4k, 4k
$$

Next, we combine all identical numbers into pairs and bring them to the form $(4k; 4k)$.

For $n=2k+1$, this is also possible. In this case, the set of numbers written on the board is:

$$
1,2,3,4,5,6, \ldots, 2k-2,2k-1,2k, 2k+1
$$

First step: $(1; 2k+1) \rightarrow (2; 2k+2)$, then the numbers on the board are:

$$
2,2,3,4,5,6, \ldots, 2k-2,2k-1,2k, 2k+2
$$

Second step: $(3; 2k+2) \rightarrow (4; 2k+3)$, then the numbers on the board are:

$$
2,2,4,4,5,6, \ldots, 2k-2,2k-1,2k, 2k+3
$$

Third step: $(5; 2k+3) \rightarrow (6; 2k+4)$, then the numbers on the board are:

$$
2,2,4,4,6,6, \ldots, 2k-2,2k-1,2k, 2k+4
$$

After the $k$-th such step, the numbers on the board are:

$$
2,2,4,4,6,6, \ldots, 2k-2,2k-2,2k, 2k, 3k+1
$$

Thus, on the board, all even numbers less than $2k+1$ are written. Each number appears exactly twice. And the number $3k+1$ is also written. Next, we combine all identical numbers into pairs and bring them to the form $(3k+1; 3k+1)$.

We will prove by contradiction that for $n=4k+2$ this is impossible. The sum of the numbers from the beginning is odd: $1+2+\cdots+4k+2=\frac{1}{2}(4k+2)(4k+3)=(2k+1)(4k+3)$. Each time we increase the sum of all numbers by an even number, but in the end, all numbers should become the same, so their sum will be even. This contradiction completes the proof.

Comment. 7 points for a complete solution of the problem in this way can be distributed as follows: one of the cases $n=4k$ or $n=2k+1$ is considered - 2 points, both of these cases are considered - 5 points. The case $n=4k+2$ is considered - another 2 points. For the consideration of examples without a solution - 1-2 points.