# The $13^{\text {th }}$ Romanian Master of Mathematics Competition Day 2 - Solutions Problem 4. 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. ## China 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 $\lceil n / 2\rceilb$ 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}1$. Problem 6. Initially, a non-constant polynomial $S(x)$ with real coefficients is written down on a board. Whenever the board contains a polynomial $P(x)$, not necessarily alone, one can write down on the board any polynomial of the form $P(C+x)$ or $C+P(x)$, where $C$ is a real constant. Moreover, if the board contains two (not necessarily distinct) polynomials $P(x)$ and $Q(x)$, one can write $P(Q(x))$ and $P(x)+Q(x)$ down on the board. No polynomial is ever erased from the board. Given two sets of real numbers, $A=\left\{a_{1}, a_{2}, \ldots, a_{n}\right\}$ and $B=\left\{b_{1}, b_{2}, \ldots, b_{n}\right\}$, a polynomial $f(x)$ with real coefficients is $(A, B)$-nice if $f(A)=B$, where $f(A)=\left\{f\left(a_{i}\right): i=1,2, \ldots, n\right\}$. Determine all polynomials $S(x)$ that can initially be written down on the board such that, for any two finite sets $A$ and $B$ of real numbers, with $|A|=|B|$, one can produce an $(A, B)$-nice polynomial in a finite number of steps. Iran, Navid SafaEi Solution. The required polynomials are all polynomials of an even degree $d \geq 2$, and all polynomials of odd degree $d \geq 3$ with negative leading coefficient. Part I. We begin by showing that any (non-constant) polynomial $S(x)$ not listed above is not $(A, B)$-nice for some pair $(A, B)$ with either $|A|=|B|=2$, or $|A|=|B|=3$. If $S(x)$ is linear, then so are all the polynomials appearing on the board. Therefore, none of them will be $(A, B)$-nice, say, for $A=\{1,2,3\}$ and $B=\{1,2,4\}$, as desired. Otherwise, $\operatorname{deg} S=d \geq 3$ is odd, and the leading coefficient is positive. In this case, we make use of the following technical fact, whose proof is presented at the end of the solution. Claim. There exists a positive constant $T$ such that $S(x)$ satisfies the following condition: $$ S(b)-S(a) \geq b-a \quad \text { whenever } \quad b-a \geq T $$ Fix a constant $T$ provided by the Claim. Then, an immediate check shows that all newly appearing polynomials on the board also satisfy $(*)$ (with the same value of $T$ ). Therefore, none of them will be $(A, B)$-nice, say, for $A=\{0, T\}$ and $B=\{0, T / 2\}$, as desired. Part II. We show that the polynomials listed in the Answer satisfy the requirements. We will show that for any $a_{1}\max _{x \in \Delta} S(x)$. Therefore, for any $x, y, z$ with $x \leq \alpha \leq y \leq \beta \leq z$ we get $S(x) \leq S(\alpha) \leq$ $S(y) \leq S(\beta) \leq S(z)$. We may decrease $\alpha$ and increase $\beta$ (preserving the condition above) so that, in addition, $S^{\prime}(x)>3$ for all $x \notin[\alpha, \beta]$. Now we claim that the number $T=3(\beta-\alpha)$ fits the bill. Indeed, take any $a$ and $b$ with $b-a \geq T$. Even if the segment $[a, b]$ crosses $[\alpha, \beta]$, there still is a segment $\left[a^{\prime}, b^{\prime}\right] \subseteq[a, b] \backslash(\alpha, \beta)$ of length $b^{\prime}-a^{\prime} \geq(b-a) / 3$. Then $$ S(b)-S(a) \geq S\left(b^{\prime}\right)-S\left(a^{\prime}\right)=\left(b^{\prime}-a^{\prime}\right) \cdot S^{\prime}(\xi) \geq 3\left(b^{\prime}-a^{\prime}\right) \geq b-a $$ for some $\xi \in\left(a^{\prime}, b^{\prime}\right)$. Proof of Lemma 1. If $S(x)$ has an even degree, then the polynomial $T(x)=S\left(x+a_{2}\right)-S\left(x+a_{1}\right)$ has an odd degree, hence there exists $x_{0}$ with $T\left(x_{0}\right)=S\left(x_{0}+a_{2}\right)-S\left(x_{0}+a_{1}\right)=b_{2}-b_{1}$. Setting $G(x)=S\left(x+x_{0}\right)$, we see that $G\left(a_{2}\right)-G\left(a_{1}\right)=b_{2}-b_{1}$, so a suitable shift $F(x)=G(x)+\left(b_{1}-G\left(a_{1}\right)\right)$ fits the bill. Assume now that $S(x)$ has odd degree and a negative leading coefficient. Notice that the polynomial $S^{2}(x):=S(S(x))$ has an odd degree and a positive leading coefficient. So, the polynomial $S^{2}\left(x+a_{2}\right)-S^{2}\left(x+a_{1}\right)$ attains all sufficiently large positive values, while $S\left(x+a_{2}\right)-$ $S\left(x+a_{1}\right)$ attains all sufficiently large negative values. Therefore, the two-variable polynomial $S^{2}\left(x+a_{2}\right)-S^{2}\left(x+a_{1}\right)+S\left(y+a_{2}\right)-S\left(y+a_{1}\right)$ attains all real values; in particular, there exist $x_{0}$ and $y_{0}$ with $S^{2}\left(x_{0}+a_{2}\right)+S\left(y_{0}+a_{2}\right)-S^{2}\left(x_{0}+a_{1}\right)-S\left(y_{0}+a_{1}\right)=b_{2}-b_{1}$. Setting $G(x)=S^{2}\left(x+x_{0}\right)+S\left(x+y_{0}\right)$, we see that $G\left(a_{2}\right)-G\left(a_{1}\right)=b_{2}-b_{1}$, so a suitable shift of $G$ fits the bill. Proof of Lemma 2. Let $\Delta$ denote the segment $\left[a_{1} ; a_{n}\right]$. We modify the proof of Lemma 1 in order to obtain a polynomial $F$ convex (or concave) on $\Delta$ such that $F\left(a_{1}\right)=F\left(a_{2}\right)$; then $F$ is a desired polynomial. Say that a polynomial $H(x)$ is good if $H$ is convex on $\Delta$. If $\operatorname{deg} S$ is even, and its leading coefficient is positive, then $S(x+c)$ is good for all sufficiently large negative $c$, and $S\left(a_{2}+c\right)-S\left(a_{1}+c\right)$ attains all sufficiently large negative values for such $c$. Similarly, $S(x+c)$ is good for all sufficiently large positive $c$, and $S\left(a_{2}+c\right)-S\left(a_{1}+c\right)$ attains all sufficiently large positive values for such $c$. Therefore, there exist large $c_{1}<0T \quad \text { whenever } \quad b-a>T $$ Let us sketch an alternative approach for Part II. It suffices to construct, for each $i$, a polynomial $f_{i}(x)$ such that $f_{i}\left(a_{i}\right)=b_{i}$ and $f_{i}\left(a_{j}\right)=0, j \neq i$. The construction of such polynomials may be reduced to the construction of those for $n=3$ similarly to what happens in the proof of Lemma 2. However, this approach (as well as any in this part) needs some care in order to work properly.