![](https://cdn.mathpix.com/cropped/2024_11_22_b27f529724537ad59acfg-1.jpg?height=1029&width=914&top_left_y=521&top_left_x=608) European Girls' Mathematical Olympiad Antalya - Turkey Problems and Solutions Day 2 The EGMO 2014 Problem Committee thanks the following countries for submitting problem proposals: - Bulgaria - Iran - Japan - Luxembourg - Netherlands - Poland - Romania - Ukraine - United Kingdom The Members of the Problem Committee: Okan Tekman Selim Bahadir Şahin Emrah Fehmi Emre Kadan 4. Determine all integers $n \geq 2$ for which there exist integers $x_{1}, x_{2}, \ldots, x_{n-1}$ satisfying the condition that if $0n$. Now suppose that $n$ does not have one of these forms and $x_{1}, x_{2}, \ldots, x_{n-1}$ satisfying the given condition exist. For any positive integer $m$, let $a_{m}$ be the remainder of the division of $(-2)^{m}$ by $n$. Then none of $a_{m}$ is 0 as $n$ is not a power of 2. Also $a_{m} \neq a_{m+1}$ for any $m \geq 1$ as $a_{m}=a_{m+1}$ would lead to $n$ dividing $3 \cdot 2^{m}$. Moreover $n$ divides $2 a_{m}+a_{m+1}$. Hence we must have $x_{a_{1}}0$ for some $i$, then there exists $k_{2}>k_{1}>0$ such that $f^{k_{1}}(i)=f^{k_{2}}(i)$, leading to the contradiction $x_{f^{k_{1}(i)}}<$ $x_{f^{k_{2}(i)}}=x_{f^{k_{1}(i)}}$. - On the other hand, if such $k(i)$ exists for each $i$ in $D$, and if $k_{0}(i)$ denotes the smallest such, then the condition of the problem is satisfied by letting $x_{i}=-k_{0}(i)$ for $i$ in $D$, and $x_{i}=0$ for $i$ in $E$. In other words, the integers $x_{1}, x_{2}, \ldots, x_{n-1}$ exist if and only if for each $i$ in $D$ there exists a positive integer $k(i)$ such that $(-2)^{k(i)} i \equiv n / 3, n / 2$ or $2 n / 3(\bmod n)$. For $i=1$, this implies that $n=2^{k}$ with $k \geq 1$ or $n=3 \cdot 2^{k}$ with $k \geq 0$. On the other hand, if $n$ has one of these forms, letting $k(i)=k$ does the trick for all $i$ in $D$. ## Solution 3. Suppose that $x_{1}, x_{2}, \ldots, x_{k-1}$ satisfy the condition of the problem for $n=k$. Let $y_{2 i}=x_{i}$ for $1 \leq i \leq k-1$ and choose $y_{2 i-1}$ for $1 \leq i \leq k$ to be less than $\min \left\{x_{1}, x_{2}, \ldots, x_{k-1}\right\}$. Now suppose that for $n=2 k$ we have $03$ is an odd number. Let $b_{0}=2^{k}$ and let $b_{i+1}$ be the remainder of the division of $(-2) b_{i}$ by $n$ for $i \geq 0$. No terms of this sequence is 0 and no two consecutive terms are both equal to $b_{1}$ as $m>3$. On the other hand, as $(-2)^{\phi(m)} \equiv 1(\bmod m)$, we have $b_{\phi(m)} \equiv(-2)^{\phi(m)} 2^{k} \equiv 2^{k} \equiv b_{0}$ $(\bmod n)$, and hence $b_{\phi(m)}=b_{0}$. Since $2 b_{i}+b_{i+1}$ is divisible by $n$ for all $i \geq 0$, we have $x_{b_{0}}0$ fills all boxes as $D(x) \geq 0$ means $\sum_{m_{i}>0} m_{i} \geq$ (number of empty boxes). As $N(x)$ and $O(x)$ have the same parity, a configuration $x$ is solvable exactly when $O(x) \geq 2 n-N(x)$, and unsolvable exactly when $O(x) \leq 2 n-2-N(x)$. In particular, any configuration with $2 n-1$ pebbles is solvable, and a configuration with $2 n-2$ pebbles is unsolvable if and only if all boxes contain even numbers of pebbles. Suppose that $x^{\prime}$ is obtained from $x$ by adding a pebble in some box. Then $O\left(x^{\prime}\right)=$ $O(x)+1$ or $O\left(x^{\prime}\right)=O(x)-1$. If $x$ is unsolvable and $x^{\prime}$ is solvable, then we must have $O(x) \leq 2 n-2-N(x)$ and $O\left(x^{\prime}\right) \geq 2 n-N\left(x^{\prime}\right)=2 n-1-N(x)$, and hence $O\left(x^{\prime}\right)=O(x)+1$. That is, the pebble must be added to a box with an even number of pebbles. This can be the case irrespective of where the pebble is added only if all boxes contain even numbers of pebbles, and $0=O(x) \leq 2 n-2-N(x)$ and $1=O\left(x^{\prime}\right) \geq 2 n-1-N(x)$; that is, $N(x)=2 n-2$. Solution 2. Let $x$ be a configuration and $\tilde{x}$ be another configuration obtained from $x$ by removing two pebbles from a box and depositing them in another box. Claim 1: $\tilde{x}$ is solvable if and only if $x$ is solvable. Let us call two configurations equivalent if they have the same total number of pebbles and parities of the number of pebbles in the corresponding boxes are the same. (It does not matter whether we consider this equivalence for a fixed ordering of the boxes or up to permutation.) From Claim 1 it follows that two equivalent configurations are both solvable or both unsolvable. In particular, any configuration with $2 n-1$ or more pebbles is solvable, because it is equivalent to a configuration with no empty boxes. Let us a call a configuration with all boxes containing two or fewer pebbles scant. Every unsolvable configuration is equivalent to a scant configuration. Claim 2: A scant configuration is solvable if and only if it contains no empty boxes. By Claim 1 and Claim 2, addition of a pebble to a scant unsolvable configuration makes it solvable if and only if the configuration has exactly one empty box and the pebble is added to the empty box or to a box containing two pebbles. Hence, the addition of a pebble makes an unsolvable scant configuration into a solvable configuration irrespective of where it is added if and only if all boxes have even numbers of pebbles and exactly one of them is empty. Therefore, the addition of a pebble makes an unsolvable configuration into a solvable one irrespective of where the pebble is added if and only if the configuration has $2 n-2$ pebbles and all boxes have even numbers of pebbles. Proof of Claim 1: Suppose that the two pebbles were moved from box $B$ in $x$ to box $\tilde{B}$ in $\tilde{x}$, and $x$ is solvable. Then we perform exactly the same sequence of moves for $\tilde{x}$ as we did for $x$ except that instead of the first move that is made out of $B$ we make a move from $\tilde{B}$ (into the same box), and if there was no move from $B$, then at the end we make a move from $\tilde{B}$ to $B$ in case $B$ is now empty. Proof of Claim 2: Any move from a scant configuration either leaves the number of empty boxes the same and the resulting configuration is also scant (if it is made into an empty box), or increases the number of empty boxes by one (if it is made into a nonempty box). In the second case, if the move was made into a box containing one pebble, then the resulting configuration is still scant. On the other hand, if it is made into a box containing two pebbles, then the resulting configuration is equivalent to the scant configuration which has one pebble in the box the move was made into and exactly the same number of pebbles in all other boxes as the original configuration. Therefore, any sequence of move from a scant configuration results in a configuration with more or the same number of empty boxes. 6. Determine all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ satisfying the condition $$ f\left(y^{2}+2 x f(y)+f(x)^{2}\right)=(y+f(x))(x+f(y)) $$ for all real numbers $x$ and $y$. Proposed by Daniël Kroes, NLD The answer is the functions $f(x)=x, f(x)=-x$ and $f(x)=\frac{1}{2}-x$. ## Solution. It can be easily checked that the functions $f(x)=x, f(x)=-x$ and $f(x)=\frac{1}{2}-x$ satisfy the given condition. We will show that these are the only functions doing so. Let $y=-f(x)$ in the original equation to obtain $$ f\left(2 f(x)^{2}+2 x f(-f(x))\right)=0 $$ for all $x$. In particular, 0 is a value of $f$. Suppose that $u$ and $v$ are such that $f(u)=0=f(v)$. Plugging $x=u$ or $v$ and $y=u$ or $v$ in the original equations we get $f\left(u^{2}\right)=u^{2}, f\left(u^{2}\right)=u v, f\left(v^{2}\right)=u v$ and $f\left(v^{2}\right)=v^{2}$. We conclude that $u^{2}=u v=v^{2}$ and hence $u=v$. So there is exactly one $a$ mapped to 0 , and $$ f(x)^{2}+x f(-f(x))=\frac{a}{2} $$ for all $x$. Suppose that $f\left(x_{1}\right)=f\left(x_{2}\right) \neq 0$ for some $x_{1}$ and $x_{2}$. Using (*) we obtain $x_{1} f\left(-f\left(x_{1}\right)\right)=x_{2} f\left(-f\left(x_{2}\right)\right)=x_{2} f\left(-f\left(x_{1}\right)\right)$ and hence either $x_{1}=x_{2}$ or $f\left(x_{1}\right)=$ $f\left(x_{2}\right)=-a$. In the second case, letting $x=a$ and $y=x_{1}$ in the original equation we get $f\left(x_{1}^{2}-2 a^{2}\right)=0$, hence $x_{1}^{2}-2 a^{2}=a$. Similarly, $x_{2}^{2}-2 a^{2}=a$, and it follows that $x_{1}=x_{2}$ or $x_{1}=-x_{2}$ in this case. Using the symmetry of the original equation we have $$ f\left(f(x)^{2}+y^{2}+2 x f(y)\right)=(x+f(y))(y+f(x))=f\left(f(y)^{2}+x^{2}+2 y f(x)\right) $$ for all $x$ and $y$. Suppose $f(x)^{2}+y^{2}+2 x f(y) \neq f(y)^{2}+x^{2}+2 y f(x)$ for some $x$ and $y$. Then by the observations above, $(x+f(y))(y+f(x)) \neq 0$ and $f(x)^{2}+y^{2}+2 x f(y)=$ $-\left(f(y)^{2}+x^{2}+2 y f(x)\right)$. But these conditions are contradictory as the second one can be rewritten as $(f(x)+y)^{2}+(f(y)+x)^{2}=0$. Therefore from $\left({ }^{* *}\right)$ now it follows that $$ f(x)^{2}+y^{2}+2 x f(y)=f(y)^{2}+x^{2}+2 y f(x) $$ for all $x$ and $y$. In particular, letting $y=0$ we obtain $f(x)^{2}=(f(0)-x)^{2}$ for all $x$. Let $f(x)=s(x)(f(0)-x)$ where $s: \mathbf{R} \rightarrow\{1,-1\}$. Plugging this in $\left({ }^{* * *}\right)$ gives $$ x(y s(y)+f(0)(1-s(y))=y(x s(x)+f(0)(1-s(x))) $$ for all $x$ and $y$. So $s(x)+f(0)(1-s(x)) / x$ must be constant for $x \neq 0$. If $f(0)=0$ it follows that $s(x)$ is constant for $x \neq 0$, and therefore either $f(x)=x$ for all $x$ or $f(x)=-x$ for all $x$. Suppose that $f(0) \neq 0$. If $s(x)$ is -1 for all $x \neq 0$, then $-1+2 f(0) / x$ must be constant for all $x \neq 0$, which is not possible. On the other hand, if there exist nonzero $x$ and $y$ such that $s(x)=-1$ and $s(y)=1$, then $-1+2 f(0) / x=1$. That is, there can be only one such $x$, that $x$ is $f(0)$, and hence $f(x)=f(0)-x$ for all $x$. Putting this back in the original equation gives $2 f(0)^{2}=f(0)$ and hence $f(0)=1 / 2$. We are done. ## Remark: The following line of reasoning or a variant of it can be used between $\left({ }^{*}\right)$ and $\left({ }^{* * *}\right)$ : Suppose that $f\left(x_{1}\right)=f\left(x_{2}\right) \neq 0$ for some $x_{1}$ and $x_{2}$. Then from $\left(^{*}\right)$ it follows that $x_{1} f\left(-f\left(x_{1}\right)\right)=x_{2} f\left(-f\left(x_{2}\right)\right)=x_{2} f\left(-f\left(x_{1}\right)\right)$ and hence either $x_{1}=x_{2}$ or $f\left(x_{1}\right)=$ $f\left(x_{2}\right)=-a$. In the second case, using $\left(^{*}\right)$ again we obtain $a^{2}=a / 2$ and therefore $a=$ $1 / 2$. Now letting $x=1 / 2$ in the original equation gives $f\left(y^{2}+f(y)\right)=y(f(y)+1 / 2)$ for all $y$. From this letting $y=0$ we obtain $f(0)=1 / 2$, and letting $f(y)=-1 / 2$ we obtain $f\left(y^{2}-1 / 2\right)=0$ and $y^{2}=1$. To summarize, $f\left(x_{1}\right)=f\left(x_{2}\right) \neq 0$ implies either $x_{1}=x_{2}$ or $x_{1}, x_{2} \in\{1,-1\}$ and $f(1)=f(-1)=-1 / 2, f(1 / 2)=0, f(0)=1 / 2$. Using the symmetry of the original equation we have $$ f\left(f(x)^{2}+y^{2}+2 x f(y)\right)=(x+f(y))(y+f(x))=f\left(f(y)^{2}+x^{2}+2 y f(x)\right) $$ for all $x$ and $y$. Let $y=0$. Then $$ f\left(f(x)^{2}+2 x f(0)\right)=f\left(f(0)^{2}+x^{2}\right) $$ for all $x$. If $f(x)^{2}+2 x f(0) \neq f(0)^{2}+x^{2}$ for some $x$, then by the observation above we must have $f(1 / 2)=0, f(0)=1 / 2$ and $f(x)^{2}+2 x f(0)=-\left(f(0)^{2}+x^{2}\right)$. We can rewrite this as $f(x)^{2}+(f(0)+x)^{2}=0$ to obtain $x=1 / 2$ and $f(0)=-x=-1 / 2$, which contradicts $f(0)=1 / 2$. So we conclude that $f(x)^{2}+2 x f(0)=f(0)^{2}+x^{2}$ for all $x$. This implies $f(x)^{2}=(f(0)-x)^{2}$ for all $x$. In particular, the second case considered above is not possible as $(f(0)-1)^{2}=f(1)=f(-1)=(f(0)+1)^{2}$ means $f(0)=0$, contradicting $f(0)=1 / 2$. Therefore $f$ is injective and from $\left({ }^{* *}\right)$ now it follows that $$ f(x)^{2}+y^{2}+2 x f(y)=f(y)^{2}+x^{2}+2 y f(x) $$ for all $x$ and $y$.