![](https://cdn.mathpix.com/cropped/2024_06_05_bb329c9c39073469be65g-1.jpg?height=266&width=260&top_left_y=110&top_left_x=204) Individual Competition - Solutions MEMO 2022 Bern English version # Problem I-1 Let $\mathbb{R}$ be the set of real numbers. Determine all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ such that $$ f(x+f(x+y))=x+f(f(x)+y) $$ holds for all $x, y \in \mathbb{R}$. Solution. Denote by $P(x, y)$ the given assertion. Taking $y=-f(x)$ we get the equality $f(x+f(x-f(x)))=x+f(0)$, which implies that $f$ is surjective. Let $d$ be a zero of $f$. From $P(d, 0)$ we get $0=d+f(0)$, thus $-f(0)$ is the only zero of $f$. From $P(0, y)$ we get $$ f(f(y))=f(y+f(0)) $$ From $P(-f(0), y+f(0))$ we get $f(f(y)-f(0))=-f(0)+f(y+f(0))$. Using (1), we get $f(f(y)-f(0))=-f(0)+f(f(y))$, or equivalently $f(f(y))=f(f(y)-f(0))+f(0)$. Since $f$ is surjective, we can replace $f(y)$ by $y$ to obtain $$ f(y)=f(y-f(0))+f(0) $$ Replacing $y$ by $y+f(0)$ to the right, we get $f(y+f(0))=f(y)+f(0)$. However, applying (1) to the left side gives us $$ f(f(y))=f(y)+f(0) $$ Once again, using surjectivity we conclude that $f(y)=y+f(0)$ for every real number $y$. Thus, any function $f$ which is a solution is of the form $f(y)=y+c$ for some real number $c$. It's easy to check that all such functions satisfy the problem's condition. Solution via surjectivity. Let $P(x, y)$ denote the given equation. The function $f$ is surjective, as can be seen with $P(x,-f(x))$. Observe that $P(y, x-y)$ gives us $$ f(y+f(x))=y+f(f(y)+x-y) $$ which, when plugged back into the original equation, translates to $$ f(x+f(x+y))=x+y+f(f(y)+x-y) $$ Observe the equation $$ x+f\left(x+y_{0}\right)=f\left(y_{0}\right)+x-y_{0} $$ For every $y_{0}$ it has a solution $x_{0}$, as $f$ is surjective. Plugging $x_{0}$ and $y_{0}$ in (2), it follows that $x_{0}+y_{0}=0$. As $x_{0}=-y_{0}$ is the only possible solution, it must solve the equation. We now get that $-y+f(0)=f(y)-2 y$ for all $y$, and so $f(x)=x+c$. We see that all such functions indeed solve the equation. ![](https://cdn.mathpix.com/cropped/2024_06_05_bb329c9c39073469be65g-2.jpg?height=252&width=234&top_left_y=111&top_left_x=226) ## Problem I-2 Let $n$ be a positive integer. Anna and Beatrice play a game with a deck of $n$ cards labelled with the numbers $1,2, \ldots, n$. Initially, the deck is shuffled. The players take turns, starting with Anna. At each turn, if $k$ denotes the number written on the topmost card, then the player first looks at all the cards and then rearranges the $k$ topmost cards. If, after rearranging, the topmost card shows the number $k$ again, then the player has lost and the game ends. Otherwise, the turn of the other player begins. Determine, depending on the initial shuffle, if either player has a winning strategy, and if so, who does. Answer: A player wins if and only if in the deck she receives, the topmost card with number $k$ does not have the smallest number among the $k$ topmost cards Solution with explicit strategy. For the sake of brevity, we will always refer to the cards as the numbers $1, \ldots, n$ in a row, in some permutation. The first number corresponds to the topmost card. Assume it is your turn and the first number $k$ is not the smallest number among the first $k$ numbers; let $m$ be that smallest number. You can now place $m$ in the first place and sort the remaining numbers in decreasing order. If $m=1$, then the opponent will immediately after her next turn. Otherwise, the smallest of the $m-1$ numbers on positions 2 to $m$ is now larger than $k$ : The smallest of the $k$ numbers before the rearrangement was $m$, so the largest of them was at least $m+k-1$, and the $(m-1)$-th largest was at least $m+k-1-(m-2)=k+1$. This now forces your opponent to remove $m$ from the start and to put something there that is bigger than $k$ (else she loses the game). Also, $m$ still remains among the first $m$ numbers, so the new first number $k^{\prime}$ again is not the smallest among the first $k^{\prime}>m$ numbers. Repeating this ensures that you always have a non-losing move. The game terminates since the leading number cannot increase forever. Therefore, it is forced that your opponent will at some point lose the game. If instead the first number $k$ is the smallest among the first $k$ numbers when it is your turn, then the same strategy applies to your opponent after your move. Solution with winning positions. Essentially the same idea can also be written as an iterative characterization of winning positions. We inductively show that a position is a winning position if and only if the first number $k$ is not the smallest among the first $k$ numbers. First, we observe that a player cannot make a legal move if and only if the first number is 1 . Consequently, a player can win within one move if and only if 1 is among the first $k$ numbers. If the first number is $n$, then 1 is always among the first $n$ numbers, so this is a winning position. Let us assume the first number is $k$, and for all $k^{\prime}>k$ we have already shown that permutations starting with $k^{\prime}$ are winning positions if and only if $k^{\prime}$ is not the smallest among the first $k^{\prime}$ numbers. If $k$ is the smallest number among the first $k$ numbers, then the player whose turn it is must put some number $k^{\prime}$ larger than $k$ in the first position and $k$ among the first $ka$. Then we compute $\operatorname{gcd}(a, 1+a b)+\operatorname{lcm}(a, 1+a b)=1+a+a^{2} b$, which is again coprime with $a$. Repeatedly applying this procedure with $a$ and the last written number, we obtain all the numbers of the form $$ 1+a+\ldots+a^{k-1}+a^{k} b=\frac{a^{k}-1}{a-1}+a^{k} b=: V_{k} $$ By the pigeonhole principle there exists two positive integer $k_{1}b$, so we will write $V_{k}=t \cdot b$ with $t>1$. Now we take $V_{k}$ and $b$ and compute $$ \operatorname{gcd}\left(V_{k}, b\right)+\operatorname{lcm}\left(V_{k}, b\right)=b+V_{k}=(t+1) \cdot b $$ and hence repeatedly applying this procedure with $b$ and the last written number gives all numbers of the form $s \cdot b$ for $s \geq t$. In particular, if we apply this procedure sufficiently many times $s$ will be a multiple of $n$.