Subfield: Combinatorics


Question: Consider an integer $n \geq 2$ and write the numbers $1,2, \ldots, n$ down on a board. A move consists in erasing any two numbers $a$ and $b$, and, for each $c$ in $\{a+b,|a-b|\}$, writing $c$ down on the board, unless $c$ is already there; if $c$ is already on the board, do nothing. For all integers $n \geq 2$, determine whether it is possible to be left with exactly two numbers on the board after a finite number of moves.

Solution:
The answer is in the affirmative for all $n \geq 2$. Induct on $n$. Leaving aside the trivial case $n=2$, deal first with particular cases $n=5$ and $n=6$.



If $n=5$, remove first the pair $(2,5)$, notice that $3=|2-5|$ is already on the board, so $7=2+5$ alone is written down. Removal of the pair $(3,4)$ then leaves exactly two numbers on the board, 1 and 7 , since $|3 \pm 4|$ are both already there.



If $n=6$, remove first the pair $(1,6)$, notice that $5=|1-6|$ is already on the board, so $7=1+6$ alone is written down. Next, remove the pair $(2,5)$ and notice that $|2 \pm 5|$ are both already on the board, so no new number is written down. Finally, removal of the pair $(3,4)$ provides a single number to be written down, $1=|3-4|$, since $7=3+4$ is already on the board. At this stage, the process comes to an end: 1 and 7 are the two numbers left.



In the remaining cases, the problem for $n$ is brought down to the corresponding problem for $[n / 2\rceil<n$ by a finite number of moves. The conclusion then follows by induction.



Let $n=4 k$ or $4 k-1$, where $k$ is a positive integer. Remove the pairs $(1,4 k-1),(3,4 k-3), \ldots$, $(2 k-1,2 k+1)$ in turn. Each time, two odd numbers are removed, and the corresponding $c=|a \pm b|$ are even numbers in the range 2 through $4 k$, of which one is always $4 k$. These even numbers are already on the board at each stage, so no $c$ is to be written down, unless $n=4 k-1$ in which case $4 k$ is written down during the first move. The outcome of this $k$-move round is the string of even numbers 2 through $4 k$ written down on the board. At this stage, the problem is clearly brought down to the case where the numbers on the board are $1,2, \ldots, 2 k=\lceil n / 2\rceil$, as desired.



Finally, let $n=4 k+1$ or $4 k+2$, where $k \geq 2$. Remove first the pair $(4,2 k+1)$ and notice that no new number is to be written down on the board, since $4+(2 k+1)=2 k+5 \leq 4 k+1 \leq n$. Next, remove the pairs $(1,4 k+1),(3,4 k-1), \ldots,(2 k-1,2 k+3)$ in turn. As before, at each of these stages, two odd numbers are removed; the corresponding $c=|a \pm b|$ are even numbers, this time in the range 4 through $4 k+2$, of which one is always $4 k+2$; and no new numbers are to be written down on the board, except $4=|(2 k-1)-(2 k+3)|$ during the last move, and, possibly, $4 k+2=1+(4 k+1)$ during the first move if $n=4 k+1$. Notice that 2 has not yet been involved in the process, to conclude that the outcome of this $(k+1)$-move round is the string of even numbers 2 through $4 k+2$ written down on the board. At this stage, the problem is clearly brought down to the case where the numbers on the board are $1,2, \ldots, 2 k+1=\lceil n / 2\rceil$, as desired.
We will prove the following, more general statement:



Claim. Write down a finite number (at least two) of pairwise distinct positive integers on a board. A move consists in erasing any two numbers $a$ and $b$, and, for each $c$ in $\{a+b,|a-b|\}$, writing $c$ down on the board, unless $c$ is already there; if $c$ is already on the board, do nothing. Then it is possible to be left with exactly two numbers on the board after a finite number of moves.







Notice that, if we divide all numbers on the board by some common factor, the resulting process goes on equally well. Such a reduction can therefore be performed after any move.



Notice that we cannot be left with less than two numbers. So it suffices to show that, given $k$ positive integers on the board, $k \geq 3$, we can always decrease their number by at least 1 . Arguing indirectly, choose a set of $k \geq 3$ positive integers $S=\left\{a_{1}, \ldots, a_{k}\right\}$ which cannot be reduced in size by a sequence of moves, having a minimal possible sum $\sigma$. So, in any sequence of moves applied to $S$, two numbers are erased and exactly two numbers appear on each move. Moreover, the sum of any resulting set of $k$ numbers is at least $\sigma$.



Notice that, given two numbers $a>b$ on the board, we can replace them by $a+b$ and $a-b$, and then, performing a move on the two new numbers, by $(a+b)+(a-b)=2 a$ and $(a+b)-(a-b)=2 b$. So we can double any two numbers on the board.



We now show that, if the board contains two even numbers $a$ and $b$, we can divide them both by 2 , while keeping the other numbers unchanged. If $k$ is even, split the other numbers into pairs to multiply each pair by 2 ; then clear out the common factor 2 . If $k$ is odd, split all numbers but $a$ into pairs to multiply each by 2 ; then do the same for all numbers but $b$; finally, clear out the common factor 4.



Back to the problem, if two of the numbers $a_{1}, \ldots, a_{k}$ are even, reduce them both by 2 to get a set with a smaller sum, which is impossible. Otherwise, two numbers, say, $a_{1}<a_{2}$, are odd, and we may replace them by the two even numbers $a_{1}+a_{2}$ and $a_{2}-a_{1}$, and then by $\frac{1}{2}\left(a_{1}+a_{2}\right)$ and $\frac{1}{2}\left(a_{2}-a_{1}\right)$, to get a set with a smaller sum, which is again impossible.