2. The natural numbers from 1 to n are divided into two sets. One set contains two of the given numbers, and the second set contains the remaining $n-2$ numbers. The product of the two numbers in the first set is equal to the sum of all the numbers in the second set. Can this division be made for:
a) $n=10$,
b) $n=15 ?$
Solution. a) Let $x$ and $y$ be the numbers from the first set, such that $1 \leq x < y \leq 10$. Then, from the condition, we have $1+2+\ldots+10-x-y=x y$, from which $x y + x + y = 55$. By adding 1 to both sides, we get $x y + x + y + 1 = 56$, from which $(x+1)(y+1)=56$. If $x+1=7$ and $y+1=8$, i.e., if $x=6$ and $y=7$, a division into two such sets is possible for $n=10$. Specifically, we have

$$
1+2+3+4+5+8+9+10=6 \cdot 7
$$

b) Let $x$ and $y$ be the numbers from the first set, such that $1 \leq x < y \leq 15$. Then, from the condition, we have $1+2+\ldots+15-x-y=x y$, from which $x y + x + y = 120$, and similarly as before, we get $(x+1)(y+1)=121$. Since $x < y$, the possible cases are $x+1=1, y+1=121$ or $x+1=11, y+1=11$. In the first case, we get $x=0, y=120$, which is not possible because $x \geq 1$ and $y \leq 15$. In the second case, we get $x=y=10$, which is also not possible because $x \neq y$. Therefore, for $n=15$, such a division is not possible.