Let $\left(a_{n}\right)_{n \geqslant 1}$ be a sequence of positive real numbers with the property that  $$ \left(a_{n+1}\right)^{2}+a_{n} a_{n+2} \leqslant a_{n}+a_{n+2} $$  for all positive integers $n$. Show that $a_{2022} \leqslant 1$. (Nigeria)

Solution: We begin by observing that $\left(a_{n+1}\right)^{2}-1 \leqslant a_{n}+a_{n+2}-a_{n} a_{n+2}-1$, which is equivalent to  $$ \left(a_{n+1}\right)^{2}-1 \leqslant\left(1-a_{n}\right)\left(a_{n+2}-1\right) $$  Suppose now that there exists a positive integer $n$ such that $a_{n+1}>1$ and $a_{n+2}>1$. Since $\left(a_{n+1}\right)^{2}-1 \leqslant\left(1-a_{n}\right)\left(a_{n+2}-1\right)$, we deduce that $0<1-a_{n}<1<1+a_{n+2}$, thus $\left(a_{n+1}\right)^{2}-1<\left(a_{n+2}+1\right)\left(a_{n+2}-1\right)=\left(a_{n+2}\right)^{2}-1$.  On the other hand, $\left(a_{n+2}\right)^{2}-1 \leqslant\left(1-a_{n+3}\right)\left(a_{n+1}-1\right)<\left(1+a_{n+1}\right)\left(a_{n+1}-1\right)=\left(a_{n+1}\right)^{2}-1$, a contradiction. We have shown that we cannot have two consecutive terms, except maybe $a_{1}$ and $a_{2}$, strictly greater than 1 .  Finally, suppose $a_{2022}>1$. This implies that $a_{2021} \leqslant 1$ and $a_{2023} \leqslant 1$. Therefore $0<$ $\left(a_{2022}\right)^{2}-1 \leqslant\left(1-a_{2021}\right)\left(a_{2023}-1\right) \leqslant 0$, a contradiction. We conclude that $a_{2022} \leqslant 1$.


Let $k \geqslant 2$ be an integer. Find the smallest integer $n \geqslant k+1$ with the property that there exists a set of $n$ distinct real numbers such that each of its elements can be written as a sum of $k$ other distinct elements of the set. (Slovakia)

Solution: First we show that $n \geqslant k+4$. Suppose that there exists such a set with $n$ numbers and denote them by $a_{1}<a_{2}<\cdots<a_{n}$.  Note that in order to express $a_{1}$ as a sum of $k$ distinct elements of the set, we must have $a_{1} \geqslant a_{2}+\cdots+a_{k+1}$ and, similarly for $a_{n}$, we must have $a_{n-k}+\cdots+a_{n-1} \geqslant a_{n}$. We also know that $n \geqslant k+1$.  If $n=k+1$ then we have $a_{1} \geqslant a_{2}+\cdots+a_{k+1}>a_{1}+\cdots+a_{k} \geqslant a_{k+1}$, which gives a contradiction.  If $n=k+2$ then we have $a_{1} \geqslant a_{2}+\cdots+a_{k+1} \geqslant a_{k+2}$, that again gives a contradiction. If $n=k+3$ then we have $a_{1} \geqslant a_{2}+\cdots+a_{k+1}$ and $a_{3}+\cdots+a_{k+2} \geqslant a_{k+3}$. Adding the two inequalities we get $a_{1}+a_{k+2} \geqslant a_{2}+a_{k+3}$, again a contradiction.  It remains to give an example of a set with $k+4$ elements satisfying the condition of the problem. We start with the case when $k=2 l$ and $l \geqslant 1$. In that case, denote by $A_{i}=\{-i, i\}$ and take the set $A_{1} \cup \cdots \cup A_{l+2}$, which has exactly $k+4=2 l+4$ elements. We are left to show that this set satisfies the required condition.  Note that if a number $i$ can be expressed in the desired way, then so can $-i$ by negating the expression. Therefore, we consider only $1 \leqslant i \leqslant l+2$.  If $i<l+2$, we sum the numbers from some $l-1$ sets $A_{j}$ with $j \neq 1, i+1$, and the numbers $i+1$ and -1 .  For $i=l+2$, we sum the numbers from some $l-1$ sets $A_{j}$ with $j \neq 1, l+1$, and the numbers $l+1$ and 1 .  It remains to a give a construction for odd $k=2 l+1$ with $l \geqslant 1$ (since $k \geqslant 2$ ). To that end, we modify the construction for $k=2 l$ by adding 0 to the previous set.  This is a valid set as 0 can be added to each constructed expression, and 0 can be expressed as follows: take the numbers $1,2,-3$ and all the numbers from the remaining $l-1$ sets $A_{4}, A_{5}, \cdots, A_{l+2}$.


Let $\mathbb{R}_{>0}$ be the set of positive real numbers. Find all functions $f: \mathbb{R}_{>0} \rightarrow \mathbb{R}_{>0}$ such that, for every $x \in \mathbb{R}_{>0}$, there exists a unique $y \in \mathbb{R}_{>0}$ satisfying  $$ x f(y)+y f(x) \leqslant 2 $$  (Netherlands)

Solution: First we prove that the function $f(x)=1 / x$ satisfies the condition of the problem statement. The AM-GM inequality gives  $$ \frac{x}{y}+\frac{y}{x} \geqslant 2 $$  for every $x, y>0$, with equality if and only if $x=y$. This means that, for every $x>0$, there exists a unique $y>0$ such that  $$ \frac{x}{y}+\frac{y}{x} \leqslant 2, $$  namely $y=x$. Let now $f: \mathbb{R}_{>0} \rightarrow \mathbb{R}_{>0}$ be a function that satisfies the condition of the problem statement. We say that a pair of positive real numbers $(x, y)$ is $\operatorname{good}$ if $x f(y)+y f(x) \leqslant 2$. Observe that if $(x, y)$ is good, then so is $(y, x)$. Lemma 1.0. If $(x, y)$ is good, then $x=y$. Proof. Assume that there exist positive real numbers $x \neq y$ such that $(x, y)$ is good. The uniqueness assumption says that $y$ is the unique positive real number such that $(x, y)$ is good. In particular, $(x, x)$ is not a good pair. This means that  $$ x f(x)+x f(x)>2 $$  and thus $x f(x)>1$. Similarly, $(y, x)$ is a good pair, so $(y, y)$ is not a good pair, which implies $y f(y)>1$. We apply the AM-GM inequality to obtain  $$ x f(y)+y f(x) \geqslant 2 \sqrt{x f(y) \cdot y f(x)}=2 \sqrt{x f(x) \cdot y f(y)}>2 . $$  This is a contradiction, since $(x, y)$ is a good pair. By assumption, for any $x>0$, there always exists a good pair containing $x$, however Lemma 1 implies that the only good pair that can contain $x$ is $(x, x)$, so  $$ x f(x) \leqslant 1 \quad \Longleftrightarrow \quad f(x) \leqslant \frac{1}{x} $$  for every $x>0$. In particular, with $x=1 / f(t)$ for $t>0$, we obtain  $$ \frac{1}{f(t)} \cdot f\left(\frac{1}{f(t)}\right) \leqslant 1 $$  Hence  $$ t \cdot f\left(\frac{1}{f(t)}\right) \leqslant t f(t) \leqslant 1 $$  We claim that $(t, 1 / f(t))$ is a good pair for every $t>0$. Indeed,  $$ t \cdot f\left(\frac{1}{f(t)}\right)+\frac{1}{f(t)} f(t)=t \cdot f\left(\frac{1}{f(t)}\right)+1 \leqslant 2 $$  Lemma 1 implies that $t=1 / f(t) \Longleftrightarrow f(t)=1 / t$ for every $t>0$.


Solution: 1. We give an alternative way to prove that $f(x)=1 / x$ assuming $f(x) \leqslant 1 / x$ for every $x>0$.  Indeed, if $f(x)<1 / x$ then for every $a>0$ with $f(x)<1 / a<1 / x$ (and there are at least two of them), we have  $$ a f(x)+x f(a)<1+\frac{x}{a}<2 $$  Hence $(x, a)$ is a good pair for every such $a$, a contradiction. We conclude that $f(x)=1 / x$.


Solution: 2. We can also conclude from Lemma 1 and $f(x) \leqslant 1 / x$ as follows. Lemma 2. The function $f$ is decreasing. Proof. Let $y>x>0$. Lemma 1 says that $(x, y)$ is not a good pair, but $(y, y)$ is. Hence  $$ x f(y)+y f(x)>2 \geqslant 2 y f(y)>y f(y)+x f(y) $$  where we used $y>x$ (and $f(y)>0$ ) in the last inequality. This implies that $f(x)>f(y)$, showing that $f$ is decreasing.  We now prove that $f(x)=1 / x$ for all $x$. Fix a value of $x$ and note that for $y>x$ we must have $x f(x)+y f(x)>x f(y)+y f(x)>2$ (using that $f$ is decreasing for the first step), hence $f(x)>\frac{2}{x+y}$. The last inequality is true for every $y>x>0$. If we fix $x$ and look for the supremum of the expression $\frac{2}{x+y}$ over all $y>x$, we get  $$ f(x) \geqslant \frac{2}{x+x}=\frac{1}{x} $$  Since we already know that $f(x) \leqslant 1 / x$, we conclude that $f(x)=1 / x$.


Solution: 0. As in the first solution, we note that $f(x)=1 / x$ is a solution, and we set out to prove that it is the only one. We write $g(x)$ for the unique positive real number such that $(x, g(x))$ is a good pair. In this solution, we prove Lemma 2 without assuming Lemma 1. Lemma 2. The function $f$ is decreasing. Proof. Consider $x<y$. It holds that $y f(g(y))+g(y) f(y) \leqslant 2$. Moreover, because $y$ is the only positive real number such that $(g(y), y)$ is a good pair and $x \neq y$, we have $x f(g(y))+g(y) f(x)>$ 2. Combining these two inequalities yields  $$ x f(g(y))+g(y) f(x)>2 \geqslant y f(g(y))+g(y) f(y) $$  or $f(g(y))(x-y)>g(y)(f(y)-f(x))$. Because $g(y)$ and $f(g(y))$ are both positive while $x-y$ is negative, it follows that $f(y)<f(x)$, showing that $f$ is decreasing.  We now prove Lemma 1 using Lemma 2. Suppose that $x \neq y$ but $x f(y)+y f(x) \leqslant 2$. As in the first solution, we get $x f(x)+x f(x)>2$ and $y f(y)+y f(y)>2$, which implies $x f(x)+y f(y)>2$. Now  $$ x f(x)+y f(y)>2 \geqslant x f(y)+y f(x) $$  implies $(x-y)(f(x)-f(y))>0$, which contradicts the fact that $f$ is decreasing. So $y=x$ is the unique $y$ such that $(x, y)$ is a good pair, and in particular we have $f(x) \leqslant 1 / x$.  We can now conclude the proof as in any of the Solutions 1.x.


Solution: 0. As in the other solutions we verify that the function $f(x)=1 / x$ is a solution. We first want to prove the following lemma: Lemma 3. For all $x \in \mathbb{R}_{>0}$ we actually have $x f(g(x))+g(x) f(x)=2$ (that is: the inequality is actually an equality).  Proof. We proceed by contradiction: Assume there exists some number $x>0$ such that for $y=g(x)$ we have $x f(y)+y f(x)<2$. Then for any $0<\epsilon<\frac{2-x f(y)-y f(x)}{2 f(x)}$ we have, by uniqueness of $y$, that $x f(y+\epsilon)+(y+\epsilon) f(x)>2$. Therefore  $$ \begin{aligned} f(y+\epsilon) & >\frac{2-(y+\epsilon) f(x)}{x}=\frac{2-y f(x)-\epsilon f(x)}{x} \\ & >\frac{2-y f(x)-\frac{2-x f(y)-y f(x)}{2}}{x} \\ & =\frac{2-x f(y)-y f(x)}{2 x}+f(y)>f(y) . \end{aligned} $$  Furthermore, for every such $\epsilon$ we have $g(y+\epsilon) f(y+\epsilon)+(y+\epsilon) f(g(y+\epsilon)) \leqslant 2$ and $g(y+\epsilon) f(y)+y f(g(y+\epsilon))>2($ since $y \neq y+\epsilon=g(g(y+\epsilon))$ ). This gives us the two inequalities  $$ f(g(y+\epsilon)) \leqslant \frac{2-g(y+\epsilon) f(y+\epsilon)}{y+\epsilon} \quad \text { and } \quad f(g(y+\epsilon))>\frac{2-g(y+\epsilon) f(y)}{y} . $$  Combining these two inequalities and rearranging the terms leads to the inequality  $$ 2 \epsilon<g(y+\epsilon)[(y+\epsilon) f(y)-y f(y+\epsilon)] . $$  Moreover combining with the inequality (1) we obtain $2 \epsilon<g(y+\epsilon)\left[(y+\epsilon) f(y)-y\left(\frac{2-x f(y)-y f(x)}{2 x}+f(y)\right)\right]=g(y+\epsilon)\left[\epsilon f(y)-y \frac{2-x f(y)-y f(x)}{2 x}\right]$. We now reach the desired contradiction, since for $\epsilon$ sufficiently small we have that the left hand side is positive while the right hand side is negative.  With this lemma it then follows that for all $x, y \in \mathbb{R}_{>0}$ we have  $$ x f(y)+y f(x) \geqslant 2 $$  since for $y=g(x)$ we have equality and by uniqueness for $y \neq g(x)$ the inequality is strict. In particular for every $x \in \mathbb{R}_{>0}$ and for $y=x$ we have $2 x f(x) \geqslant 2$, or equivalently $f(x) \geqslant 1 / x$ for all $x \in \mathbb{R}_{>0}$. With this inequality we obtain for all $x \in \mathbb{R}_{>0}$  $$ 2 \geqslant x f(g(x))+g(x) f(x) \geqslant \frac{x}{g(x)}+\frac{g(x)}{x} \geqslant 2 $$  where the first inequality comes from the problem statement. Consequently each of these inequalities must actually be an equality, and in particular we obtain $f(x)=1 / x$ for all $x \in \mathbb{R}_{>0}$.


Solution: Again, let us prove that $f(x)=1 / x$ is the only solution. Let again $g(x)$ be the unique positive real number such that $(x, g(x))$ is a good pair. Lemma 4. The function $f$ is strictly convex. Proof. Consider the function $q_{s}(x)=f(x)+s x$ for some real number $s$. If $f$ is not strictly convex, then there exist $u<v$ and $t \in(0,1)$ such that  $$ f(t u+(1-t) v) \geqslant t f(u)+(1-t) f(v) $$  Hence  $$ \begin{aligned} q_{s}(t u+(1-t) v) & \geqslant t f(u)+(1-t) f(v)+s(t u+(1-t) v) \\ & =t q_{s}(u)+(1-t) q_{s}(v) \end{aligned} $$  Let $w=t u+(1-t) v$ and consider the case $s=f(g(w)) / g(w)$. For that particular choice of $s$, the function $q_{s}(x)$ has a unique minimum at $x=w$. However, since $q_{s}(w) \geqslant t q_{s}(u)+(1-t) q_{s}(v)$, it must hold $q_{s}(u) \leqslant q_{s}(w)$ or $q_{s}(v) \leqslant q_{s}(w)$, a contradiction. Lemma 5. The function $f$ is continuous. Proof. Since $f$ is strictly convex and defined on an open interval, it is also continuous. As in Solution 1, we can prove that $f(x) \leqslant 1 / x$. If $f(x)<1 / x$, then we consider the function $h(y)=x f(y)+y f(x)$ which is continuous. Since $h(x)<2$, there exist at least two distinct $z \neq x$ such that $h(z)<2$ giving that $(x, z)$ is good pair for both values of $z$, a contradiction. We conclude that $f(x)=1 / x$ as desired.  Comment. Lemma 5 implies Lemma 3, using an argument similar as in the end of Solution 4.


Let $n \geqslant 3$ be an integer, and let $x_{1}, x_{2}, \ldots, x_{n}$ be real numbers in the interval $[0,1]$. Let $s=x_{1}+x_{2}+\ldots+x_{n}$, and assume that $s \geqslant 3$. Prove that there exist integers $i$ and $j$ with $1 \leqslant i<j \leqslant n$ such that  $$ 2^{j-i} x_{i} x_{j}>2^{s-3} $$  (Trinidad and Tobago)

Solution: Let $1 \leqslant a<b \leqslant n$ be such that $2^{b-a} x_{a} x_{b}$ is maximal. This choice of $a$ and $b$ implies that $x_{a+t} \leqslant 2^{t} x_{a}$ for all $1-a \leqslant t \leqslant b-a-1$, and similarly $x_{b-t} \leqslant 2^{t} x_{b}$ for all $b-n \leqslant t \leqslant b-a+1$. Now, suppose that $x_{a} \in\left(\frac{1}{2^{u+1}}, \frac{1}{2^{u}}\right]$ and $x_{b} \in\left(\frac{1}{2^{v+1}}, \frac{1}{2^{v}}\right]$, and write $x_{a}=2^{-\alpha}, x_{b}=2^{-\beta}$. Then  $$ \sum_{i=1}^{a+u-1} x_{i} \leqslant 2^{u} x_{a}\left(\frac{1}{2}+\frac{1}{4}+\ldots+\frac{1}{2^{a+u-1}}\right)<2^{u} x_{a} \leqslant 1 $$  and similarly,  $$ \sum_{i=b-v+1}^{n} x_{i} \leqslant 2^{v} x_{b}\left(\frac{1}{2}+\frac{1}{4}+\ldots+\frac{1}{2^{n-b+v}}\right)<2^{v} x_{b} \leqslant 1 $$  In other words, the sum of the $x_{i}$ 's for $i$ outside of the interval $[a+u, b-v]$ is strictly less than 2. Since the total sum is at least 3 , and each term is at most 1 , it follows that this interval must have at least two integers. i.e., $a+u<b-v$. Thus, by bounding the sum of the $x_{i}$ for $i \in[1, a+u] \cup[b-v, n]$ like above, and trivially bounding each $x_{i} \in(a+u, b-v)$ by 1 , we obtain  $$ s<2^{u+1} x_{a}+2^{v+1} x_{b}+((b-v)-(a+u)-1)=b-a+\left(2^{u+1-\alpha}+2^{v+1-\beta}-(u+v+1)\right) . $$  Now recall $\alpha \in(u, u+1]$ and $\beta \in(v, v+1]$, so applying Bernoulli's inequality yields $\left.2^{u+1-\alpha}+2^{v+1-\beta}-u-v-1 \leqslant(1+(u+1-\alpha))\right)+(1+(v+1-\beta))-u-v-1=3-\alpha-\beta$.  It follows that $s-3<b-a-\alpha-\beta$, and so  $$ 2^{s-3}<2^{b-a-\alpha-\beta}=2^{b-a} x_{a} x_{b} . $$  Comment 1. It is not hard to see that the inequality is tight. Suppose that $n=2 k+1$, and we set $x_{k+1}=1, x_{k}=x_{k+2}=\frac{1}{2}+\frac{1}{2^{k}}$, and $x_{k+1-t}=x_{k+1+t}=\frac{1}{2^{t}}$. Then $s=3$ (so the right hand side is 1 ), and  $$ \max _{i<j} 2^{j-i} x_{i} x_{j}=2^{2}\left(\frac{1}{2}+\frac{1}{2^{k}}\right)^{2} $$  which can be made arbitrarily close to 1 . Note that $s$ can be made larger by putting in more 1-s in the middle (and this accommodates even $n$ as well).  Comment 2. An alternative formulation of the problem is to show that there exists a positive constant $c$ (or find the best such $c$ ) such that  $$ \max _{i<j} 2^{j-i} x_{i} x_{j}>c 2^{s} . $$  The above shows that $c=1 / 8$ is the best possible. A somewhat simpler ending to the proof can be given for $c=1 / 32$. End of solution for $c=1 / 32$. As in the original solution, we arrive at  $$ s<2^{u+1} x_{a}+2^{v+1} x_{b}+((b-v)-(a+u)-1)=b-a+\left(2^{u+1-\alpha}+2^{v+1-\beta}-(u+v+1)\right) . $$  Now $2^{b-a} x_{a} x_{b} \geqslant 2^{b-a} 2^{-u-1} 2^{-v-1}$, so it is enough to show $s-5<b-a-u-v-2$, or $s<b-a-$ $u-v+3$. The fact that $u+1-\alpha<1$ and $v+1-\beta<1$ implies $2^{u+1-\alpha}+2^{v+1-\beta}<4$, and so $s<b-a+(2+2-u-v-1)=b-a-u-v-3$.


Find all positive integers $n \geqslant 2$ for which there exist $n$ real numbers $a_{1}<\cdots<a_{n}$ and a real number $r>0$ such that the $\frac{1}{2} n(n-1)$ differences $a_{j}-a_{i}$ for $1 \leqslant i<j \leqslant n$ are equal, in some order, to the numbers $r^{1}, r^{2}, \ldots, r^{\frac{1}{2} n(n-1)}$. (Czech Republic)

Solution: We first show a solution for each $n \in\{2,3,4\}$. We will later show the impossibility of finding such a solution for $n \geqslant 5$.  For $n=2$, take for example $\left(a_{1}, a_{2}\right)=(1,3)$ and $r=2$. For $n=3$, take the root $r>1$ of $x^{2}-x-1=0$ (the golden ratio) and set $\left(a_{1}, a_{2}, a_{3}\right)=$ $\left(0, r, r+r^{2}\right)$. Then  $$ \left(a_{2}-a_{1}, a_{3}-a_{2}, a_{3}-a_{1}\right)=\left(r, r^{2}, r+r^{2}=r^{3}\right) $$  For $n=4$, take the root $r \in(1,2)$ of $x^{3}-x-1=0$ (such a root exists because $1^{3}-1-1<0$ and $\left.2^{3}-2-1>0\right)$ and set $\left(a_{1}, a_{2}, a_{3}, a_{4}\right)=\left(0, r, r+r^{2}, r+r^{2}+r^{3}\right)$. Then  $$ \left(a_{2}-a_{1}, a_{3}-a_{2}, a_{4}-a_{3}, a_{3}-a_{1}, a_{4}-a_{2}, a_{4}-a_{1}\right)=\left(r, r^{2}, r^{3}, r^{4}, r^{5}, r^{6}\right) $$  For $n \geqslant 5$, we will proceed by contradiction. Suppose there exist numbers $a_{1}<\cdots<a_{n}$ and $r>1$ satisfying the conditions of the problem. We start with a lemma: Lemma. We have $r^{n-1}>2$. Proof. There are only $n-1$ differences $a_{j}-a_{i}$ with $j=i+1$, so there exists an exponent $e \leqslant n$ and a difference $a_{j}-a_{i}$ with $j \geqslant i+2$ such that $a_{j}-a_{i}=r^{e}$. This implies  $$ r^{n} \geqslant r^{e}=a_{j}-a_{i}=\left(a_{j}-a_{j-1}\right)+\left(a_{j-1}-a_{i}\right)>r+r=2 r, $$  thus $r^{n-1}>2$ as desired. To illustrate the general approach, we first briefly sketch the idea behind the argument in the special case $n=5$. In this case, we clearly have $a_{5}-a_{1}=r^{10}$. Note that there are 3 ways to rewrite $a_{5}-a_{1}$ as a sum of two differences, namely  $$ \left(a_{5}-a_{4}\right)+\left(a_{4}-a_{1}\right),\left(a_{5}-a_{3}\right)+\left(a_{3}-a_{1}\right),\left(a_{5}-a_{2}\right)+\left(a_{2}-a_{1}\right) . $$  Using the lemma above and convexity of the function $f(n)=r^{n}$, we argue that those three ways must be $r^{10}=r^{9}+r^{1}=r^{8}+r^{4}=r^{7}+r^{6}$. That is, the "large" exponents keep dropping by 1 , while the "small" exponents keep increasing by $n-2, n-3, \ldots, 2$. Comparing any two such equations, we then get a contradiction unless $n \leqslant 4$.  Now we go back to the full proof for any $n \geqslant 5$. Denote $b=\frac{1}{2} n(n-1)$. Clearly, we have $a_{n}-a_{1}=r^{b}$. Consider the $n-2$ equations of the form:  $$ a_{n}-a_{1}=\left(a_{n}-a_{i}\right)+\left(a_{i}-a_{1}\right) \text { for } i \in\{2, \ldots, n-1\} $$  In each equation, one of the two terms on the right-hand side must be at least $\frac{1}{2}\left(a_{n}-a_{1}\right)$. But from the lemma we have $r^{b-(n-1)}=r^{b} / r^{n-1}<\frac{1}{2}\left(a_{n}-a_{1}\right)$, so there are at most $n-2$ sufficiently large elements in $\left\{r^{k} \mid 1 \leqslant k<b\right\}$, namely $r^{b-1}, \ldots, r^{b-(n-2)}$ (note that $r^{b}$ is already used for $a_{n}-a_{1}$ ). Thus, the "large" terms must be, in some order, precisely equal to elements in  $$ L=\left\{r^{b-1}, \ldots, r^{b-(n-2)}\right\} $$  Next we claim that the "small" terms in the $n-2$ equations must be equal to the elements in  $$ S=\left\{\left.r^{b-(n-2)-\frac{1}{2} i(i+1)} \right\rvert\, 1 \leqslant i \leqslant n-2\right\}, $$  in the corresponding order (the largest "large" term with the smallest "small" term, etc.). Indeed, suppose that  $$ r^{b}=a_{n}-a_{1}=r^{b-i}+r^{\alpha_{i}} \text { for } i \in\{1, \ldots, n-2\} $$  where $1 \leqslant \alpha_{1}<\cdots<\alpha_{n-2} \leqslant b-(n-1)$. Since $r>1$ and $f(r)=r^{n}$ is convex, we have  $$ r^{b-1}-r^{b-2}>r^{b-2}-r^{b-3}>\ldots>r^{b-(n-3)}-r^{b-(n-2)} $$  implying  $$ r^{\alpha_{2}}-r^{\alpha_{1}}>r^{\alpha_{3}}-r^{\alpha_{2}}>\ldots>r^{\alpha_{n-2}}-r^{\alpha_{n-3}} . $$  Convexity of $f(r)=r^{n}$ further implies  $$ \alpha_{2}-\alpha_{1}>\alpha_{3}-\alpha_{2}>\ldots>\alpha_{n-2}-\alpha_{n-3} $$  Note that $\alpha_{n-2}-\alpha_{n-3} \geqslant 2$ : Otherwise we would have $\alpha_{n-2}-\alpha_{n-3}=1$ and thus  $$ r^{\alpha_{n-3}} \cdot(r-1)=r^{\alpha_{n-2}}-r^{\alpha_{n-3}}=r^{b-(n-3)}-r^{b-(n-2)}=r^{b-(n-2)} \cdot(r-1), $$  implying that $\alpha_{n-3}=b-(n-2)$, a contradiction. Therefore, we have  $$ \begin{aligned} \alpha_{n-2}-\alpha_{1} & =\left(\alpha_{n-2}-\alpha_{n-3}\right)+\cdots+\left(\alpha_{2}-\alpha_{1}\right) \\ & \geqslant 2+3+\cdots+(n-2) \\ & =\frac{1}{2}(n-2)(n-1)-1=\frac{1}{2} n(n-3) \end{aligned} $$  On the other hand, from $\alpha_{n-2} \leqslant b-(n-1)$ and $\alpha_{1} \geqslant 1$ we get  $$ \alpha_{n-2}-\alpha_{1} \leqslant b-n=\frac{1}{2} n(n-1)-n=\frac{1}{2} n(n-3), $$  implying that equalities must occur everywhere and the claim about the small terms follows. Now, assuming $n-2 \geqslant 2$, we have the two different equations:  $$ r^{b}=r^{b-(n-2)}+r^{b-(n-2)-1} \text { and } r^{b}=r^{b-(n-3)}+r^{b-(n-2)-3}, $$  which can be rewritten as  $$ r^{n-1}=r+1 \quad \text { and } \quad r^{n+1}=r^{4}+1 $$  Simple algebra now gives  $$ r^{4}+1=r^{n+1}=r^{n-1} \cdot r^{2}=r^{3}+r^{2} \Longrightarrow(r-1)\left(r^{3}-r-1\right)=0 . $$  Since $r \neq 1$, using Equation (1) we conclude $r^{3}=r+1=r^{n-1}$, thus $n=4$, which gives a contradiction.


Let $\mathbb{R}$ be the set of real numbers. We denote by $\mathcal{F}$ the set of all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ such that  $$ f(x+f(y))=f(x)+f(y) $$  for every $x, y \in \mathbb{R}$. Find all rational numbers $q$ such that for every function $f \in \mathcal{F}$, there exists some $z \in \mathbb{R}$ satisfying $f(z)=q z$. (Indonesia)

Solution: Let $Z$ be the set of all rational numbers $q$ such that for every function $f \in \mathcal{F}$, there exists some $z \in \mathbb{R}$ satisfying $f(z)=q z$. Let further  $$ S=\left\{\frac{n+1}{n}: n \in \mathbb{Z}, n \neq 0\right\} $$  We prove that $Z=S$ by showing the two inclusions: $S \subseteq Z$ and $Z \subseteq S$. We first prove that $S \subseteq Z$. Let $f \in \mathcal{F}$ and let $P(x, y)$ be the relation $f(x+f(y))=f(x)+$ $f(y)$. First note that $P(0,0)$ gives $f(f(0))=2 f(0)$. Then, $P(0, f(0))$ gives $f(2 f(0))=3 f(0)$. We claim that  $$ f(k f(0))=(k+1) f(0) $$  for every integer $k \geqslant 1$. The claim can be proved by induction. The cases $k=1$ and $k=2$ have already been established. Assume that $f(k f(0))=(k+1) f(0)$ and consider $P(0, k f(0))$ which gives  $$ f((k+1) f(0))=f(0)+f(k f(0))=(k+2) f(0) $$  This proves the claim. We conclude that $\frac{k+1}{k} \in Z$ for every integer $k \geqslant 1$. Note that $P(-f(0), 0)$ gives $f(-f(0))=0$. We now claim that  $$ f(-k f(0))=(-k+1) f(0) $$  for every integer $k \geqslant 1$. The proof by induction is similar to the one above. We conclude that $\frac{-k+1}{-k} \in Z$ for every integer $k \geqslant 1$. This shows that $S \subseteq Z$.  We now prove that $Z \subseteq S$. Let $p$ be a rational number outside the set $S$. We want to prove that $p$ does not belong to $Z$. To that end, we construct a function $f \in \mathcal{F}$ such that $f(z) \neq p z$ for every $z \in \mathbb{R}$. The strategy is to first construct a function  $$ g:[0,1) \rightarrow \mathbb{Z} $$  and then define $f$ as $f(x)=g(\{x\})+\lfloor x\rfloor$. This function $f$ belongs to $\mathcal{F}$. Indeed,  $$ \begin{aligned} f(x+f(y)) & =g(\{x+f(y)\})+\lfloor x+f(y)\rfloor \\ & =g(\{x+g(\{y\})+\lfloor y\rfloor\})+\lfloor x+g(\{y\})+\lfloor y\rfloor\rfloor \\ & =g(\{x\})+\lfloor x\rfloor+g(\{y\})+\lfloor y\rfloor \\ & =f(x)+f(y) \end{aligned} $$  where we used that $g$ only takes integer values. Lemma 1. For every $\alpha \in[0,1)$, there exists $m \in \mathbb{Z}$ such that  $$ m+n \neq p(\alpha+n) $$  for every $n \in \mathbb{Z}$.  Proof. Note that if $p=1$ the claim is trivial. If $p \neq 1$, then the claim is equivalent to the existence of an integer $m$ such that  $$ \frac{m-p \alpha}{p-1} $$  is never an integer. Assume the contrary. That would mean that both  $$ \frac{m-p \alpha}{p-1} \quad \text { and } \quad \frac{(m+1)-p \alpha}{p-1} $$  are integers, and so is their difference. The latter is equal to  $$ \frac{1}{p-1} $$  Since we assumed $p \notin S, 1 /(p-1)$ is never an integer. This is a contradiction. Define $g:[0,1) \rightarrow \mathbb{Z}$ by $g(\alpha)=m$ for any integer $m$ that satisfies the conclusion of Lemma 1. Note that $f(z) \neq p z$ if and and only if  $$ g(\{z\})+\lfloor z\rfloor \neq p(\{z\}+\lfloor z\rfloor) $$  The latter is guaranteed by the construction of the function $g$. We conclude that $p \notin Z$ as desired. This shows that $Z \subset S$.


For a positive integer $n$ we denote by $s(n)$ the sum of the digits of $n$. Let $P(x)=$ $x^{n}+a_{n-1} x^{n-1}+\cdots+a_{1} x+a_{0}$ be a polynomial, where $n \geqslant 2$ and $a_{i}$ is a positive integer for all $0 \leqslant i \leqslant n-1$. Could it be the case that, for all positive integers $k, s(k)$ and $s(P(k))$ have the same parity? (Belarus)

Solution: With the notation above, we begin by choosing a positive integer $t$ such that  $$ 10^{t}>\max \left\{\frac{100^{n-1} a_{n-1}}{\left(10^{\frac{1}{n-1}}-9^{\frac{1}{n-1}}\right)^{n-1}}, \frac{a_{n-1}}{9} 10^{n-1}, \frac{a_{n-1}}{9}\left(10 a_{n-1}\right)^{n-1}, \ldots, \frac{a_{n-1}}{9}\left(10 a_{0}\right)^{n-1}\right\} $$  As a direct consequence of $10^{t}$ being bigger than the first quantity listed in the above set, we get that the interval  $$ I=\left[\left(\frac{9}{a_{n-1}} 10^{t}\right)^{\frac{1}{n-1}},\left(\frac{1}{a_{n-1}} 10^{t+1}\right)^{\frac{1}{n-1}}\right) $$  contains at least 100 consecutive positive integers. Let $X$ be a positive integer in $I$ such that $X$ is congruent to $1 \bmod 100$. Since $X \in I$ we have  $$ 9 \cdot 10^{t} \leqslant a_{n-1} X^{n-1}<10^{t+1} $$  thus the first digit (from the left) of $a_{n-1} X^{n-1}$ must be 9 . Next, we observe that $a_{n-1}\left(10 a_{i}\right)^{n-1}<9 \cdot 10^{t} \leqslant a_{n-1} X^{n-1}$, thus $10 a_{i}<X$ for all $i$, which immediately implies that $a_{0}<a_{1} X<\cdots<a_{n} X^{n}$, and the number of digits of this strictly increasing sequence forms a strictly increasing sequence too. In other words, if $i<j$, the number of digits of $a_{i} X^{i}$ is less than the number of digits of $a_{j} X^{j}$.  Let $\alpha$ be the number of digits of $a_{n-1} X^{n-1}$, thus $10^{\alpha-1} \leqslant a_{n-1} X^{n-1}<10^{\alpha}$. We are now going to look at $P\left(10^{\alpha} X\right)$ and $P\left(10^{\alpha-1} X\right)$ and prove that the sum of their digits has different parities. This will finish the proof since $s\left(10^{\alpha} X\right)=s\left(10^{\alpha-1} X\right)=s(X)$.  We have $P\left(10^{\alpha} X\right)=10^{\alpha n} X^{n}+a_{n-1} 10^{\alpha(n-1)} X^{n-1}+\cdots+a_{0}$, and since $10^{\alpha(i+1)}>10^{\alpha i} a_{n-1} X^{n-1}>$ $10^{\alpha i} a_{i} X^{i}$, the terms $a_{i} 10^{\alpha i} X^{i}$ do not interact when added; in particular, there is no carryover caused by addition. Thus we have $s\left(P\left(10^{\alpha} X\right)\right)=s\left(X^{n}\right)+s\left(a_{n-1} X^{n-1}\right)+\cdots+s\left(a_{0}\right)$.  We now look at $P\left(10^{\alpha-1} X\right)=10^{(\alpha-1) n} X^{n}+a_{n-1} 10^{(\alpha-1)(n-1)} X^{n-1}+\cdots+a_{0}$. Firstly, if $i<n-1$, then $a_{n-1} X^{n-1}$ has more digits than $a_{i} X^{i}$ and $a_{n-1} X^{n-1} \geqslant 10 a_{i} X^{i}$. It now follows that $10^{(\alpha-1)(i+1)+1}>10^{(\alpha-1) i} a_{n-1} X^{n-1} \geqslant 10^{(\alpha-1) i+1} a_{i} X^{i}$, thus all terms $10^{(\alpha-1) i} a_{i} X^{i}$ for $0 \leqslant i \leqslant n-1$ come in 'blocks', exactly as in the previous case.  Finally, $10^{(\alpha-1) n+1}>10^{(\alpha-1)(n-1)} a_{n-1} X^{n-1} \geqslant 10^{(\alpha-1) n}$, thus $10^{(\alpha-1)(n-1)} a_{n-1} X^{n-1}$ has exactly $(\alpha-1) n+1$ digits, and its first digit is 9 , as established above. On the other hand, $10^{(\alpha-1) n} X^{n}$ has exactly $(\alpha-1) n$ zeros, followed by $01($ as $X$ is $1 \bmod 100)$. Therefore, when we add the terms, the 9 and 1 turn into 0 , the 0 turns into 1 , and nothing else is affected.  Putting everything together, we obtain  $$ s\left(P\left(10^{\alpha-1} X\right)\right)=s\left(X^{n}\right)+s\left(a_{n-1} X^{n-1}\right)+\cdots+s\left(a_{0}\right)-9=s\left(P\left(10^{\alpha} X\right)\right)-9 $$  thus $s\left(P\left(10^{\alpha} X\right)\right)$ and $s\left(P\left(10^{\alpha-1} X\right)\right)$ have different parities, as claimed.


For a positive integer $n$, an $n$-sequence is a sequence $\left(a_{0}, \ldots, a_{n}\right)$ of non-negative integers satisfying the following condition: if $i$ and $j$ are non-negative integers with $i+j \leqslant n$, then $a_{i}+a_{j} \leqslant n$ and $a_{a_{i}+a_{j}}=a_{i+j}$.  Let $f(n)$ be the number of $n$-sequences. Prove that there exist positive real numbers $c_{1}, c_{2}$ and $\lambda$ such that  $$ c_{1} \lambda^{n}<f(n)<c_{2} \lambda^{n} $$  for all positive integers $n$.

Solution: In order to solve this, we will give a complete classification of $n$-sequences. Let $k=\lfloor n / 2\rfloor$. We will say that an $n$-sequence is large if $a_{i}>k$ for some $i$, and small if no such $i$ exists. For now we will assume that $\left(a_{i}\right)$ is not the identity sequence (in other words, that $a_{i} \neq i$ for some $i$ ). Lemma 1. If $a_{r}=a_{s}$ and $r, s<n$, then $a_{r+1}=a_{s+1}$. Proof. We have $a_{r+1}=a_{a_{r}+a_{1}}=a_{a_{s}+a_{1}}=a_{s+1}$. Lemma 2. If $i \leqslant k$, then $a_{i} \leqslant k$. Proof. We have $i+i \leqslant n$, so $a_{i}+a_{i} \leqslant n$ whence $a_{i} \leqslant k$. Lemma 3. There exist $r, s$ such that $a_{r}=a_{s}$ and $r \neq s$. Proof. If $a_{0} \neq 0$ then $a_{2 a_{0}}=a_{0}$. Otherwise, $a_{a_{i}}=a_{i}$ for all $i$, so take $i$ such that $a_{i} \neq i$ (which we can do by our earlier assumption). Lemma 4. Let $r$ be the smallest index such that $a_{s}=a_{r}$ for some $s>r$, and let $d$ be the minimum positive integer such that $a_{r+d}=a_{r}$. Then  1. The subsequence $\left(a_{r}, a_{r+1}, \ldots, a_{n}\right)$ is periodic with minimal period $d$. That is, for $u<v$, we have $a_{u}=a_{v}$ if and only if $u, v \geqslant r$ and $d \mid v-u$. 2. $a_{i}=i$ for $i<r$ and $a_{i} \geqslant r$ for $i \geqslant r$.  In this case we say $\left(a_{i}\right)$ has period $d$ and offset $r$. Proof. We prove each in turn:  1. The "if" implication is clear from Lemma 1. For the reverse direction, suppose $a_{u}=a_{v}$. Then there are integers $r \leqslant u_{0}, v_{0}<r+d$ such that $d \mid u-u_{0}, v-v_{0}$, so $a_{u_{0}}=a_{u}=a_{v}=$ $a_{v_{0}}$. If $u_{0}<v_{0}$ then $a_{r+d+u_{0}-v_{0}}=a_{r+d}=a_{r}$, contradicting the minimality of $d$. There is a similar contradiction when $u_{0}>v_{0}$. Thus $u_{0}=v_{0}$, so $d \mid u-v$. 2. If $r=0$ there is nothing to prove. Otherwise $a_{0}=a_{2 a_{0}}$ so $2 a_{0}=0$. Then we have $a_{a_{i}}=a_{i}$ for all $i$, so $a_{i}=i$ for $i<r$.  Lemma 5. Either  1. $d \mid a_{i}-i$ for all $i$, or 2. $r=0$ and $d \mid a_{i}-i-d / 2$ for all $i$.  Proof. Note that Lemma 4 tells us that if $a_{u}=a_{v}$ then $d \mid u-v$. Since $a_{a_{i}+a_{0}}=a_{i}$ for all $i$, we have $d \mid a_{i}-i+a_{0}$. For $i=0$, this means that $d \mid 2 a_{0}$. If $d \mid a_{0}$ then that means that $d \mid a_{i}-i$ for all $i$. Otherwise, if $d \nmid a_{0}$, then $d \mid a_{0}-d / 2$ and thus $d \mid a_{i}-i-d / 2$ for all $i$. In addition, part 2 of Lemma 4 says that we must have $r=0$ in this case. Lemma 6. If $d$ is even and $d \mid a_{0}-d / 2$, then $\left(a_{i}\right)$ is small. (Note that we must have $r=0$ in this case.) Proof. Note that if $d \leqslant k+1$, then by Lemma $2,\left(a_{0}, \ldots, a_{d-1}\right)$ is a period for the sequence consisting of elements at most $k$, so $\left(a_{i}\right)$ must be small. Now suppose $d>k+1$. We show that $a_{i} \leqslant k$ for all $i$ by induction. Note that Lemma 2 already establishes this for $i \leqslant k$. We must have $d \mid a_{d / 2}$ and $a_{d / 2} \leqslant k<d$ so $a_{d / 2}=0$. Thus, for $i>k$, if $a_{j} \leqslant k$ for $j<i$, then $a_{i-d / 2} \leqslant k$, so $a_{i}=a_{(i-d / 2)+d / 2}=a_{a_{i-d / 2}} \leqslant k$. Lemma 7. If $\left(a_{i}\right)$ is small, then $r+d \leqslant k+1$. Proof. Since $\left(a_{i}\right)$ is small, there exists $u, v \leqslant k+1$ such that $u<v$ and $a_{u}=a_{v}$. Thus $u \leqslant r$ and $d \mid v-u$, so $r+d \leqslant v \leqslant k+1$. Lemma 8. If $\left(a_{i}\right)$ is large, then $r+d>k+1$ and $a_{i}=i$ for all $0 \leqslant i<r+d$. Proof. Since $\left(a_{i}\right)$ is large and has period $d$ and offset $r$, the period $\left(a_{r}, \ldots, a_{r+d-1}\right)$ must have an element that is larger than $k$, so by Lemma 2 we must have $r+d-1>k$.  We already have $a_{i}=i$ for $i<r$. Now we show that $a_{i}=i$ for $r \leqslant i \leqslant k$. By Lemma 6 we have $d \mid a_{i}-i$ but $r \leqslant i \leqslant k$. Since $k-r+1>d$, this means that $a_{i}=i$ for $i \leqslant k$.  Finally, one can show inductively that $a_{i}=i$ for $k<i<r+d$. Indeed, if $a_{j}=j$ for all $j<i$, then $a_{i} \geqslant i$ (otherwise $a_{i}=a_{j}$ for some $j<i$, but then $r \leqslant j$ and $i<r+d$ means that $d \nmid j-i$.) However, $a_{i}+(n-i)=a_{i}+a_{n-i} \leqslant n$, so $a_{i}=i$.  Thus large sequences are determined by $r$ and $d$. It is not hard to check that all sequences of the form $a_{i}=i$ for $i<r+d$ and with period $d$ and offset $r$ are $n$-sequences. There are $(n-k-1)(n+k+2) / 2$ possible choices of $(r, d)$ where $0 \leqslant r<n, d \geqslant 1$, and $k+1<r+d \leqslant n$.  For small sequences, for a given period $d$ and offset $r$, we need to choose the period $\left(a_{r}, \ldots, a_{r+d-1}\right)$ satisfying $r \leqslant a j \leqslant k$ and $d \mid a_{j}-j$ for $r \leqslant j<r+d$. There are $g(k+1-r, d)$ such choices, where we define $g(x, d)$ to be $(p+1)^{q} p^{d-q}$ with $p=\lfloor x / d\rfloor$ and $q=x-d p$.  Furthermore, if $d$ is even then there are $g(k+1, d)$ choices for the period $\left(a_{0}, \ldots, a_{d-1}\right)$ satisfying $d \mid a_{j}-j-d / 2$ for $j<d$. Again it is not hard to check that, once these choices are made, then the resulting sequence is an $n$-sequence.  Thus the total number of $n$-sequences is  $$ f(n)=1+\frac{(n-k-1)(n+k+2)}{2}+\sum_{d^{\prime}=1}^{\lfloor(k+1) / 2\rfloor} g\left(k+1,2 d^{\prime}\right)+\sum_{r=0}^{k} \sum_{d=1}^{k+1-r} g(k+1-r, d) . $$  Now, to show that $f(n)>c_{1} \lambda^{n}$ for some $c_{1}$, we note that  $$ f(n)>g\left(k+1,\left\lfloor\frac{k+1}{3}\right\rfloor\right) \geqslant 3^{\lfloor(k+1) / 3\rfloor}>3^{n / 6}-1 . $$  To show that $f(n)<c_{2} \lambda^{n}$ for some $c_{2}$, it actually suffices to show that there is a positive real number $c_{3}$ such that for all positive integers $x$,  $$ \sum_{d=1}^{x} g(x, d) \leqslant c_{3} 3^{x / 3} $$  In fact, the following lemma suffices, as it bounds the left hand side of the above inequality by a pair of geometric series with initial term $3^{x / 3}$ :  Lemma. For positive $d, x$, we have:  $$ g(x, d) \leqslant \begin{cases}3^{x / 3}\left(\frac{64}{81}\right)^{x / 3-d}, & \text { if } d \leqslant x / 3 \\ 3^{x / 3}\left(\frac{8}{9}\right)^{d-x / 3}, & \text { if } d \geqslant x / 3\end{cases} $$  Proof. There are a few key observations needed, all of which are immediate from the definition:  - $(x, d)$ is the maximum product of a sequence of $d$ integers that sums to $x$. - For any positive integer $k$, we have $g(k x, k d)=g(x, d)^{k}$. - If $2 d \leqslant x \leqslant 3 d$, then $g(x, d)=2^{3 d-x} 3^{x-2 d}$. Likewise, if $3 d \leqslant x \leqslant 4 d$ then $g(x, d)=$ $3^{4 d-x} 4^{x-3 d}$.  With these observations, if $d \leqslant x / 3$, then  $$ 3^{4(x-3 d)} g(3 x, 3 d) \leqslant g(3 x+12(x-3 d), 3 d+4(x-3 d))=g(15 x-36 d, 4 x-9 d) $$  To calculate $g(15 x-36 d, 4 x-9 d)$, note that  $$ \begin{aligned} & 3(4 x-9 d)=12 x-27 d \leqslant 15 x-36 d \\ & 4(4 x-9 d)=16 x-36 d \geqslant 15 x-36 d \end{aligned} $$  so  $$ g(15 x-36 d, 4 x-9 d)=3^{4(4 x-9 d)-(15 x-36 d)} 4^{(15 x-36 d)-3(4 x-9 d)}=3^{x} 4^{3(x-3 d)} $$  Thus  $$ g(x, d)^{3}=g(3 x, 3 d)=\frac{3^{4(x-3 d)} g(3 x, 3 d)}{3^{4(x-3 d)}} \leqslant \frac{3^{x} 4^{3(x-3 d)}}{3^{4(x-3 d)}}=3^{x}\left(\frac{64}{81}\right)^{x-3 d} $$  which completes the proof of the first claim. Likewise, if $d \geqslant x / 3$,  $$ 3^{2(3 d-x)} g(3 x, 3 d) 3 \leqslant g(3 x+6(3 d-x), 3 d+2(3 d-x))=g(18 d-3 x, 9 d-2 x) $$  Again we have  $$ 2(9 d-2 x) \leqslant 18-3 x \leqslant 18-3 x+3(3 d-x)=3(9 d-2 x), $$  so  $$ g(18 d-3 x, 9 d-2 x)=2^{3(9 d-2 x)-(18 d-3 x)} 3^{(18 d-3 x)-2(9 d-2 x)}=2^{3(3 d-x)} 3^{x} $$  Thus  $$ g(x, d)^{3}=g(3 x, 3 d)=\frac{2^{3(3 d-x)} g(3 x, 3 d)}{3^{2(3 d-x)}} \leqslant \frac{2^{3(3 d-x) 3^{x}}}{3^{2(3 d-x)}}=3^{x}\left(\frac{8}{9}\right)^{3 d-x} $$  from which the second claim follows. Common remarks. The best possible value of $c_{1}$ is constrained by $n=1$ : in this case, $f(1)=2$, which means that $c_{1}>2 \cdot 3^{-1 / 6} \approx 1.66537$.  With a careful analysis one can show that the best possible value of $c_{2}$ is $\frac{236567}{4930} 3^{1 / 3} \approx$ 69.20662 .


A $\pm 1$-sequence is a sequence of 2022 numbers $a_{1}, \ldots, a_{2022}$, each equal to either +1 or -1 . Determine the largest $C$ so that, for any $\pm 1$-sequence, there exists an integer $k$ and indices $1 \leqslant t_{1}<\ldots<t_{k} \leqslant 2022$ so that $t_{i+1}-t_{i} \leqslant 2$ for all $i$, and  $$ \left|\sum_{i=1}^{k} a_{t_{i}}\right| \geqslant C $$  (Czech Republic)

Solution: First, we prove that this can always be achieved. Without loss of generality, suppose at least $\frac{2022}{2}=1011$ terms of the $\pm 1$-sequence are +1 . Define a subsequence as follows: starting at $t=0$, if $a_{t}=+1$ we always include $a_{t}$ in the subsequence. Otherwise, we skip $a_{t}$ if we can (i.e. if we included $a_{t-1}$ in the subsequence), otherwise we include it out of necessity, and go to the next $t$. Clearly, this subsequence will include all +1 s . Also, for each -1 included in the sequence, a -1 must have been skipped, so at most $\left\lfloor\frac{1011}{2}\right\rfloor=505$ can be included. Hence the sum is at least $1011-505=506$, as desired.  Next, we prove that, for the $\pm 1$-sequence  $$ (\{-1\},\{+1,+1\},\{-1,-1\},\{+1,+1\}, \ldots,\{+1,+1\},\{-1,-1\},\{+1\}) $$  each admissible subsequence $a_{t_{i}}$ has $-506 \leqslant \sum_{i} a_{t_{i}} \leqslant 506$. We say that the terms inside each curly bracket is a block. In total, there are 1012 blocks - 506 of them hold +1-s, and 506 of them hold -1 s . (The two blocks at each end hold 1 number each, each other block holds 2.)  Suppose an admissible subsequence includes terms from $k$ blocks holding +1 -s. Then, in each -1 -pair in between the +1 -pairs, the subsequence must also include at least one -1 . There can be at most two +1 s included from each +1 -block, and at least one -1 must be included from each -1 -block, so the sum is at most $2 k-(k-1)=k+1$.  For $k<506$, this is at most 506. If $k=506$, one of the +1 -blocks must be the one at the end, meaning it can only include one +1 , so that the maximum in this case is only $k$, not $k+1$, so in this case the sum is also at most 506.  Hence we have shown that for any admissible subsequence, $\sum_{i} a_{t_{i}} \leqslant 506$. Analogously we can show that $-506 \leqslant \sum_{i} a_{t_{i}}$, meaning that $C \leqslant 506$ as desired.  Comment. A possible reformulation of the problem is the following. 2022 buckets of water are arranged in a row, each coloured either red or blue. Sally the salmon plays a game in the following way: first, she chooses any bucket she likes to start in. Then, any number of times she may jump either to the next bucket in the row, or across it to land in the bucket after that. (She may not jump across more than one bucket.) At any point, she may finish the game. At that time, her score is the absolute value of the difference between the number of red and blue buckets she visited during the game. Determine the largest $C$ so that no matter how the buckets are coloured, Sally can achieve a score of at least $C$.


The Bank of Oslo issues coins made out of two types of metal: aluminium (denoted A) and copper (denoted $C$ ). Morgane has $n$ aluminium coins, and $n$ copper coins, and arranges her $2 n$ coins in a row in some arbitrary initial order. Given a fixed positive integer $k \leqslant 2 n$, she repeatedly performs the following operation: identify the largest subsequence containing the $k$-th coin from the left which consists of consecutive coins made of the same metal, and move all coins in that subsequence to the left end of the row. For example, if $n=4$ and $k=4$, the process starting from the configuration $A A C C C A C A$ would be  $$ A A C C C A C A \rightarrow C C C A A A C A \rightarrow A A A C C C C A \rightarrow C C C C A A A A \rightarrow \cdots $$  Find all pairs $(n, k)$ with $1 \leqslant k \leqslant 2 n$ such that for every initial configuration, at some point of the process there will be at most one aluminium coin adjacent to a copper coin. (France)

Solution: Define a block to be a maximal subsequence of consecutive coins made out of the same metal, and let $M^{b}$ denote a block of $b$ coins of metal $M$. The property that there is at most one aluminium coin adjacent to a copper coin is clearly equivalent to the configuration having two blocks, one consisting of all $A$-s and one consisting of all $C$-s.  First, notice that if $k<n$, the sequence $A^{n-1} C^{n-1} A C$ remains fixed under the operation, and will therefore always have 4 blocks. Next, if $k>\frac{3 n+1}{2}$, let $a=k-n-1, b=2 n-k+1$. Then $k>2 a+b, k>2 b+a$, so the configuration $A^{a} C^{b} A^{b} C^{a}$ will always have four blocks:  $$ A^{a} C^{b} A^{b} C^{a} \rightarrow C^{a} A^{a} C^{b} A^{b} \rightarrow A^{b} C^{a} A^{a} C^{b} \rightarrow C^{b} A^{b} C^{a} A^{a} \rightarrow A^{a} C^{b} A^{b} C^{a} \rightarrow \ldots $$  Therefore a pair $(n, k)$ can have the desired property only if $n \leqslant k \leqslant \frac{3 n+1}{2}$. We claim that all such pairs in fact do have the desired property. Clearly, the number of blocks in a configuration cannot increase, so whenever the operation is applied, it either decreases or remains constant. We show that unless there are only two blocks, after a finite amount of steps the number of blocks will decrease.  Consider an arbitrary configuration with $c \geqslant 3$ blocks. We note that as $k \geqslant n$, the leftmost block cannot be moved, because in this case all $n$ coins of one type are in the leftmost block, meaning there are only two blocks. If a block which is not the leftmost or rightmost block is moved, its neighbor blocks will be merged, causing the number of blocks to decrease.  Hence the only case in which the number of blocks does not decrease in the next step is if the rightmost block is moved. If $c$ is odd, the leftmost and the rightmost blocks are made of the same metal, so this would merge two blocks. Hence $c \geqslant 4$ must be even. Suppose there is a configuration of $c$ blocks with the $i$-th block having size $a_{i}$ so that the operation always moves the rightmost block:  $$ A^{a_{1}} \ldots A^{a_{c-1}} C^{a_{c}} \rightarrow C^{a_{c}} A^{a_{1}} \ldots A^{a_{c-1}} \rightarrow A^{a_{c-1}} C^{a_{c}} A^{a_{1}} \ldots C^{a_{c-2}} \rightarrow \ldots $$  Because the rightmost block is always moved, $k \geqslant 2 n+1-a_{i}$ for all $i$. Because $\sum a_{i}=2 n$, summing this over all $i$ we get $c k \geqslant 2 c n+c-\sum a_{i}=2 c n+c-2 n$, so $k \geqslant 2 n+1-\frac{2 n}{c} \geqslant \frac{3 n}{2}+1$. But this contradicts $k \leqslant \frac{3 n+1}{2}$. Hence at some point the operation will not move the rightmost block, meaning that the number of blocks will decrease, as desired.


In each square of a garden shaped like a $2022 \times 2022$ board, there is initially a tree of height 0 . A gardener and a lumberjack alternate turns playing the following game, with the gardener taking the first turn:  - The gardener chooses a square in the garden. Each tree on that square and all the surrounding squares (of which there are at most eight) then becomes one unit taller. - The lumberjack then chooses four different squares on the board. Each tree of positive height on those squares then becomes one unit shorter.  We say that a tree is majestic if its height is at least $10^{6}$. Determine the largest number $K$ such that the gardener can ensure there are eventually $K$ majestic trees on the board, no matter how the lumberjack plays. (Colombia)

Solution: We solve the problem for a general $3 N \times 3 N$ board. First, we prove that the lumberjack has a strategy to ensure there are never more than $5 N^{2}$ majestic trees. Giving the squares of the board coordinates in the natural manner, colour each square where at least one of its coordinates are divisible by 3 , shown below for a $9 \times 9$ board: ![](https://cdn.mathpix.com/cropped/2024_11_18_86efb4389f14b52b08e1g-28.jpg?height=900&width=914&top_left_y=1343&top_left_x=571)  Then, as each $3 \times 3$ square on the board contains exactly 5 coloured squares, each move of the gardener will cause at most 4 trees on non-coloured squares to grow. The lumberjack may therefore cut those trees, ensuring no tree on a non-coloured square has positive height after his turn. Hence there cannot ever be more majestic trees than coloured squares, which is $5 N^{2}$.  Next, we prove the gardener may ensure there are $5 N^{2}$ majestic trees. In fact, we prove this statement in a modified game which is more difficult for the gardener: on the lumberjack's turn in the modified game, he may decrement the height of all trees on the board except those the gardener did not just grow, in addition to four of the trees the gardener just grew. Clearly, a sequence of moves for the gardener which ensures that there are $K$ majestic trees in the modified game also ensures this in the original game.  Let $M=\binom{9}{5}$; we say that a map is one of the $M$ possible ways to mark 5 squares on a $3 \times 3$ board. In the modified game, after the gardener chooses a $3 \times 3$ subboard on the board, the lumberjack chooses a map in this subboard, and the total result of the two moves is that each tree marked on the map increases its height by 1 , each tree in the subboard which is not in the map remains unchanged, and each tree outside the subboard decreases its height by 1. Also note that if the gardener chooses a $3 \times 3$ subboard $M l$ times, the lumberjack will have to choose some map at least $l$ times, so there will be at least 5 trees which each have height $\geqslant l$.  The strategy for the gardener will be to divide the board into $N^{2}$ disjoint $3 \times 3$ subboards, number them $0, \ldots, N^{2}-1$ in some order. Then, for $b=N^{2}-1, \ldots, 0$ in order, he plays $10^{6} M(M+1)^{b}$ times on subboard number $b$. Hence, on subboard number $b$, the moves on that subboard will first ensure 5 of its trees grows by at least $10^{6}(M+1)^{b}$, and then each move after that will decrease their heights by 1 . (As the trees on subboard $b$ had height 0 before the gardener started playing there, no move made on subboards $\geqslant b$ decreased their heights.) As the gardener makes $10^{6} M(M+1)^{b-1}+\ldots=10^{6}\left((M+1)^{b}-1\right)$ moves after he finishes playing on subboard $b$, this means that on subboard $b$, there will be 5 trees of height at least $10^{6}(M+1)^{b}-10^{6}\left((M+1)^{b}-1\right)=10^{6}$, hence each of the subboard has 5 majestic trees, which was what we wanted.


Let $n>3$ be a positive integer. Suppose that $n$ children are arranged in a circle, and $n$ coins are distributed between them (some children may have no coins). At every step, a child with at least 2 coins may give 1 coin to each of their immediate neighbours on the right and left. Determine all initial distributions of coins from which it is possible that, after a finite number of steps, each child has exactly one coin.

Solution: Number the children $1, \ldots, n$, and denote the number of coins the $i$-th child has by $c_{i}$. A step of this process consists of reducing some $c_{i}$ by 2 , and increasing $c_{i-1}, c_{i+1}$ by 1 . (Indices are considered $(\bmod n)$.) Because $(i-1)-2 i+(i+1)=0$, the quantity $\sum_{i=1}^{n} i c_{i}(\bmod n)$ will be invariant under this process. Hence a necessary condition for the children to end up with an uniform distribution of coins is that  $$ \sum_{i=1}^{n} i c_{i}=\frac{n(n+1)}{2} \quad(\bmod n) $$  We will show that this condition is also sufficient. Consider an arbitrary initial distribution of coins. First, whenever child $i$ has more than one coin and $i \neq n$, have child $i$ pass coins to its neighbors. (Child $i$ does nothing.) Then, after some amount of such steps, it must eventually become impossible to do any more steps because no child except perhaps child $i$ has more than 1 coin. (To see this, consider e.g. the quantity $\sum_{i=1}^{n-1} i^{2} c_{i}$, which (as $(i-1)^{2}+(i+1)^{2}>2 i^{2}$ ) increases at each step.)  Hence we can reach a state of the form $\left(z_{1}, \ldots, z_{n-1}, M\right)$, where $z_{i}=0$ or 1 . Call such states semi-uniform states of irregularity $M$. Lemma. If there is a string of children having coins $a, \overbrace{1, \ldots, 1}^{k \text { ones }}, b, \overbrace{1, \ldots, 1}^{k \text { ones }}, c$, with $b \geqslant 2$, after some sequence of steps we may reach the state $a+1, \overbrace{1, \ldots, 1}^{k \text { ones }}, b-2, \overbrace{1, \ldots, 1}^{k \text { ones }}, c+1$. We call performing this sequence of steps long-passing coins. Proof. This is simply repeated application of the operation. We prove the lemma by induction on $k$. For $k=0$, this is just the operation of the problem. If $k=1$, have the child with $b$ coins pass coins, then both of their neighbors pass coins, then the child with $b$ coins pass coins again. For $k \geqslant 2$, first, have the child with $b$ coins pass coins, then have both their neigbors send coins, giving the state  $$ a, \overbrace{1, \ldots, 1}^{k-2 \text { ones }}, 2,0, b, 0,2, \overbrace{1, \ldots, 1}^{k-2 \text { ones }}, c . $$  Now set aside the children with $a, b$ and $c$ coins, and have each child with 2 coins give them to their neighbors until there are no such children remaining. This results in the state  $$ a+1,0, \overbrace{1, \ldots, 1}^{k-2}, b, \overbrace{1, \ldots, 1}^{k-2 \text { ones }}, 0, c+1 $$  By the induction hypothesis, we can have the child with $b$ coins may pass a coin to each of the children with 0 coins, proving the lemma.  Claim. We can reach a semi-uniform state of irregularity $M \leqslant 2$. Proof. If $M>3$, because there are only $n$ coins in total, there must be at least two children with 0 coins. Consider the arc of the circle spanned by the two such children closest to the child with $M$ coins. It has the form  $$ 0, \overbrace{1, \ldots, 1}^{a \text { ones }}, M, \overbrace{1, \ldots, 1}^{b \text { ones }}, 0 $$  If $a=b$, applying the previous lemma we can have the child with $M$ coins long-pass a coin to each of the children with 0 coins, which yields a semi-uniform state with lower $M$. Otherwise, WLOG $a>b$, so we can have the child with $M$ coins long-pass a coin to each of the children at distance $b$ from it, reaching a state of the form $(\alpha:=a-b-1, \beta:=b)$  $$ 0, \overbrace{1, \ldots, 1}^{\alpha \text { ones }}, 2, \overbrace{1, \ldots, 1}^{\beta \text { ones }}, M-2, \overbrace{1, \ldots, 1}^{c \text { ones }} $$  The children in the rightmost string of ones need make no further moves, so consider only the leftmost string. If $\alpha<\beta$, have the child with 2 coins long-pass coins to the child with 0 coins to its left and some child with 1 coin to its right, reaching a new state of the form $0, \overbrace{1, \ldots, 1}^{\alpha \text { ones }}, 2, \overbrace{1, \ldots, 1}^{\beta \text { ones }}, M-2$ with a smaller $\beta$. As $\beta$ cannot decrease indefinitely, eventually $\alpha \geqslant \beta$. If $\alpha=\beta$, have the child with 2 coins long-pass to the child with $M$ coins and the child with 0 coins, reaching a semi-uniform state of irregularity $M-1$ as desired. Otherwise, $\alpha<\beta$, so have the child with 2 coins long-pass to the child with $M$ coins and a child with 1 coin, reaching a state of the form  $$ 0, \overbrace{1, \ldots, 1}^{x \text { ones }}, 2, \overbrace{1, \ldots, 1}^{y \text { ones }}, 0, \overbrace{1, \ldots, 1}^{z \text { ones }}, M-1 $$  Now, consider only the substring between the two children with 0 coins, which has the form $0, \overbrace{1, \ldots, 1}^{x \text { ones }}, 2, \overbrace{1, \ldots, 1}^{y \text { ones }}, 0$. Repeatedly have the child in this substring with 2 coins long-pass to the closest child with 0 coins and some other child. If the other child has 1 coin, we have a new strictly shorter substring of the form $0, \overbrace{1, \ldots, 1}^{x \text { ones }}, 2, \overbrace{1, \ldots, 1}^{y \text { ones }}, 0$. Hence eventually it must happen that the other child also has 0 coins, at which point we reach a semi-uniform state of irregularity $M-1$, proving the claim.  We have now shown that we can reach a semi-regular state of irregularity $M \leqslant 2$, If $M=1$, each child must have one coin, as desired. Otherwise, we must have $M=2$, so there is one child with 0 coins, one child with 2 coins, and the remaining children all have 1 coin. Recall that the state we started with satisfied the invariant  $$ \sum_{i=1}^{n} i c_{i}=\frac{n(n+1)}{2} \quad(\bmod n) $$  Because each step preserves this invariant, this must also be true of the current state. Number the children so that the child with $M$ coins is child number $n$, and suppose the child with 0 coins is child $k$. Then $\frac{n(n+1)}{2}=\sum_{i=1}^{n} i c_{i}=\left(\sum_{i=1}^{n} 1 \cdot c_{i}\right)-k=\frac{n(n+1)}{2}-k(\bmod n)$, so $k=0$ $(\bmod n)$. But this is impossible, as no child except the child with $M$ coins has an index divisible by $n$. Hence we cannot end up in a semi-regular state of irregularity 2 , so we are done.


Solution: Encode the sequence $c_{i}$ as a polynomial $p(x)=\sum_{i} a_{i} x_{i}$. The cyclic nature of the problem makes it natural to work modulo $x^{n}-1$. Child $i$ performing a step is equivalent to adding $x^{i}(x-1)^{2}$ to the polynomial, and we want to reach the polynomial $q(x)=1+x+\ldots+$ $x^{n-1}$. Since we only add multiples of $(x-1)^{2}$, this is only possible if $p(x)=q(x)$ modulo the ideal generated by $x^{n}-1$ and $(x-1)^{2}$, i.e.  $$ \left(x^{n}-1,(x-1)^{2}\right)=(x-1)\left(\frac{x^{n}-1}{x-1}, x-1\right)=(x-1) \cdot(n,(x-1)) $$  This is equivalent to $p(1)=q(1)$ (which simply translates to the condition that there are $n$ coins) and $p^{\prime}(1)=q^{\prime}(1)(\bmod n)$, which translates to the invariant described in solution 1.


Let $m, n \geqslant 2$ be integers, let $X$ be a set with $n$ elements, and let $X_{1}, X_{2}, \ldots, X_{m}$ be pairwise distinct non-empty, not necessary disjoint subsets of $X$. A function $f: X \rightarrow$ $\{1,2, \ldots, n+1\}$ is called nice if there exists an index $k$ such that  $$ \sum_{x \in X_{k}} f(x)>\sum_{x \in X_{i}} f(x) \text { for all } i \neq k $$  Prove that the number of nice functions is at least $n^{n}$. (Germany)

Solution: For a subset $Y \subseteq X$, we write $f(Y)$ for $\sum_{y \in Y} f(y)$. Note that a function $f: X \rightarrow$ $\{1, \ldots, n+1\}$ is nice, if and only if $f\left(X_{i}\right)$ is maximized by a unique index $i \in\{1, \ldots, m\}$.  We will first investigate the set $\mathcal{F}$ of functions $f: X \rightarrow\{1, \ldots, n\}$; note that $|\mathcal{F}|=n^{n}$. For every function $f \in \mathcal{F}$, define a corresponding function $f^{+}: X \rightarrow\{1,2, \ldots, n+1\}$ in the following way: Pick some set $X_{l}$ that maximizes the value $f\left(X_{l}\right)$.  - For all $x \in X_{l}$, define $f^{+}(x)=f(x)+1$. - For all $x \in X \backslash X_{l}$, define $f^{+}(x)=f(x)$.  Claim. The resulting function $f^{+}$is nice. Proof. Note that $f^{+}\left(X_{i}\right)=f\left(X_{i}\right)+\left|X_{i} \cap X_{l}\right|$ holds for all $X_{i}$. We show that $f^{+}\left(X_{i}\right)$ is maximized at the unique index $i=l$. Hence consider some arbitrary index $j \neq l$. Then $X_{l} \subset X_{j}$ is impossible, as this would imply $f\left(X_{j}\right)>f\left(X_{l}\right)$ and thereby contradict the choice of set $X_{l}$; this in particular yields $\left|X_{l}\right|>\left|X_{j} \cap X_{l}\right|$.  $$ f^{+}\left(X_{l}\right)=f\left(X_{l}\right)+\left|X_{l}\right| \geqslant f\left(X_{j}\right)+\left|X_{l}\right|>f\left(X_{j}\right)+\left|X_{j} \cap X_{l}\right|=f^{+}\left(X_{j}\right) $$  The first inequality follows since $X_{l}$ was chosen to maximize the value $f\left(X_{l}\right)$. The second (strict) inequality follows from $\left|X_{l}\right|>\left|X_{j} \cap X_{l}\right|$ as observed above. This completes the proof of the claim.  Next observe that function $f$ can be uniquely reconstructed from $f^{+}$: the claim yields that $f^{+}$has a unique maximizer $X_{l}$, and by decreasing the value of $f^{+}$on $X_{l}$ by 1 , we get we can fully determine the values of $f$. As each of the $n^{n}$ functions $f \in \mathcal{F}$ yields a (unique) corresponding nice function $f^{+}: X \rightarrow\{1,2, \ldots, n+1\}$, the proof is complete.


Let $n$ be a positive integer. We start with $n$ piles of pebbles, each initially containing a single pebble. One can perform moves of the following form: choose two piles, take an equal number of pebbles from each pile and form a new pile out of these pebbles. For each positive integer $n$, find the smallest number of non-empty piles that one can obtain by performing a finite sequence of moves of this form. (Croatia)

Solution: The solution we describe is simple, but not the most effective one. We can combine two piles of $2^{k-1}$ pebbles to make one pile of $2^{k}$ pebbles. In particular, given $2^{k}$ piles of one pebble, we may combine them as follows:  $$ \begin{array}{lcc} 2^{k} \text { piles of } 1 \text { pebble } & \rightarrow & 2^{k-1} \text { piles of } 2 \text { pebbles } \\ 2^{k-1} \text { piles of } 2 \text { pebbles } & \rightarrow & 2^{k-2} \text { piles of } 4 \text { pebbles } \\ 2^{k-2} \text { piles of } 4 \text { pebbles } & \rightarrow & 2^{k-3} \text { piles of } 8 \text { pebbles } \\ & \vdots \\ 2 \text { piles of } 2^{k-1} \text { pebbles } & \rightarrow 1 \text { pile of } 2^{k} \text { pebbles } \end{array} $$  This proves the desired result in the case when $n$ is a power of 2 . If $n$ is not a power of 2 , choose $N$ such that $2^{N}<n<2^{N+1}$. Let $m=n-2^{N}$. Then $0<m<2^{N}$. Make a pile of $2^{N}$ pebbles and call it the large pile. (Alternatively, one can be more efficient and make a pile of $2^{M}$ pebbles where $m \leqslant 2^{M}$.) Since $n$ is not a power of two, there is at least one other pile with pebbles. All other piles have a single pebble (initial condition).  Choose one single pebble pile and remove the pebble and one pebble from the large pile and form a pile of 2 pebbles. If $m<2^{N}-1$, remove another pebble from the large pile and one pebble from the 2 -pile and form a new pile of 2 pebbles. Repeat until the large pile contains exactly $m$ pebbles.  At this point we have one pile of $m$ pebbles, one pile of 2 pebbles, and the rest are single pebble piles. There must be $n-m-2=2^{N}-2$ single piles. Combine two and two into piles of two pebbles. Then there are $2^{N-1}$ piles of two pebbles, which we can make into one pile of $2^{N}$ pebbles. We are left with exactly two piles of pebbles.  Lastly we will prove that it is not possible to form a single pile with all pebbles when $n$ is not a power of two. A move consists of choosing two piles of say $a$ and $b$ pebbles, then removing $c \leqslant \min (a, b)$ pebbles from both piles, and forming a new pile with $2 c$ pebbles. If we include piles of zero pebbles, then this move changes the number of pebbles in three piles as follows (and leaves all other piles unchanged):  $$ \begin{aligned} & a \rightarrow a-c \\ & b \rightarrow \\ & 0-c \\ & 0 \rightarrow \end{aligned} $$  Assume that after the move the number of pebbles in each pile is divisible by an odd integer $m$. In particular, $m|2 c, m| a-c$ and $m \mid b-c$. Since $m$ is odd, it follows that $m \mid c$, and then that $m \mid a$ and $m \mid b$. Hence also before the move the number of pebbles in each pile is divisible by the integer $m$.  If $n$ is not a power of 2 , then $n$ is divisible by an odd integer $m>1$. In order to make a single pile of $n$ pebbles, we would have to start with a distribution in which the number of pebbles in each pile is divisible by the integer $m$. This is impossible when we start with all piles containing a single pebble.  Remarks on starting configurations From any starting configuration that is not a single pile, if there are at least two piles with at least two pebbles, we can remove one pebble from two such piles, and form a new pile with 2 pebbles. We can repeat this until we have one pile of 2 pebbles and the rest are single pebble piles, and then proceed as in the solution. Hence, if $n$ is a power of two, we can make a single pile from any starting configuration.  If $n$ is of the form $n=2^{k} m$ where $m>1$ is odd, then we can make a single pile from any starting configuration in which the number of pebbles in each pile is divisible by the integer $m$, otherwise two piles is the best we can do. Half of this is proven already. For the other half, assume we start with a configuration in which the number of pebbles in each pile is divisible by the integer $m$. Replace each pile of $t m$ pebbles with a pile of $t$ boulders. We now have a total of $2^{k}$ boulders, hence we can make them into one pile of $2^{k}$ boulders. Replacing the boulders with pebbles again, we are done.


Solution: We show an alternative strategy if $n$ is not a power of 2 . Write $n$ in binary form: $n=2^{i_{1}}+2^{i_{2}}+\cdots+2^{i_{k}}$, where $i_{1}>i_{2}>\cdots>i_{k}$. Now we make piles of sizes $2^{i_{1}}, 2^{i_{2}}, \ldots, 2^{i_{k}}$. We call the pile with $2^{i_{1}}$ the large pile, all the others are the small piles.  The strategy is the following: take the two smallest small pile. If they have the same size of $2^{a}$, we make a pile of size $2^{a+1}$. If they have different sizes, we double the smaller pile using the large pile (we allow the large pile to have a negative number of pebbles: later we prove that it is not possible). We call all the new piles small. When we have only one small pile, we terminate the process: we have at most 2 piles.  After each move we have one less number of piles, and all the piles have cardinality power of 2. The number of pebbles is decreasing, and at the end of the process, it has a size of $n-2^{i_{2}+1} \geqslant n-2^{i_{1}}>0$, thus we can manage to have two piles.


Solution: Throughout the solution, we will consider the moves in reverse order. Namely, imagine we have some piles of pebbles, and we are allowed to perform moves as follows: take a pile with an even number of pebbles, split it into two equal halves and add the pebbles from each half to a different pile, possibly forming new piles (we may assume for convenience that there are infinitely many empty piles at any given moment). Given a configuration of piles $\mathcal{C}$, we will use $|\mathcal{C}|$ to denote the number of non-empty piles in $\mathcal{C}$. Given two configurations $\mathcal{C}_{1}, \mathcal{C}_{2}$, we will say that $\mathcal{C}_{2}$ is reachable from $\mathcal{C}_{1}$ if $\mathcal{C}_{2}$ can be obtained by performing a finite sequence of moves starting from $\mathcal{C}_{1}$. Call a configuration of piles $\mathcal{C}$  - simple if each (non-empty) pile in $\mathcal{C}$ consists of a single pebble; - good if at least one (non-empty) pile in $\mathcal{C}$ has an even number of pebbles and the numbers of pebbles on the piles in $\mathcal{C}$ have no non-trivial odd common divisor ( $\mathcal{C}$ has the odd divisor property); - solvable if there exists a simple configuration which is reachable from $\mathcal{C}$.  The problem asks to find the smallest number of non-empty piles in a solvable configuration consisting of $n$ pebbles. We begin the process of answering this question by making the following observation: Lemma 1. Let $\mathcal{C}$ be a configuration of piles. Let $\mathcal{C}^{\prime}$ be a configuration obtained by applying a single move to $\mathcal{C}$. Then (i) if $\mathcal{C}^{\prime}$ has the odd divisor property, then so does $\mathcal{C}$; (ii) the converse to (i) holds if $\left|\mathcal{C}^{\prime}\right| \geqslant|\mathcal{C}|$.  Proof. Suppose that the move consists of splitting a pile of size $2 a$ and adding $a$ pebbles to each of two piles of sizes $b$ and $c$. Here, $a$ is a positive integer and $b, c$ are non-negative integers. Thus, $\mathcal{C}^{\prime}$ can be obtained from $\mathcal{C}$ by replacing the piles of sizes $2 a, b, c$ by two piles of sizes $a+b$ and $a+c$. Note that the extra assumption $\left|\mathcal{C}^{\prime}\right| \geqslant|\mathcal{C}|$ of part (ii) holds if and only if at least one of $b, c$ is zero. (i) Suppose $\mathcal{C}$ doesn't have the odd divisor property, i.e. there exists an odd integer $d>1$ such that the size of each pile in $\mathcal{C}$ is divisible by $d$. In particular, $2 a, b, c$ are multiples of $d$, so since $d$ is odd, it follows that $a, b, c$ are all divisible by $d$. Thus, $a+b$ and $a+c$ are also divisible by $d$, so $d$ divides the size of each pile in $\mathcal{C}^{\prime}$. In conclusion, $\mathcal{C}^{\prime}$ doesn't have the odd divisor property. (ii) If $\mathcal{C}^{\prime}$ doesn't have the odd divisor property and at least one of $b, c$ is zero, then there exists an odd integer $d>1$ such that the size of each pile in $\mathcal{C}^{\prime}$ is divisible by $d$. In particular, $d$ divides $a+b$ and $a+c$, so since at least one of these numbers is equal to $a$, it follows that $d$ divides $a$. But then $d$ must divide all three of $a, b$ and $c$, and hence it certainly divides $2 a, b$ and $c$. Thus, $\mathcal{C}$ doesn't have the odd divisor property, as desired. Lemma 2. If $\mathcal{C}_{2}$ is reachable from $\mathcal{C}_{1}$ and $\mathcal{C}_{2}$ has the odd divisor property, then so does $\mathcal{C}_{1}$. In particular, any solvable configuration has the odd divisor property. Proof. The first statement follows by inductively applying part (i) of Lemma 1. The second statement follows from the first because every simple configuration has the odd divisor property.  The main claim is the following: Lemma 3. Let $\mathcal{C}$ be a good configuration. Then there exists a configuration $\mathcal{C}^{\prime}$ with the following properties:  - $\mathcal{C}^{\prime}$ is reachable from $\mathcal{C}$ and $\left|\mathcal{C}^{\prime}\right|>|\mathcal{C}|$; - $\mathcal{C}^{\prime}$ is either simple or good.  Proof. Call a configuration terminal if it is a counterexample to the claim. The following claim is at the heart of the proof: Claim. Let $a_{1}, \ldots, a_{k}$ be the numbers of pebbles on the non-empty piles of a terminal configuration $\mathcal{C}$. Then there exists a unique $i \in[k]$ such that $a_{i}$ is even. Moreover, for all $t \geqslant 1$ we have $a_{j} \equiv \frac{a_{i}}{2}\left(\bmod 2^{t}\right)$ for all $j \neq i$. Proof of Claim. Since the configuration is good, there must exist $i \in[k]$ such that $a_{i}$ is even. Moreover, by assumption, if we split the pile with $a_{i}$ pebbles into two equal halves, the resulting configuration will not be good. By part (ii) of Lemma 2,the only way this can happen is that $\frac{a_{i}}{2}$ and $a_{j}$ for all $j \neq i$ are odd. To prove the second assertion, we proceed by induction on $t$, with the case $t=1$ already being established. If $t \geqslant 2$, then split the pile with $a_{i}$ pebbles into two equal halves and move one half to the pile with $a_{j}$ pebbles. Since $\frac{a_{i}}{2}$ and $a_{j}$ are both odd, $a_{j}+\frac{a_{i}}{2}$ is even, so by part (ii) of Lemma 2 , the resulting configuration $\mathcal{C}^{\prime}$ is good. Thus, $\mathcal{C}^{\prime}$ is terminal, so by the induction hypothesis, we have $\frac{a_{i}}{2} \equiv \frac{1}{2}\left(a_{j}+\frac{a_{i}}{2}\right)\left(\bmod 2^{t-1}\right)$, whence $a_{j} \equiv \frac{a_{i}}{2}($ $\bmod 2^{t}$ ), as desired.  Suppose for contradiction that there exists a configuration as in the Claim. It follows that there exists $i \in[k]$ and an odd integer $x$ such that $a_{i}=2 x$ and $a_{j}=x$ for all $j \neq i$. Thus, $x$ is an odd common divisor of $a_{1}, \ldots, a_{k}$, so by the odd divisor property, we must have $x=1$. But then we can obtain a simple configuration by splitting the only pile with two pebbles into two piles each consisting of a single pebble, which is a contradiction.  With the aid of Lemmas 2 and 3, it is not hard to characterise all solvable configurations: Lemma 4. A configuration of piles $\mathcal{C}$ is solvable if and only if it is simple or good.  Proof. $(\Longrightarrow)$ Suppose $\mathcal{C}$ is not simple. Then since we have to be able to perform at least one move, there must be at least one non-empty pile in $\mathcal{C}$ with an even number of pebbles. Moreover, by Lemma $2, \mathcal{C}$ has the odd divisor property, so it must be good. $(\Longleftarrow)$ This follows by repeatedly applying Lemma 3 until we reach a simple configuration. Note that the process must stop eventually since the number of non-empty piles is bounded from above.  Finally, the answer to the problem is implied by the following corollary of Lemma 4: Lemma 5. Let $n$ be a positive integer. Then (i) a configuration consisting of a single pile of $n$ pebbles is solvable if and only if $n$ is a power of two; (ii) if $n \geqslant 2$, then the configuration consisting of piles of sizes 2 and $n-2$ is good.  Proof. (i) By Lemma 4, this configuration is solvable if and only if either $n=1$ or $n$ is even and has no non-trivial odd divisor, so the conclusion follows. (ii) Since 2 is even and has no non-trivial odd divisor, this configuration is certainly good, so the conclusion follows by Lemma 4.  Common remarks. Instead of choosing pebbles from two piles, one could allow choosing an equal number of pebbles from each of $k$ piles, where $k \geqslant 2$ is a fixed (prime) integer. However, this seems to yield a much harder problem - if $k=3$, numerical evidence suggests the same answer as in the case $k=2$ (with powers of two replaced by powers of three), but the case $k=5$ is already unclear.


Lucy starts by writing $s$ integer-valued 2022-tuples on a blackboard. After doing that, she can take any two (not necessarily distinct) tuples $\mathbf{v}=\left(v_{1}, \ldots, v_{2022}\right)$ and $\mathbf{w}=\left(w_{1}, \ldots, w_{2022}\right)$ that she has already written, and apply one of the following operations to obtain a new tuple:  $$ \begin{aligned} & \mathbf{v}+\mathbf{w}=\left(v_{1}+w_{1}, \ldots, v_{2022}+w_{2022}\right) \\ & \mathbf{v} \vee \mathbf{w}=\left(\max \left(v_{1}, w_{1}\right), \ldots, \max \left(v_{2022}, w_{2022}\right)\right) \end{aligned} $$  and then write this tuple on the blackboard. It turns out that, in this way, Lucy can write any integer-valued 2022-tuple on the blackboard after finitely many steps. What is the smallest possible number $s$ of tuples that she initially wrote? (Czech Republic)

Solution: We solve the problem for $n$-tuples for any $n \geqslant 3$ : we will show that the answer is $s=3$, regardless of the value of $n$.  First, let us briefly introduce some notation. For an $n$-tuple $\mathbf{v}$, we will write $\mathbf{v}_{i}$ for its $i$-th coordinate (where $1 \leqslant i \leqslant n$ ). For a positive integer $n$ and a tuple $\mathbf{v}$ we will denote by $n \cdot \mathbf{v}$ the tuple obtained by applying addition on $\mathbf{v}$ with itself $n$ times. Furthermore, we denote by $\mathbf{e}(i)$ the tuple which has $i$-th coordinate equal to one and all the other coordinates equal to zero. We say that a tuple is positive if all its coordinates are positive, and negative if all its coordinates are negative.  We will show that three tuples suffice, and then that two tuples do not suffice.  Three tuples suffice. Write $\mathbf{c}$ for the constant-valued tuple $\mathbf{c}=(-1, \ldots,-1)$. We note that it is enough for Lucy to be able to make the tuples $\mathbf{e}(1), \ldots, \mathbf{e}(n), \mathbf{c}$; from those any other tuple $\mathbf{v}$ can be made as follows. First we choose some positive integer $k$ such that $k+\mathbf{v}_{i}>0$ for all $i$. Then, by adding a positive number of copies of $\mathbf{c}, \mathbf{e}(1), \ldots, \mathbf{e}(n)$, she can make  $$ k \mathbf{c}+\left(k+\mathbf{v}_{1}\right) \cdot \mathbf{e}(1)+\cdots+\left(k+\mathbf{v}_{n}\right) \cdot \mathbf{e}(n) $$  which we claim is equal to $\mathbf{v}$. Indeed, this can be checked by comparing coordinates: the $i$-th coordinate of the right-hand side is $-k+\left(k+\mathbf{v}_{i}\right)=\mathbf{v}_{i}$ as needed.  Lucy can take her three starting tuples to be $\mathbf{a}, \mathbf{b}$ and $\mathbf{c}$, such that $\mathbf{a}_{i}=-i^{2}, \mathbf{b}_{i}=i$ and $\mathbf{c}=-1$ (as above).  For any $1 \leqslant j \leqslant n$, write $\mathbf{d}(j)$ for the tuple $2 \cdot \mathbf{a}+4 j \cdot \mathbf{b}+\left(2 j^{2}-1\right) \cdot \mathbf{c}$, which Lucy can make by adding together $\mathbf{a}, \mathbf{b}$ and $\mathbf{c}$ repeatedly. This has $i$ th term  $$ \begin{aligned} \mathbf{d}(j)_{i} & =2 \mathbf{a}_{i}+4 j \mathbf{b}_{i}+\left(2 j^{2}-1\right) \mathbf{c}_{i} \\ & =-2 i^{2}+4 i j-\left(2 j^{2}-1\right) \\ & =1-2(i-j)^{2} \end{aligned} $$  This is 1 if $j=i$, and at most -1 otherwise. Hence Lucy can produce the tuple $\mathbf{1}=(1, \ldots, 1)$ as $\mathbf{d}(1) \vee \cdots \vee \mathbf{d}(n)$.  She can then produce the constant tuple $\mathbf{0}=(0, \ldots, 0)$ as $\mathbf{1}+\mathbf{c}$, and for any $1 \leqslant j \leqslant n$ she can then produce the tuple $\mathbf{e}(j)$ as $\mathbf{d}(j) \vee \mathbf{0}$. Since she can now produce $\mathbf{e}(1), \ldots, \mathbf{e}(n)$ and already had c, she can (as we argued earlier) produce any integer-valued tuple.  Two tuples do not suffice. We start with an observation: Let $a$ be a non-negative real number and suppose that two tuples $\mathbf{v}$ and $\mathbf{w}$ satisfy $\mathbf{v}_{j} \geqslant a \mathbf{v}_{k}$ and $\mathbf{w}_{j} \geqslant a \mathbf{w}_{k}$ for some $1 \leqslant j, k \leqslant n$. Then we claim that the same inequality holds for $\mathbf{v}+\mathbf{w}$ and $\mathbf{v} \vee \mathbf{w}$ : Indeed, the property for the sum is verified by an easy computation:  $$ (\mathbf{v}+\mathbf{w})_{j}=\mathbf{v}_{j}+\mathbf{w}_{j} \geqslant a \mathbf{v}_{k}+a \mathbf{w}_{k}=a(\mathbf{v}+\mathbf{w})_{k} $$  For the second operation, we denote by $\mathbf{m}$ the tuple $\mathbf{v} \vee \mathbf{w}$. Then $\mathbf{m}_{j} \geqslant \mathbf{v}_{j} \geqslant a \mathbf{v}_{k}$ and $\mathbf{m}_{j} \geqslant \mathbf{w}_{j} \geqslant a \mathbf{w}_{k}$. Since $\mathbf{m}_{k}=\mathbf{v}_{k}$ or $\mathbf{m}_{k}=\mathbf{w}_{k}$, the observation follows.  As a consequence of this observation we have that if all starting tuples satisfy such an inequality, then all generated tuples will also satisfy it, and so we would not be able to obtain every integer-valued tuple.  Let us now prove that Lucy needs at least three starting tuples. For contradiction, let us suppose that Lucy started with only two tuples $\mathbf{v}$ and $\mathbf{w}$. We are going to distinguish two cases. In the first case, suppose we can find a coordinate $i$ such that $\mathbf{v}_{i}, \mathbf{w}_{i} \geqslant 0$. Both operations preserve the sign, thus we can not generate any tuple that has negative $i$-th coordinate. Similarly for $\mathbf{v}_{i}, \mathbf{w}_{i} \leqslant 0$.  Suppose the opposite, i.e., for every $i$ we have either $\mathbf{v}_{i}>0>\mathbf{w}_{i}$, or $\mathbf{v}_{i}<0<\mathbf{w}_{i}$. Since we assumed that our tuples have at least three coordinates, by pigeonhole principle there exist two coordinates $j \neq k$ such that $\mathbf{v}_{j}$ has the same sign as $\mathbf{v}_{k}$ and $\mathbf{w}_{j}$ has the same sign as $\mathbf{w}_{k}$ (because there are only two possible combinations of signs).  Without loss of generality assume that $\mathbf{v}_{j}, \mathbf{v}_{k}>0$ and $\mathbf{w}_{j}, \mathbf{w}_{k}<0$. Let us denote the positive real number $\mathbf{v}_{j} / \mathbf{v}_{k}$ by $a$. If $\mathbf{w}_{j} / \mathbf{w}_{k} \leqslant a$, then both inequalities $\mathbf{v}_{j} \geqslant a \mathbf{v}_{k}$ and $\mathbf{w}_{j} \geqslant a \mathbf{w}_{k}$ are satisfied. On the other hand, if $\mathbf{w}_{j} / \mathbf{w}_{k} \leqslant a$, then both $\mathbf{v}_{k} \geqslant(1 / a) \mathbf{v}_{j}$ and $\mathbf{w}_{k} \geqslant(1 / a) \mathbf{w}_{j}$ are satisfied. In either case, we have found the desired inequality satisfied by both starting tuples, a contradiction with the observation above.


Alice fills the fields of an $n \times n$ board with numbers from 1 to $n^{2}$, each number being used exactly once. She then counts the total number of good paths on the board. A good path is a sequence of fields of arbitrary length (including 1) such that: (i) The first field in the sequence is one that is only adjacent to fields with larger numbers, (ii) Each subsequent field in the sequence is adjacent to the previous field, (iii) The numbers written on the fields in the sequence are in increasing order.  Two fields are considered adjacent if they share a common side. Find the smallest possible number of good paths Alice can obtain, as a function of $n$. (Serbia)

Solution: We will call any field that is only adjacent to fields with larger numbers a well. Other fields will be called non-wells. Let us make a second $n \times n$ board $B$ where in each field we will write the number of good sequences which end on the corresponding field in the original board $A$. We will thus look for the minimal possible value of the sum of all entries in $B$.  We note that any well has just one good path ending in it, consisting of just the well, and that any other field has the number of good paths ending in it equal to the sum of this quantity for all the adjacent fields with smaller values, since a good path can only come into the field from a field of lower value. Therefore, if we fill in the fields in $B$ in increasing order with respect to their values in $A$, it follows that each field not adjacent to any already filled field will receive a 1, while each field adjacent to already filled fields will receive the sum of the numbers already written on these adjacent fields.  We note that there is at least one well in $A$, that corresponding with the field with the entry 1 in $A$. Hence, the sum of values of fields in $B$ corresponding to wells in $A$ is at least 1 . We will now try to minimize the sum of the non-well entries, i.e. of the entries in $B$ corresponding to the non-wells in $A$. We note that we can ascribe to each pair of adjacent fields the value of the lower assigned number and that the sum of non-well entries will then equal to the sum of the ascribed numbers. Since the lower number is still at least 1, the sum of non-well entries will at least equal the number of pairs of adjacent fields, which is $2 n(n-1)$. Hence, the total minimum sum of entries in $B$ is at least $2 n(n-1)+1=2 n^{2}-2 n+1$. The necessary conditions for the minimum to be achieved is for there to be only one well and for no two entries in $B$ larger than 1 to be adjacent to each other.  We will now prove that the lower limit of $2 n^{2}-2 n+1$ entries can be achieved. This amounts to finding a way of marking a certain set of squares, those that have a value of 1 in $B$, such that no two unmarked squares are adjacent and that the marked squares form a connected tree with respect to adjacency.  For $n=1$ and $n=2$ the markings are respectively the lone field and the L-trimino. Now, for $n>2$, let $s=2$ for $n \equiv 0,2 \bmod 3$ and $s=1$ for $n \equiv 1 \bmod 3$. We will take indices $k$ and $l$ to be arbitrary non-negative integers. For $n \geqslant 3$ we will construct a path of marked squares in the first two columns consisting of all squares of the form $(1, i)$ where $i$ is not of the form $6 k+s$ and $(2, j)$ where $j$ is of the form $6 k+s-1,6 k+s$ or $6+s+1$. Obviously, this path is connected. Now, let us consider the fields $(2,6 k+s)$ and $(1,6 k+s+3)$. For each considered field $(i, j)$ we will mark all squares of the form $(l, j)$ for $l>i$ and $(i+2 k, j \pm 1)$. One can easily see that no set of marked fields will produce a cycle, that the only fields of the unmarked form $(1,6 k+s),(2+2 l+1,6 k+s \pm 1)$ and $(2+2 l, 6 k+s+3 \pm 1)$ and that no two are adjacent, since the consecutive considered fields are in columns of opposite parity. Examples of markings are given for $n=3,4,5,6,7$, and the corresponding constructions for $A$ and $B$ are given for $n=5$. ![](https://cdn.mathpix.com/cropped/2024_11_18_86efb4389f14b52b08e1g-41.jpg?height=352&width=1648&top_left_y=384&top_left_x=204)


Let $\mathbb{Z}_{\geqslant 0}$ be the set of non-negative integers, and let $f: \mathbb{Z}_{\geqslant 0} \times \mathbb{Z}_{\geqslant 0} \rightarrow \mathbb{Z}_{\geqslant 0}$ be a bijection such that whenever $f\left(x_{1}, y_{1}\right)>f\left(x_{2}, y_{2}\right)$, we have $f\left(x_{1}+1, y_{1}\right)>f\left(x_{2}+1, y_{2}\right)$ and $f\left(x_{1}, y_{1}+1\right)>f\left(x_{2}, y_{2}+1\right)$.  Let $N$ be the number of pairs of integers $(x, y)$, with $0 \leqslant x, y<100$, such that $f(x, y)$ is odd. Find the smallest and largest possible value of $N$.

Solution: We defer the constructions to the end of the solution. Instead, we begin by characterizing all such functions $f$, prove a formula and key property for such functions, and then solve the problem, providing constructions.  Characterization Suppose $f$ satisfies the given relation. The condition can be written more strongly as  $$ \begin{aligned} f\left(x_{1}, y_{1}\right)>f\left(x_{2}, y_{2}\right) & \Longleftrightarrow f\left(x_{1}+1, y_{1}\right)>f\left(x_{2}+1, y_{2}\right) \\ & \Longleftrightarrow f\left(x_{1}, y_{1}+1\right)>f\left(x_{2}, y_{2}+1\right) . \end{aligned} $$  In particular, this means for any $(k, l) \in \mathbb{Z}^{2}, f(x+k, y+l)-f(x, y)$ has the same sign for all $x$ and $y$.  Call a non-zero vector $(k, l) \in \mathbb{Z}_{\geqslant 0} \times \mathbb{Z}_{\geqslant 0}$ a needle if $f(x+k, y)-f(x, y+l)>0$ for all $x$ and $y$. It is not hard to see that needles and non-needles are both closed under addition, and thus under scalar division (whenever the quotient lives in $\mathbb{Z}^{2}$ ).  In addition, call a positive rational number $\frac{k}{l}$ a grade if the vector $(k, l)$ is a needle. (Since needles are closed under scalar multiples and quotients, this is well-defined.) Claim. Grades are closed upwards. Proof. Consider positive rationals $k_{1} / l_{1}<k_{2} / l_{2}$ with $k_{1} / l_{1}$ a grade. Then:  - $\left(k_{1}, l_{1}\right)$ is a needle - so $\left(k_{1} l_{2}, l_{1} l_{2}\right)$ is a needle, - so $\left(k_{2} l_{1}, l_{1} l_{2}\right)$ is a needle (as $k_{2} l_{1}-k_{1} l_{2}>0$ and $(1,0)$ is a needle).  Thus $\left(k_{2}, l_{2}\right)$ is a needle, as wanted. Claim. A grade exists. Proof. If no positive integer $n$ is a grade, then $f(1,0)>f(0, n)$ for all $n$ which is impossible. Similarly, there is an $n$ such that $f(0,1)<f(n, 0)$, thus $1 / n$ is not a grade for some large $n$. That means that small positive rational values are not grades, then there is a switch, and after that all values are grades. Call the place of that switch $\alpha$. Here $\alpha$ is the infimum of the grades. Claim (Key property). If $x_{1}+y_{1} \alpha>x_{2}+y_{2} \alpha$ then $f\left(x_{1}, y_{1}\right)>f\left(x_{2}, y_{2}\right)$. Proof. If both $x_{1} \geqslant x_{2}$ and $y_{1} \geqslant y_{2}$ this is clear. Suppose $x_{1} \geqslant x_{2}$ and $y_{1}<y_{2}$. Then $\frac{x_{1}-x_{2}}{y_{2}-y_{1}}>\alpha$ is a grade. This gives $f\left(x_{1}, y_{1}\right)>f\left(x_{2}, y_{2}\right)$. Suppose $x_{1}<x_{2}$ and $y_{1} \geqslant y_{2}$. Then $\frac{x_{2}-x_{1}}{u_{1}-u_{2}}<\alpha$ is not a grade. This gives $f\left(x_{2}, y_{2}\right)<f\left(x_{1}, y_{1}\right)$.  From those observations we get the following claim. Claim. The function $f$ orders pairs $(x, y)$ based on the value of $x+y \alpha$. If $\alpha$ is rational, tiebreaking is done by larger $x$ - or $y$-coordinate (depending on whether $\alpha$ is a grade).  We can imagine this the following way: take a line with slope $-\frac{1}{\alpha}$ under the first quadrant of the plane. And we start to move this line upward (but it stays parallel to the original line). First it hits $(0,0)$, so $f(0,0)=0$. And each time the line hits a point $p, f(p)$ is the number of points hit before. If $\alpha \in \mathbb{Q}$, it is possible that the line hits multiple points. Then those points are ordered the same way as their $x$ or $y$ coordinates, depending on whether $\alpha$ is a grade.  We understood the behaviour of $f$, now we need to focus on the region of $A=\{(x, y) \in$ $\left.\mathbb{Z}_{\geqslant 0} \times \mathbb{Z}_{\geqslant 0} \mid x<100, y<100\right\}$. First, we can assume that $\alpha$ is irrational. If we change it a little bit in the right direction, the behaviour and values of the $f$ function does not change in $A$. Claim.  $$ f(x, y)+f(x+1, y+1)=f(x+1, y)+f(x, y+1)+1 $$  Proof.  $$ \begin{gathered} f(x+1, y+1)-f(x, y+1)= \\ \#\left\{(a, b) \in \mathbb{Z}_{\geqslant 0} \times \mathbb{Z}_{\geqslant 0} \mid x+(y+1) \alpha \leqslant a+b \alpha<(x+1)+(y+1) \alpha\right\}= \\ \#\left\{(a, b) \in \mathbb{Z}_{\geqslant 0} \times \mathbb{Z}_{>0} \mid x+(y+1) \alpha \leqslant a+b \alpha<(x+1)+(y+1) \alpha\right\}+ \\ \#\left\{(a, 0) \in \mathbb{Z}_{\geqslant 0} \times \mathbb{Z}_{\geqslant 0} \mid(x+1)+y \alpha \leqslant a<(x+1)+(y+1) \alpha\right\}= \\ \#\left\{(a, b) \in \mathbb{Z}_{\geqslant 0} \times \mathbb{Z}_{\geqslant 0} \mid x+y \alpha \leqslant a+b \alpha<(x+1)+y \alpha\right\}+1=f(x+1, y)-f(x, y) . \end{gathered} $$  From this claim we immediately get that $2500 \leqslant N \leqslant 7500$; now we show that those bounds are indeed sharp.  Remember that if $\alpha$ is irrational then  $$ f(a, b)=\#\left\{(x, y) \in \mathbb{Z}_{\geqslant 0} \times \mathbb{Z}_{\geqslant 0} \mid x+y \alpha<a+b \alpha\right\} $$  Construction for 7500 Select $\alpha \approx 199.999$. Claim.  1. $f(n, 0)=n$ for $0 \leqslant n \leqslant 100$. 2. $f(0, k) \equiv k \quad \bmod 2$ for $0 \leqslant k \leqslant 100$.  Proof.  1. $f(n, 0)=\#\{(x, y) \mid x+y \alpha<n\}=\#\{(x, y) \mid x+199 y<n\}=n$. 2.   $$ \begin{aligned} & f(0, k)=\#\{(x, y) \mid x+y \alpha<k \alpha\}=\sum_{l=0}^{k-1} \#\{(x, l) \mid x+l \alpha<k \alpha\} \\ & =\sum_{l=0}^{k-1} \#\{x \mid x<(k-l) \alpha\}=\sum_{l=0}^{k-1} 200(k-l)-1=200 A-k \end{aligned} $$  for some integer $A$. From this claim, using the equality $f(x, y)+f(x+1, y+1)=f(x+1, y)+f(x, y+1)+1$, we can prove that mod 2 the region $A$ looks like the following: in the rows $(-, 2 y)$ the remainders modulo 2 alternate, while the rows $(-, 2 y+1)$ contain only odd numbers. ![](https://cdn.mathpix.com/cropped/2024_11_18_86efb4389f14b52b08e1g-44.jpg?height=364&width=506&top_left_y=229&top_left_x=775)  The numbers mod 2 in the construction for 7500 .  Construction for 2500 Select $\alpha \approx 200.001$.


Let $A B C D E$ be a convex pentagon such that $B C=D E$. Assume there is a point $T$ inside $A B C D E$ with $T B=T D, T C=T E$ and $\angle T B A=\angle A E T$. Let lines $C D$ and $C T$ intersect line $A B$ at points $P$ and $Q$, respectively, and let lines $C D$ and $D T$ intersect line $A E$ at points $R$ and $S$, respectively. Assume that points $P, B, A, Q$ and $R, E, A, S$ respectively, are collinear and occur on their lines in this order. Prove that the points $P, S, Q, R$ are concyclic. (Slovakia)

Solution: By the conditions we have $B C=D E, C T=E T$ and $T B=T D$, so the triangles $T B C$ and $T D E$ are congruent, in particular $\angle B T C=\angle D T E$.  In triangles $T B Q$ and $T E S$ we have $\angle T B Q=\angle S E T$ and $\angle Q T B=180^{\circ}-\angle B T C=180^{\circ}-$ $\angle D T E=\angle E T S$, so these triangles are similar to each other. It follows that $\angle T S E=\angle B Q T$ and  $$ \frac{T D}{T Q}=\frac{T B}{T Q}=\frac{T E}{T S}=\frac{T C}{T S} $$  By rearranging this relation we get $T D \cdot T S=T C \cdot T Q$, so $C, D, Q$ and $S$ are concyclic. (Alternatively, we can get $\angle C Q D=\angle C S D$ from the similar triangles $T C S$ and $T D Q$.) Hence, $\angle D C Q=\angle D S Q$.  Finally, from the angles of triangle $C Q P$ we get  $$ \angle R P Q=\angle R C Q-\angle P Q C=\angle D S Q-\angle D S R=\angle R S Q $$  which proves that $P, Q, R$ and $S$ are concyclic. ![](https://cdn.mathpix.com/cropped/2024_11_18_86efb4389f14b52b08e1g-46.jpg?height=575&width=1503&top_left_y=1503&top_left_x=282)


Solution: As in the previous solution, we note that triangles $T B C$ and $T D E$ are congruent. Denote the intersection point of $D T$ and $B A$ by $V$, and the intersection point of $C T$ and $E A$ by $W$. From triangles $B C Q$ and $D E S$ we then have  $$ \begin{aligned} \angle V S W & =\angle D S E=180^{\circ}-\angle S E D-\angle E D S=180^{\circ}-\angle A E T-\angle T E D-\angle E D T \\ & =180^{\circ}-\angle T B A-\angle T C B-\angle C B T=180^{\circ}-\angle Q C B-\angle C B Q=\angle B Q C=\angle V Q W, \end{aligned} $$  meaning that $V S Q W$ is cyclic, and in particular $\angle W V Q=\angle W S Q$. Since  $$ \angle V T B=180^{\circ}-\angle B T C-\angle C T D=180^{\circ}-\angle C T D-\angle D T E=\angle E T W $$  and $\angle T B V=\angle W E T$ by assumption, we have that the triangles $V T B$ and $W T E$ are similar, hence  $$ \frac{V T}{W T}=\frac{B T}{E T}=\frac{D T}{C T} $$  Thus $C D \| V W$, and angle chasing yields  $$ \angle R P Q=\angle W V Q=\angle W S Q=\angle R S Q $$  concluding the proof.


In the acute-angled triangle $A B C$, the point $F$ is the foot of the altitude from $A$, and $P$ is a point on the segment $A F$. The lines through $P$ parallel to $A C$ and $A B$ meet $B C$ at $D$ and $E$, respectively. Points $X \neq A$ and $Y \neq A$ lie on the circles $A B D$ and $A C E$, respectively, such that $D A=D X$ and $E A=E Y$.  Prove that $B, C, X$ and $Y$ are concyclic. (Netherlands)

Solution: Let $A^{\prime}$ be the intersection of lines $B X$ and $C Y$. By power of a point, it suffices to prove that $A^{\prime} B \cdot A^{\prime} X=A^{\prime} C \cdot A^{\prime} Y$, or, equivalently, that $A^{\prime}$ lies on the radical axis of the circles $A B D X$ and $A C E Y$.  From $D A=D X$ it follows that in circle $A B D X$, point $D$ bisects of one of the arcs $A X$. Therefore, depending on the order of points, the line $B C$ is either the internal or external bisector of $\angle A B X$. In both cases, line $B X$ is the reflection of $B A$ in line $B D C$. Analogously, line $C Y$ is the reflection of $C A$ in line $B C$; we can see that $A^{\prime}$ is the reflection of $A$ in line $B C$, so $A, F$ and $A^{\prime}$ are collinear.  By $P D \| A C$ and $P E \| A B$ we have $\frac{F D}{F C}=\frac{F P}{F A}=\frac{F E}{F B}$, hence $F D \cdot F B=F E \cdot F C$. So, point $F$ has equal powers with respect to circles $A B D X$ and $A C E Y$.  Point $A$, being a common point of the two circles, is another point with equal powers, so the radical axis of circles $A B D X$ and $A C E Y$ is the altitude $A F$ that passes through $A^{\prime}$. ![](https://cdn.mathpix.com/cropped/2024_11_18_86efb4389f14b52b08e1g-48.jpg?height=1152&width=941&top_left_y=1257&top_left_x=563)


Solution: We present another way to prove that line $A P A^{\prime}$ is the radical axis of the circles $A B D$ and $A C E$. It suffices to show that the second intersection point of $A B D$ and $A C E$ lies on $A P$.  Define $N$ to be the second intersection of circle $P D E$ and $A P$. From $\angle D N A=\angle D N P=$ $\angle D E P=\angle D B A$ it follows that $N$ lies on circle $A B D$; analogously, we can show that $N$ lies on circle $A C E$.


Let $A B C D$ be a cyclic quadrilateral. Assume that the points $Q, A, B, P$ are collinear in this order, in such a way that the line $A C$ is tangent to the circle $A D Q$, and the line $B D$ is tangent to the circle $B C P$. Let $M$ and $N$ be the midpoints of $B C$ and $A D$, respectively. Prove that the following three lines are concurrent: line $C D$, the tangent of circle $A N Q$ at point $A$, and the tangent to circle $B M P$ at point $B$. (Slovakia)

Solution: We first prove that triangles $A D Q$ and $C D B$ are similar. Since $A B C D$ is cyclic, we have $\angle D A Q=\angle D C B$. By the tangency of $A C$ to the circle $A Q D$ we also have $\angle C B D=\angle C A D=\angle A Q D$. The claimed similarity is proven.  Let $R$ be the midpoint of $C D$. Points $N$ and $R$ correspond in the proven similarity, and so $\angle Q N A=\angle B R C$. ![](https://cdn.mathpix.com/cropped/2024_11_18_86efb4389f14b52b08e1g-49.jpg?height=715&width=1566&top_left_y=893&top_left_x=248)  Let $K$ be the second common point of line $C D$ with circle $A B R$ (i.e., if $C D$ intersects circle $A B R$, then $K \neq R$ is the other intersection; otherwise, if $C D$ is tangent to $C D$, then $K=R$ ). In both cases, we have $\angle B A K=\angle B R C=\angle Q N A$; that indicates that $A K$ is tangent to circle $A N Q$. It can be showed analogously that $B K$ is tangent to circle $B M P$.  Comment. Note that $M$ and $N$ can be any points on lines $B C$ and $A D$ such that $B M: M C=$ $D N: N A$, as we then simply choose $R$ to be such that $D R: R C$ is that same ratio, and the rest of the proof remains unchanged.


Solution: We present a second solution, without using the condition that $A B C D$ is cyclic. Again, $M$ and $N$ can be any points on lines $B C$ and $A D$ such that $B M: M C=D N: N A$.  Let $A B$ and $C D$ meet at $T$ (if $A B \| C D$ then $T$ is their common ideal point). Let $C D$ meet the tangent to the circle $A N Q$ at $A$, and the tangent to the circle $B M P$ at $B$ at points $K_{1}$ and $K_{2}$, respectively. ![](https://cdn.mathpix.com/cropped/2024_11_18_86efb4389f14b52b08e1g-50.jpg?height=755&width=1554&top_left_y=525&top_left_x=251)  Let $I$ and $J$ be the ideal points of $A D$ and $B C$, respectively. Notice that the pencils $\left(A D, A C, A T, A K_{1}\right)$ and $(Q A, Q D, Q I, Q N)$ of lines are congruent, because $\angle K_{1} A D=\angle A Q N$, $\angle C A D=\angle A Q D$ and $\angle I A T=\angle I Q T$. Hence,  $$ \left(D, C ; T, K_{1}\right)=\left(A D, A C ; A T, A K_{1}\right)=(Q A, Q D ; Q I, Q N)=(A, D ; I, N)=\frac{D N}{N A} $$  It can be obtained analogously that  $$ \left(D, C ; T, K_{2}\right)=\left(B D, B C ; B T, B K_{2}\right)=(P C, P B ; P J, P M)=(C, B ; I, N)=\frac{B M}{M C} $$  From $B M: M C=D N: D A$ we get $\left(D, C ; T, K_{1}\right)=\left(D, C ; T, K_{2}\right)$ and hence $K_{1}=K_{2}$.


Let $A B C$ be an acute-angled triangle with $A C>A B$, let $O$ be its circumcentre, and let $D$ be a point on the segment $B C$. The line through $D$ perpendicular to $B C$ intersects the lines $A O, A C$ and $A B$ at $W, X$ and $Y$, respectively. The circumcircles of triangles $A X Y$ and $A B C$ intersect again at $Z \neq A$.  Prove that if $O W=O D$, then $D Z$ is tangent to the circle $A X Y$. (United Kingdom)

Solution: Let $A O$ intersect $B C$ at $E$. As $E D W$ is a right-angled triangle and $O$ is on $W E$, the condition $O W=O D$ means $O$ is the circumcentre of this triangle. So $O D=O E$ which establishes that $D, E$ are reflections in the perpendicular bisector of $B C$.  Now observe:  $$ 180^{\circ}-\angle D X Z=\angle Z X Y=\angle Z A Y=\angle Z C D $$  which shows $C D X Z$ is cyclic. ![](https://cdn.mathpix.com/cropped/2024_11_18_86efb4389f14b52b08e1g-51.jpg?height=955&width=706&top_left_y=1076&top_left_x=681)  We next show that $A Z \| B C$. To do this, introduce point $Z^{\prime}$ on circle $A B C$ such that $A Z^{\prime} \| B C$. By the previous result, it suffices to prove that $C D X Z^{\prime}$ is cyclic. Notice that triangles $B A E$ and $C Z^{\prime} D$ are reflections in the perpendicular bisector of $B C$. Using this and that $A, O, E$ are collinear:  $$ \angle D Z^{\prime} C=\angle B A E=\angle B A O=90^{\circ}-\frac{1}{2} \angle A O B=90^{\circ}-\angle C=\angle D X C, $$  so $D X Z^{\prime} C$ is cyclic, giving $Z \equiv Z^{\prime}$ as desired. Using $A Z \| B C$ and $C D X Z$ cyclic we get:  $$ \angle A Z D=\angle C D Z=\angle C X Z=\angle A Y Z, $$  which by the converse of alternate segment theorem shows $D Z$ is tangent to circle $A X Y$.


Solution: Notice that point $Z$ is the Miquel-point of lines $A C, B C, B A$ and $D Y$; then $B, D, Z, Y$ and $C, D, X, Y$ are concyclic. Moreover, $Z$ is the centre of the spiral similarity that maps $B C$ to $Y X$.  By $B C \perp Y X$, the angle of that similarity is $90^{\circ}$; hence the circles $A B C Z$ and $A X Y Z$ are perpendicular, therefore the radius $O Z$ in circle $A B C Z$ is tangent to circle $A X Y Z$. ![](https://cdn.mathpix.com/cropped/2024_11_18_86efb4389f14b52b08e1g-52.jpg?height=949&width=934&top_left_y=528&top_left_x=561)  By $O W=O D$, the triangle $O W D$ is isosceles, and  $$ \angle Z O A=2 \angle Z B A=2 \angle Z B Y=2 \angle Z D Y=\angle O D W+\angle D W O, $$  so $D$ lies on line $Z O$ that is tangent to circle $A X Y$.