q$ is analogous; and the claim is true for $p=q$ as $f\left(A_{i}\right)=0$ for all $i$ ). + +We are ready to prove that at least two of the sets $A_{1}, \ldots, A_{k+\ell}$ are nice. The interval $[-d, d]$ has length $2 d$, and we saw that adjacent numbers in the circular arrangement $f\left(A_{1}\right), \ldots, f\left(A_{k+\ell}\right)$ differ by at most $2 d$. Suppose that $f\left(A_{p}\right)<-d$ and $f\left(A_{q}\right)>d$. Then one of the numbers $f\left(A_{p+1}\right), \ldots, f\left(A_{q-1}\right)$ lies in $[-d, d]$, and also one of the numbers $f\left(A_{q+1}\right), \ldots, f\left(A_{p-1}\right)$ lies there. Consequently, one of the sets $A_{p+1}, \ldots, A_{q-1}$ is nice, as well as one of the sets $A_{q+1}, \ldots, A_{p-1}$. If $-d \leq f\left(A_{p}\right)$ and $f\left(A_{q}\right) \leq d$ then $A_{p}$ and $A_{q}$ are nice. + +Let now $f\left(A_{p}\right)<-d$ and $f\left(A_{q}\right) \leq d$. Then $f\left(A_{p}\right)+f\left(A_{q}\right)<0$, and since $\sum f\left(A_{i}\right)=0$, there is an $r \neq q$ such that $f\left(A_{r}\right)>0$. We have $02\left(u_{m-1}-u_{1}\right)$ for all $m \geq 3$. + +Indeed, assume that $u_{m}-u_{1} \leq 2\left(u_{m-1}-u_{1}\right)$ holds for some $m \geq 3$. This inequality can be written as $2\left(u_{m}-u_{m-1}\right) \leq u_{m}-u_{1}$. Take the unique $k$ such that $2^{k} \leq u_{m}-u_{1}<2^{k+1}$. Then $2\left(u_{m}-u_{m-1}\right) \leq u_{m}-u_{1}<2^{k+1}$ yields $u_{m}-u_{m-1}<2^{k}$. However the elements $z=u_{m}, x=u_{1}$, $y=u_{m-1}$ of $S_{a}$ then satisfy $z-y<2^{k}$ and $z-x \geq 2^{k}$, so that $z=u_{m}$ is $k$-good to $S_{a}$. + +Thus each term of the sequence $u_{2}-u_{1}, u_{3}-u_{1}, \ldots, u_{p}-u_{1}$ is more than twice the previous one. Hence $u_{p}-u_{1}>2^{p-1}\left(u_{2}-u_{1}\right) \geq 2^{p-1}$. But $u_{p} \in\left\{1,2,3, \ldots, 2^{n+1}\right\}$, so that $u_{p} \leq 2^{n+1}$. This yields $p-1 \leq n$, i. e. $p \leq n+1$. + +In other words, each set $S_{a}$ contains at most $n+1$ elements that are not good to it. + +To summarize the conclusions, mark with red all elements in the sets $S_{a}$ that are good to the respective set, and with blue the ones that are not good. Then the total number of red elements, counting multiplicities, is at most $n \cdot 2^{n+1}$ (each $z \in A$ can be marked red in at most $n$ sets). The total number of blue elements is at most $(n+1) 2^{n}$ (each set $S_{a}$ contains at most $n+1$ blue elements). Therefore the sum of cardinalities of $S_{1}, S_{2}, \ldots, S_{2^{n}}$ does not exceed $(3 n+1) 2^{n}$. By averaging, the smallest set has at most $3 n+1$ elements. + +Solution 2. We show that one of the sets $S_{a}$ has at most $2 n+1$ elements. In the sequel $|\cdot|$ denotes the cardinality of a (finite) set. + +Claim. For $n \geq 2$, suppose that $k$ subsets $S_{1}, \ldots, S_{k}$ of $\left\{1,2, \ldots, 2^{n}\right\}$ (not necessarily different) satisfy the condition of the problem. Then + +$$ +\sum_{i=1}^{k}\left(\left|S_{i}\right|-n\right) \leq(2 n-1) 2^{n-2} +$$ + +Proof. Observe that if the sets $S_{i}(1 \leq i \leq k)$ satisfy the condition then so do their arbitrary subsets $T_{i}(1 \leq i \leq k)$. The condition also holds for the sets $t+S_{i}=\left\{t+x \mid x \in S_{i}\right\}$ where $t$ is arbitrary. + +Note also that a set may occur more than once among $S_{1}, \ldots, S_{k}$ only if its cardinality is less than 3, in which case its contribution to the sum $\sum_{i=1}^{k}\left(\left|S_{i}\right|-n\right)$ is nonpositive (as $n \geq 2$ ). + +The proof is by induction on $n$. In the base case $n=2$ we have subsets $S_{i}$ of $\{1,2,3,4\}$. Only the ones of cardinality 3 and 4 need to be considered by the remark above; each one of +them occurs at most once among $S_{1}, \ldots, S_{k}$. If $S_{i}=\{1,2,3,4\}$ for some $i$ then no $S_{j}$ is a 3 -element subset in view of the condition, hence $\sum_{i=1}^{k}\left(\left|S_{i}\right|-2\right) \leq 2$. By the condition again, it is impossible that $S_{i}=\{1,3,4\}$ and $S_{j}=\{2,3,4\}$ for some $i, j$. So if $\left|S_{i}\right| \leq 3$ for all $i$ then at most 3 summands $\left|S_{i}\right|-2$ are positive, corresponding to 3 -element subsets. This implies $\sum_{i=1}^{k}\left(\left|S_{i}\right|-2\right) \leq 3$, therefore the conclusion is true for $n=2$. + +Suppose that the claim holds for some $n \geq 2$, and let the sets $S_{1}, \ldots, S_{k} \subseteq\left\{1,2, \ldots, 2^{n+1}\right\}$ satisfy the given property. Denote $U_{i}=S_{i} \cap\left\{1,2, \ldots, 2^{n}\right\}, V_{i}=S_{i} \cap\left\{2^{n}+1, \ldots, 2^{n+1}\right\}$. Let + +$$ +I=\left\{i|1 \leq i \leq k,| U_{i} \mid \neq 0\right\}, \quad J=\{1, \ldots, k\} \backslash I +$$ + +The sets $S_{j}$ with $j \in J$ are all contained in $\left\{2^{n}+1, \ldots, 2^{n+1}\right\}$, so the induction hypothesis applies to their translates $-2^{n}+S_{j}$ which have the same cardinalities. Consequently, this gives $\sum_{j \in J}\left(\left|S_{j}\right|-n\right) \leq(2 n-1) 2^{n-2}$, so that + +$$ +\sum_{j \in J}\left(\left|S_{j}\right|-(n+1)\right) \leq \sum_{j \in J}\left(\left|S_{j}\right|-n\right) \leq(2 n-1) 2^{n-2} +$$ + +For $i \in I$, denote by $v_{i}$ the least element of $V_{i}$. Observe that if $V_{a}$ and $V_{b}$ intersect, with $a2^{n}$, which implies $z=v_{a}$. + +It follows that if the element $v_{i}$ is removed from each $V_{i}$, a family of pairwise disjoint sets $W_{i}=V_{i} \backslash\left\{v_{i}\right\}$ is obtained, $i \in I$ (we assume $W_{i}=\emptyset$ if $V_{i}=\emptyset$ ). As $W_{i} \subseteq\left\{2^{n}+1, \ldots, 2^{n+1}\right\}$ for all $i$, we infer that $\sum_{i \in I}\left|W_{i}\right| \leq 2^{n}$. Therefore $\sum_{i \in I}\left(\left|V_{i}\right|-1\right) \leq \sum_{i \in I}\left|W_{i}\right| \leq 2^{n}$. + +On the other hand, the induction hypothesis applies directly to the sets $U_{i}, i \in I$, so that $\sum_{i \in \mathcal{I}}\left(\left|U_{i}\right|-n\right) \leq(2 n-1) 2^{n-2}$. In summary, + +$$ +\sum_{i \in I}\left(\left|S_{i}\right|-(n+1)\right)=\sum_{i \in I}\left(\left|U_{i}\right|-n\right)+\sum_{i \in I}\left(\left|V_{i}\right|-1\right) \leq(2 n-1) 2^{n-2}+2^{n} +$$ + +The estimates (1) and (2) are sufficient to complete the inductive step: + +$$ +\begin{aligned} +\sum_{i=1}^{k}\left(\left|S_{i}\right|-(n+1)\right) & =\sum_{i \in I}\left(\left|S_{i}\right|-(n+1)\right)+\sum_{j \in J}\left(\left|S_{j}\right|-(n+1)\right) \\ +& \leq(2 n-1) 2^{n-2}+2^{n}+(2 n-1) 2^{n-2}=(2 n+1) 2^{n-1} +\end{aligned} +$$ + +Returning to the problem, consider $k=2^{n}$ subsets $S_{1}, S_{2}, \ldots, S_{2^{n}}$ of $\left\{1,2,3, \ldots, 2^{n+1}\right\}$. If they satisfy the given condition, the claim implies $\sum_{i=1}^{2^{n}}\left(\left|S_{i}\right|-(n+1)\right) \leq(2 n+1) 2^{n-1}$. By averaging again, we see that the smallest set has at most $2 n+1$ elements. + +Comment. It can happen that each set $S_{i}$ has cardinality at least $n+1$. Here is an example by the proposer. + +For $i=1, \ldots, 2^{n}$, let $S_{i}=\left\{i+2^{k} \mid 0 \leq k \leq n\right\}$. Then $\left|S_{i}\right|=n+1$ for all $i$. Suppose that there exist $al$. Since $y \in S_{a}$ and $y 180^{\circ}, +\end{gathered} +$$ + +point $P$ lies in triangle $C D Q$, and hence in $A B C D$. The proof is complete. + + + +G7. Let $A B C D$ be a convex quadrilateral with $A B \neq B C$. Denote by $\omega_{1}$ and $\omega_{2}$ the incircles of triangles $A B C$ and $A D C$. Suppose that there exists a circle $\omega$ inscribed in angle $A B C$, tangent to the extensions of line segments $A D$ and $C D$. Prove that the common external tangents of $\omega_{1}$ and $\omega_{2}$ intersect on $\omega$. + +Solution. The proof below is based on two known facts. + +Lemma 1. Given a convex quadrilateral $A B C D$, suppose that there exists a circle which is inscribed in angle $A B C$ and tangent to the extensions of line segments $A D$ and $C D$. Then $A B+A D=C B+C D$. + +Proof. The circle in question is tangent to each of the lines $A B, B C, C D, D A$, and the respective points of tangency $K, L, M, N$ are located as with circle $\omega$ in the figure. Then + +$$ +A B+A D=(B K-A K)+(A N-D N), \quad C B+C D=(B L-C L)+(C M-D M) . +$$ + +Also $B K=B L, D N=D M, A K=A N, C L=C M$ by equalities of tangents. It follows that $A B+A D=C B+C D$. + + + +For brevity, in the sequel we write "excircle $A C$ " for the excircle of a triangle with side $A C$ which is tangent to line segment $A C$ and the extensions of the other two sides. + +Lemma 2. The incircle of triangle $A B C$ is tangent to its side $A C$ at $P$. Let $P P^{\prime}$ be the diameter of the incircle through $P$, and let line $B P^{\prime}$ intersect $A C$ at $Q$. Then $Q$ is the point of tangency of side $A C$ and excircle $A C$. + +Proof. Let the tangent at $P^{\prime}$ to the incircle $\omega_{1}$ meet $B A$ and $B C$ at $A^{\prime}$ and $C^{\prime}$. Now $\omega_{1}$ is the excircle $A^{\prime} C^{\prime}$ of triangle $A^{\prime} B C^{\prime}$, and it touches side $A^{\prime} C^{\prime}$ at $P^{\prime}$. Since $A^{\prime} C^{\prime} \| A C$, the homothety with centre $B$ and ratio $B Q / B P^{\prime}$ takes $\omega_{1}$ to the excircle $A C$ of triangle $A B C$. Because this homothety takes $P^{\prime}$ to $Q$, the lemma follows. + +Recall also that if the incircle of a triangle touches its side $A C$ at $P$, then the tangency point $Q$ of the same side and excircle $A C$ is the unique point on line segment $A C$ such that $A P=C Q$. + +We pass on to the main proof. Let $\omega_{1}$ and $\omega_{2}$ touch $A C$ at $P$ and $Q$, respectively; then $A P=(A C+A B-B C) / 2, C Q=(C A+C D-A D) / 2$. Since $A B-B C=C D-A D$ by Lemma 1, we obtain $A P=C Q$. It follows that in triangle $A B C$ side $A C$ and excircle $A C$ are tangent at $Q$. Likewise, in triangle $A D C$ side $A C$ and excircle $A C$ are tangent at $P$. Note that $P \neq Q$ as $A B \neq B C$. + +Let $P P^{\prime}$ and $Q Q^{\prime}$ be the diameters perpendicular to $A C$ of $\omega_{1}$ and $\omega_{2}$, respectively. Then Lemma 2 shows that points $B, P^{\prime}$ and $Q$ are collinear, and so are points $D, Q^{\prime}$ and $P$. + +Consider the diameter of $\omega$ perpendicular to $A C$ and denote by $T$ its endpoint that is closer to $A C$. The homothety with centre $B$ and ratio $B T / B P^{\prime}$ takes $\omega_{1}$ to $\omega$. Hence $B, P^{\prime}$ and $T$ are collinear. Similarly, $D, Q^{\prime}$ and $T$ are collinear since the homothety with centre $D$ and ratio $-D T / D Q^{\prime}$ takes $\omega_{2}$ to $\omega$. + +We infer that points $T, P^{\prime}$ and $Q$ are collinear, as well as $T, Q^{\prime}$ and $P$. Since $P P^{\prime} \| Q Q^{\prime}$, line segments $P P^{\prime}$ and $Q Q^{\prime}$ are then homothetic with centre $T$. The same holds true for circles $\omega_{1}$ and $\omega_{2}$ because they have $P P^{\prime}$ and $Q Q^{\prime}$ as diameters. Moreover, it is immediate that $T$ lies on the same side of line $P P^{\prime}$ as $Q$ and $Q^{\prime}$, hence the ratio of homothety is positive. In particular $\omega_{1}$ and $\omega_{2}$ are not congruent. + +In summary, $T$ is the centre of a homothety with positive ratio that takes circle $\omega_{1}$ to circle $\omega_{2}$. This completes the solution, since the only point with the mentioned property is the intersection of the the common external tangents of $\omega_{1}$ and $\omega_{2}$. + +## Number Theory + +N1. Let $n$ be a positive integer and let $p$ be a prime number. Prove that if $a, b, c$ are integers (not necessarily positive) satisfying the equations + +$$ +a^{n}+p b=b^{n}+p c=c^{n}+p a, +$$ + +then $a=b=c$. + +Solution 1. If two of $a, b, c$ are equal, it is immediate that all the three are equal. So we may assume that $a \neq b \neq c \neq a$. Subtracting the equations we get $a^{n}-b^{n}=-p(b-c)$ and two cyclic copies of this equation, which upon multiplication yield + +$$ +\frac{a^{n}-b^{n}}{a-b} \cdot \frac{b^{n}-c^{n}}{b-c} \cdot \frac{c^{n}-a^{n}}{c-a}=-p^{3} . +$$ + +If $n$ is odd then the differences $a^{n}-b^{n}$ and $a-b$ have the same sign and the product on the left is positive, while $-p^{3}$ is negative. So $n$ must be even. + +Let $d$ be the greatest common divisor of the three differences $a-b, b-c, c-a$, so that $a-b=d u, b-c=d v, \quad c-a=d w ; \operatorname{gcd}(u, v, w)=1, u+v+w=0$. + +From $a^{n}-b^{n}=-p(b-c)$ we see that $(a-b) \mid p(b-c)$, i.e., $u \mid p v$; and cyclically $v|p w, w| p u$. As $\operatorname{gcd}(u, v, w)=1$ and $u+v+w=0$, at most one of $u, v, w$ can be divisible by $p$. Supposing that the prime $p$ does not divide any one of them, we get $u|v, v| w, w \mid u$, whence $|u|=|v|=|w|=1$; but this quarrels with $u+v+w=0$. + +Thus $p$ must divide exactly one of these numbers. Let e.g. $p \mid u$ and write $u=p u_{1}$. Now we obtain, similarly as before, $u_{1}|v, v| w, w \mid u_{1}$ so that $\left|u_{1}\right|=|v|=|w|=1$. The equation $p u_{1}+v+w=0$ forces that the prime $p$ must be even; i.e. $p=2$. Hence $v+w=-2 u_{1}= \pm 2$, implying $v=w(= \pm 1)$ and $u=-2 v$. Consequently $a-b=-2(b-c)$. + +Knowing that $n$ is even, say $n=2 k$, we rewrite the equation $a^{n}-b^{n}=-p(b-c)$ with $p=2$ in the form + +$$ +\left(a^{k}+b^{k}\right)\left(a^{k}-b^{k}\right)=-2(b-c)=a-b . +$$ + +The second factor on the left is divisible by $a-b$, so the first factor $\left(a^{k}+b^{k}\right)$ must be $\pm 1$. Then exactly one of $a$ and $b$ must be odd; yet $a-b=-2(b-c)$ is even. Contradiction ends the proof. + +Solution 2. The beginning is as in the first solution. Assuming that $a, b, c$ are not all equal, hence are all distinct, we derive equation (1) with the conclusion that $n$ is even. Write $n=2 k$. + +Suppose that $p$ is odd. Then the integer + +$$ +\frac{a^{n}-b^{n}}{a-b}=a^{n-1}+a^{n-2} b+\cdots+b^{n-1} +$$ + +which is a factor in (1), must be odd as well. This sum of $n=2 k$ summands is odd only if $a$ and $b$ have different parities. The same conclusion holding for $b, c$ and for $c$, $a$, we get that $a, b, c, a$ alternate in their parities, which is clearly impossible. + +Thus $p=2$. The original system shows that $a, b, c$ must be of the same parity. So we may divide (1) by $p^{3}$, i.e. $2^{3}$, to obtain the following product of six integer factors: + +$$ +\frac{a^{k}+b^{k}}{2} \cdot \frac{a^{k}-b^{k}}{a-b} \cdot \frac{b^{k}+c^{k}}{2} \cdot \frac{b^{k}-c^{k}}{b-c} \cdot \frac{c^{k}+a^{k}}{2} \cdot \frac{c^{k}-a^{k}}{c-a}=-1 . +$$ + +Each one of the factors must be equal to $\pm 1$. In particular, $a^{k}+b^{k}= \pm 2$. If $k$ is even, this becomes $a^{k}+b^{k}=2$ and yields $|a|=|b|=1$, whence $a^{k}-b^{k}=0$, contradicting (2). + +Let now $k$ be odd. Then the sum $a^{k}+b^{k}$, with value $\pm 2$, has $a+b$ as a factor. Since $a$ and $b$ are of the same parity, this means that $a+b= \pm 2$; and cyclically, $b+c= \pm 2, c+a= \pm 2$. In some two of these equations the signs must coincide, hence some two of $a, b, c$ are equal. This is the desired contradiction. + +Comment. Having arrived at the equation (1) one is tempted to write down all possible decompositions of $-p^{3}$ (cube of a prime) into a product of three integers. This leads to cumbersome examination of many cases, some of which are unpleasant to handle. One may do that just for $p=2$, having earlier in some way eliminated odd primes from consideration. + +However, the second solution shows that the condition of $p$ being a prime is far too strong. What is actually being used in that solution, is that $p$ is either a positive odd integer or $p=2$. + +N2. Let $a_{1}, a_{2}, \ldots, a_{n}$ be distinct positive integers, $n \geq 3$. Prove that there exist distinct indices $i$ and $j$ such that $a_{i}+a_{j}$ does not divide any of the numbers $3 a_{1}, 3 a_{2}, \ldots, 3 a_{n}$. + +Solution. Without loss of generality, let $0 a_{n-1}\right)$. Thus $3 a_{n-1}=a_{n}+a_{n-1}$, i. e. $a_{n}=2 a_{n-1}$. + +Similarly, if $j=n$ then $3 a_{n}=k\left(a_{n}+a_{n-1}\right)$ for some integer $k$, and only $k=2$ is possible. Hence $a_{n}=2 a_{n-1}$ holds true in both cases remaining, $j=n-1$ and $j=n$. + +Now $a_{n}=2 a_{n-1}$ implies that the sum $a_{n-1}+a_{1}$ is strictly between $a_{n} / 2$ and $a_{n}$. But $a_{n-1}$ and $a_{1}$ are distinct as $n \geq 3$, so it follows from the above that $a_{n-1}+a_{1}$ divides $a_{n}$. This provides the desired contradiction. + +N3. Let $a_{0}, a_{1}, a_{2}, \ldots$ be a sequence of positive integers such that the greatest common divisor of any two consecutive terms is greater than the preceding term; in symbols, $\operatorname{gcd}\left(a_{i}, a_{i+1}\right)>a_{i-1}$. Prove that $a_{n} \geq 2^{n}$ for all $n \geq 0$. + +Solution. Since $a_{i} \geq \operatorname{gcd}\left(a_{i}, a_{i+1}\right)>a_{i-1}$, the sequence is strictly increasing. In particular $a_{0} \geq 1, a_{1} \geq 2$. For each $i \geq 1$ we also have $a_{i+1}-a_{i} \geq \operatorname{gcd}\left(a_{i}, a_{i+1}\right)>a_{i-1}$, and consequently $a_{i+1} \geq a_{i}+a_{i-1}+1$. Hence $a_{2} \geq 4$ and $a_{3} \geq 7$. The equality $a_{3}=7$ would force equalities in the previous estimates, leading to $\operatorname{gcd}\left(a_{2}, a_{3}\right)=\operatorname{gcd}(4,7)>a_{1}=2$, which is false. Thus $a_{3} \geq 8$; the result is valid for $n=0,1,2,3$. These are the base cases for a proof by induction. + +Take an $n \geq 3$ and assume that $a_{i} \geq 2^{i}$ for $i=0,1, \ldots, n$. We must show that $a_{n+1} \geq 2^{n+1}$. Let $\operatorname{gcd}\left(a_{n}, a_{n+1}\right)=d$. We know that $d>a_{n-1}$. The induction claim is reached immediately in the following cases: + +$$ +\begin{array}{ll} +\text { if } \quad a_{n+1} \geq 4 d & \text { then } a_{n+1}>4 a_{n-1} \geq 4 \cdot 2^{n-1}=2^{n+1} \\ +\text { if } \quad a_{n} \geq 3 d & \text { then } a_{n+1} \geq a_{n}+d \geq 4 d>4 a_{n-1} \geq 4 \cdot 2^{n-1}=2^{n+1} \\ +\text { if } \quad a_{n}=d & \text { then } a_{n+1} \geq a_{n}+d=2 a_{n} \geq 2 \cdot 2^{n}=2^{n+1} +\end{array} +$$ + +The only remaining possibility is that $a_{n}=2 d$ and $a_{n+1}=3 d$, which we assume for the sequel. So $a_{n+1}=\frac{3}{2} a_{n}$. + +Let now $\operatorname{gcd}\left(a_{n-1}, a_{n}\right)=d^{\prime}$; then $d^{\prime}>a_{n-2}$. Write $a_{n}=m d^{\prime} \quad(m$ an integer $)$. Keeping in mind that $d^{\prime} \leq a_{n-1} 9 a_{n-2} \geq 9 \cdot 2^{n-2}>2^{n+1} \\ +& \text { if } 3 \leq m \leq 4 \text { then } a_{n-1}<\frac{1}{2} \cdot 4 d^{\prime} \text {, and hence } a_{n-1}=d^{\prime} \\ +& \qquad a_{n+1}=\frac{3}{2} m a_{n-1} \geq \frac{3}{2} \cdot 3 a_{n-1} \geq \frac{9}{2} \cdot 2^{n-1}>2^{n+1} . +\end{aligned} +$$ + +So we are left with the case $m=5$, which means that $a_{n}=5 d^{\prime}, a_{n+1}=\frac{15}{2} d^{\prime}, a_{n-1} a_{n-3}$. Because $d^{\prime \prime}$ is a divisor of $a_{n-1}$, hence also of $2 d^{\prime}$, we may write $2 d^{\prime}=m^{\prime} d^{\prime \prime}$ ( $m^{\prime}$ an integer). Since $d^{\prime \prime} \leq a_{n-2} \frac{75}{4} a_{n-3} \geq \frac{75}{4} \cdot 2^{n-3}>2^{n+1} \\ +& \text { if } 3 \leq m^{\prime} \leq 4 \text { then } a_{n-2}<\frac{1}{2} \cdot 4 d^{\prime \prime} \text {, and hence } a_{n-2}=d^{\prime \prime} \\ +& \qquad a_{n+1}=\frac{15}{4} m^{\prime} a_{n-2} \geq \frac{15}{4} \cdot 3 a_{n-2} \geq \frac{45}{4} \cdot 2^{n-2}>2^{n+1} . +\end{aligned} +$$ + +Both of them have produced the induction claim. But now there are no cases left. Induction is complete; the inequality $a_{n} \geq 2^{n}$ holds for all $n$. + +N4. Let $n$ be a positive integer. Show that the numbers + +$$ +\left(\begin{array}{c} +2^{n}-1 \\ +0 +\end{array}\right), \quad\left(\begin{array}{c} +2^{n}-1 \\ +1 +\end{array}\right), \quad\left(\begin{array}{c} +2^{n}-1 \\ +2 +\end{array}\right), \quad \ldots, \quad\left(\begin{array}{c} +2^{n}-1 \\ +2^{n-1}-1 +\end{array}\right) +$$ + +are congruent modulo $2^{n}$ to $1,3,5, \ldots, 2^{n}-1$ in some order. + +Solution 1. It is well-known that all these numbers are odd. So the assertion that their remainders $\left(\bmod 2^{n}\right)$ make up a permutation of $\left\{1,3, \ldots, 2^{n}-1\right\}$ is equivalent just to saying that these remainders are all distinct. We begin by showing that + +$$ +\left(\begin{array}{c} +2^{n}-1 \\ +2 k +\end{array}\right)+\left(\begin{array}{c} +2^{n}-1 \\ +2 k+1 +\end{array}\right) \equiv 0 \quad\left(\bmod 2^{n}\right) \quad \text { and } \quad\left(\begin{array}{c} +2^{n}-1 \\ +2 k +\end{array}\right) \equiv(-1)^{k}\left(\begin{array}{c} +2^{n-1}-1 \\ +k +\end{array}\right) \quad\left(\bmod 2^{n}\right) +$$ + +The first relation is immediate, as the sum on the left is equal to $\left(\begin{array}{c}2^{n} \\ 2 k+1\end{array}\right)=\frac{2^{n}}{2 k+1}\left(\begin{array}{c}2^{n}-1 \\ 2 k\end{array}\right)$, hence is divisible by $2^{n}$. The second relation: + +$$ +\left(\begin{array}{c} +2^{n}-1 \\ +2 k +\end{array}\right)=\prod_{j=1}^{2 k} \frac{2^{n}-j}{j}=\prod_{i=1}^{k} \frac{2^{n}-(2 i-1)}{2 i-1} \cdot \prod_{i=1}^{k} \frac{2^{n-1}-i}{i} \equiv(-1)^{k}\left(\begin{array}{c} +2^{n-1}-1 \\ +k +\end{array}\right) \quad\left(\bmod 2^{n}\right) . +$$ + +This prepares ground for a proof of the required result by induction on $n$. The base case $n=1$ is obvious. Assume the assertion is true for $n-1$ and pass to $n$, denoting $a_{k}=\left(\begin{array}{c}2^{n-1}-1 \\ k\end{array}\right)$, $b_{m}=\left(\begin{array}{c}2^{n}-1 \\ m\end{array}\right)$. The induction hypothesis is that all the numbers $a_{k}\left(0 \leq k<2^{n-2}\right)$ are distinct $\left(\bmod 2^{n-1}\right)$; the claim is that all the numbers $b_{m}\left(0 \leq m<2^{n-1}\right)$ are distinct $\left(\bmod 2^{n}\right)$. + +The congruence relations (1) are restated as + +$$ +b_{2 k} \equiv(-1)^{k} a_{k} \equiv-b_{2 k+1} \quad\left(\bmod 2^{n}\right) +$$ + +Shifting the exponent in the first relation of (1) from $n$ to $n-1$ we also have the congruence $a_{2 i+1} \equiv-a_{2 i}\left(\bmod 2^{n-1}\right)$. We hence conclude: + +If, for some $j, k<2^{n-2}, a_{k} \equiv-a_{j}\left(\bmod 2^{n-1}\right)$, then $\{j, k\}=\{2 i, 2 i+1\}$ for some $i$. + +This is so because in the sequence $\left(a_{k}: k<2^{n-2}\right)$ each term $a_{j}$ is complemented to $0\left(\bmod 2^{n-1}\right)$ by only one other term $a_{k}$, according to the induction hypothesis. + +From (2) we see that $b_{4 i} \equiv a_{2 i}$ and $b_{4 i+3} \equiv a_{2 i+1}\left(\bmod 2^{n}\right)$. Let + +$$ +M=\left\{m: 0 \leq m<2^{n-1}, m \equiv 0 \text { or } 3(\bmod 4)\right\}, \quad L=\left\{l: 0 \leq l<2^{n-1}, l \equiv 1 \text { or } 2(\bmod 4)\right\} +$$ + +The last two congruences take on the unified form + +$$ +b_{m} \equiv a_{\lfloor m / 2\rfloor} \quad\left(\bmod 2^{n}\right) \quad \text { for all } \quad m \in M +$$ + +Thus all the numbers $b_{m}$ for $m \in M$ are distinct $\left(\bmod 2^{n}\right)$ because so are the numbers $a_{k}$ (they are distinct $\left(\bmod 2^{n-1}\right)$, hence also $\left(\bmod 2^{n}\right)$ ). + +Every $l \in L$ is paired with a unique $m \in M$ into a pair of the form $\{2 k, 2 k+1\}$. So (2) implies that also all the $b_{l}$ for $l \in L$ are distinct $\left(\bmod 2^{n}\right)$. It remains to eliminate the possibility that $b_{m} \equiv b_{l}\left(\bmod 2^{n}\right)$ for some $m \in M, l \in L$. + +Suppose that such a situation occurs. Let $m^{\prime} \in M$ be such that $\left\{m^{\prime}, l\right\}$ is a pair of the form $\{2 k, 2 k+1\}$, so that $($ see $(2)) b_{m^{\prime}} \equiv-b_{l}\left(\bmod 2^{n}\right)$. Hence $b_{m^{\prime}} \equiv-b_{m}\left(\bmod 2^{n}\right)$. Since both $m^{\prime}$ and $m$ are in $M$, we have by (4) $b_{m^{\prime}} \equiv a_{j}, b_{m} \equiv a_{k}\left(\bmod 2^{n}\right)$ for $j=\left\lfloor m^{\prime} / 2\right\rfloor, k=\lfloor m / 2\rfloor$. + +Then $a_{j} \equiv-a_{k}\left(\bmod 2^{n}\right)$. Thus, according to $(3), j=2 i, k=2 i+1$ for some $i$ (or vice versa). The equality $a_{2 i+1} \equiv-a_{2 i}\left(\bmod 2^{n}\right)$ now means that $\left(\begin{array}{c}2^{n-1}-1 \\ 2 i\end{array}\right)+\left(\begin{array}{c}2^{n-1}-1 \\ 2 i+1\end{array}\right) \equiv 0\left(\bmod 2^{n}\right)$. However, the sum on the left is equal to $\left(\begin{array}{c}2^{n-1} \\ 2 i+1\end{array}\right)$. A number of this form cannot be divisible by $2^{n}$. This is a contradiction which concludes the induction step and proves the result. + +Solution 2. We again proceed by induction, writing for brevity $N=2^{n-1}$ and keeping notation $a_{k}=\left(\begin{array}{c}N-1 \\ k\end{array}\right), b_{m}=\left(\begin{array}{c}2 N-1 \\ m\end{array}\right)$. Assume that the result holds for the sequence $\left(a_{0}, a_{1}, a_{2}, \ldots, a_{N / 2-1}\right)$. In view of the symmetry $a_{N-1-k}=a_{k}$ this sequence is a permutation of $\left(a_{0}, a_{2}, a_{4}, \ldots, a_{N-2}\right)$. So the induction hypothesis says that this latter sequence, taken $(\bmod N)$, is a permutation of $(1,3,5, \ldots, N-1)$. Similarly, the induction claim is that $\left(b_{0}, b_{2}, b_{4}, \ldots, b_{2 N-2}\right)$, taken $(\bmod 2 N)$, is a permutation of $(1,3,5, \ldots, 2 N-1)$. + +In place of the congruence relations (2) we now use the following ones, + +$$ +b_{4 i} \equiv a_{2 i} \quad(\bmod N) \quad \text { and } \quad b_{4 i+2} \equiv b_{4 i}+N \quad(\bmod 2 N) . +$$ + +Given this, the conclusion is immediate: the first formula of (5) together with the induction hypothesis tells us that $\left(b_{0}, b_{4}, b_{8}, \ldots, b_{2 N-4}\right)(\bmod N)$ is a permutation of $(1,3,5, \ldots, N-1)$. Then the second formula of $(5)$ shows that $\left(b_{2}, b_{6}, b_{10}, \ldots, b_{2 N-2}\right)(\bmod N)$ is exactly the same permutation; moreover, this formula distinguishes $(\bmod 2 N)$ each $b_{4 i}$ from $b_{4 i+2}$. + +Consequently, these two sequences combined represent $(\bmod 2 N)$ a permutation of the sequence $(1,3,5, \ldots, N-1, N+1, N+3, N+5, \ldots, N+N-1)$, and this is precisely the induction claim. + +Now we prove formulas (5); we begin with the second one. Since $b_{m+1}=b_{m} \cdot \frac{2 N-m-1}{m+1}$, + +$$ +b_{4 i+2}=b_{4 i} \cdot \frac{2 N-4 i-1}{4 i+1} \cdot \frac{2 N-4 i-2}{4 i+2}=b_{4 i} \cdot \frac{2 N-4 i-1}{4 i+1} \cdot \frac{N-2 i-1}{2 i+1} . +$$ + +The desired congruence $b_{4 i+2} \equiv b_{4 i}+N$ may be multiplied by the odd number $(4 i+1)(2 i+1)$, giving rise to a chain of successively equivalent congruences: + +$$ +\begin{aligned} +b_{4 i}(2 N-4 i-1)(N-2 i-1) & \equiv\left(b_{4 i}+N\right)(4 i+1)(2 i+1) & & (\bmod 2 N), \\ +b_{4 i}(2 i+1-N) & \equiv\left(b_{4 i}+N\right)(2 i+1) & & (\bmod 2 N), \\ +\left(b_{4 i}+2 i+1\right) N & \equiv 0 & & (\bmod 2 N) ; +\end{aligned} +$$ + +and the last one is satisfied, as $b_{4 i}$ is odd. This settles the second relation in (5). + +The first one is proved by induction on $i$. It holds for $i=0$. Assume $b_{4 i} \equiv a_{2 i}(\bmod 2 N)$ and consider $i+1$ : + +$$ +b_{4 i+4}=b_{4 i+2} \cdot \frac{2 N-4 i-3}{4 i+3} \cdot \frac{2 N-4 i-4}{4 i+4} ; \quad a_{2 i+2}=a_{2 i} \cdot \frac{N-2 i-1}{2 i+1} \cdot \frac{N-2 i-2}{2 i+2} . +$$ + +Both expressions have the fraction $\frac{N-2 i-2}{2 i+2}$ as the last factor. Since $2 i+2 1$. + +Direct verification shows that this function meets the requirements. + +Conversely, let $f: \mathbb{N} \rightarrow \mathbb{N}$ satisfy (i) and (ii). Applying (i) for $x=1$ gives $d(f(1))=1$, so $f(1)=1$. In the sequel we prove that (1) holds for all $n>1$. Notice that $f(m)=f(n)$ implies $m=n$ in view of (i). The formula $d\left(p_{1}^{b_{1}} \cdots p_{k}^{b_{k}}\right)=\left(b_{1}+1\right) \cdots\left(b_{k}+1\right)$ will be used throughout. + +Let $p$ be a prime. Since $d(f(p))=p$, the formula just mentioned yields $f(p)=q^{p-1}$ for some prime $q$; in particular $f(2)=q^{2-1}=q$ is a prime. We prove that $f(p)=p^{p-1}$ for all primes $p$. + +Suppose that $p$ is odd and $f(p)=q^{p-1}$ for a prime $q$. Applying (ii) first with $x=2$, $y=p$ and then with $x=p, y=2$ shows that $f(2 p)$ divides both $(2-1) p^{2 p-1} f(2)=p^{2 p-1} f(2)$ and $(p-1) 2^{2 p-1} f(p)=(p-1) 2^{2 p-1} q^{p-1}$. If $q \neq p$ then the odd prime $p$ does not divide $(p-1) 2^{2 p-1} q^{p-1}$, hence the greatest common divisor of $p^{2 p-1} f(2)$ and $(p-1) 2^{2 p-1} q^{p-1}$ is a divisor of $f(2)$. Thus $f(2 p)$ divides $f(2)$ which is a prime. As $f(2 p)>1$, we obtain $f(2 p)=f(2)$ which is impossible. So $q=p$, i. e. $f(p)=p^{p-1}$. + +For $p=2$ the same argument with $x=2, y=3$ and $x=3, y=2$ shows that $f(6)$ divides both $3^{5} f(2)$ and $2^{6} f(3)=2^{6} 3^{2}$. If the prime $f(2)$ is odd then $f(6)$ divides $3^{2}=9$, so $f(6) \in\{1,3,9\}$. However then $6=d(f(6)) \in\{d(1), d(3), d(9)\}=\{1,2,3\}$ which is false. In conclusion $f(2)=2$. + +Next, for each $n>1$ the prime divisors of $f(n)$ are among the ones of $n$. Indeed, let $p$ be the least prime divisor of $n$. Apply (ii) with $x=p$ and $y=n / p$ to obtain that $f(n)$ divides $(p-1) y^{n-1} f(p)=(p-1) y^{n-1} p^{p-1}$. Write $f(n)=\ell P$ where $\ell$ is coprime to $n$ and $P$ is a product of primes dividing $n$. Since $\ell$ divides $(p-1) y^{n-1} p^{p-1}$ and is coprime to $y^{n-1} p^{p-1}$, it divides $p-1$; hence $d(\ell) \leq \ell 1$ ). So $f\left(p^{a}\right)=p^{b}$ for some $b \geq 1$, and (i) yields $p^{a}=d\left(f\left(p^{a}\right)\right)=d\left(p^{b}\right)=b+1$. Hence $f\left(p^{a}\right)=p^{p^{a}-1}$, as needed. + +Let us finally show that (1) is true for a general $n>1$ with prime factorization $n=p_{1}^{a_{1}} \cdots p_{k}^{a_{k}}$. We saw that the prime factorization of $f(n)$ has the form $f(n)=p_{1}^{b_{1}} \cdots p_{k}^{b_{k}}$. For $i=1, \ldots, k$, set $x=p_{i}^{a_{i}}$ and $y=n / x$ in (ii) to infer that $f(n)$ divides $\left(p_{i}^{a_{i}}-1\right) y^{n-1} f\left(p_{i}^{a_{i}}\right)$. Hence $p_{i}^{b_{i}}$ divides $\left(p_{i}^{a_{i}}-1\right) y^{n-1} f\left(p_{i}^{a_{i}}\right)$, and because $p_{i}^{b_{i}}$ is coprime to $\left(p_{i}^{a_{i}}-1\right) y^{n-1}$, it follows that $p_{i}^{b_{i}}$ divides $f\left(p_{i}^{a_{i}}\right)=p_{i}^{p_{i}^{a_{i}}-1}$. So $b_{i} \leq p_{i}^{a_{i}}-1$ for all $i=1, \ldots, k$. Combined with (i), these conclusions imply + +$$ +p_{1}^{a_{1}} \cdots p_{k}^{a_{k}}=n=d(f(n))=d\left(p_{1}^{b_{1}} \cdots p_{k}^{b_{k}}\right)=\left(b_{1}+1\right) \cdots\left(b_{k}+1\right) \leq p_{1}^{a_{1}} \cdots p_{k}^{a_{k}} . +$$ + +Hence all inequalities $b_{i} \leq p_{i}^{a_{i}}-1$ must be equalities, $i=1, \ldots, k$, implying that (1) holds true. The proof is complete. + +N6. Prove that there exist infinitely many positive integers $n$ such that $n^{2}+1$ has a prime divisor greater than $2 n+\sqrt{2 n}$. + +Solution. Let $p \equiv 1(\bmod 8)$ be a prime. The congruence $x^{2} \equiv-1(\bmod p)$ has two solutions in $[1, p-1]$ whose sum is $p$. If $n$ is the smaller one of them then $p$ divides $n^{2}+1$ and $n \leq(p-1) / 2$. We show that $p>2 n+\sqrt{10 n}$. + +Let $n=(p-1) / 2-\ell$ where $\ell \geq 0$. Then $n^{2} \equiv-1(\bmod p)$ gives + +$$ +\left(\frac{p-1}{2}-\ell\right)^{2} \equiv-1 \quad(\bmod p) \quad \text { or } \quad(2 \ell+1)^{2}+4 \equiv 0 \quad(\bmod p) +$$ + +Thus $(2 \ell+1)^{2}+4=r p$ for some $r \geq 0$. As $(2 \ell+1)^{2} \equiv 1 \equiv p(\bmod 8)$, we have $r \equiv 5(\bmod 8)$, so that $r \geq 5$. Hence $(2 \ell+1)^{2}+4 \geq 5 p$, implying $\ell \geq(\sqrt{5 p-4}-1) / 2$. Set $\sqrt{5 p-4}=u$ for clarity; then $\ell \geq(u-1) / 2$. Therefore + +$$ +n=\frac{p-1}{2}-\ell \leq \frac{1}{2}(p-u) +$$ + +Combined with $p=\left(u^{2}+4\right) / 5$, this leads to $u^{2}-5 u-10 n+4 \geq 0$. Solving this quadratic inequality with respect to $u \geq 0$ gives $u \geq(5+\sqrt{40 n+9}) / 2$. So the estimate $n \leq(p-u) / 2$ leads to + +$$ +p \geq 2 n+u \geq 2 n+\frac{1}{2}(5+\sqrt{40 n+9})>2 n+\sqrt{10 n} +$$ + +Since there are infinitely many primes of the form $8 k+1$, it follows easily that there are also infinitely many $n$ with the stated property. + +Comment. By considering the prime factorization of the product $\prod_{n=1}^{N}\left(n^{2}+1\right)$, it can be obtained that its greatest prime divisor is at least $c N \log N$. This could improve the statement as $p>n \log n$. + +However, the proof applies some advanced information about the distribution of the primes of the form $4 k+1$, which is inappropriate for high schools contests. + diff --git a/IMO/md/en-IMO2009SL.md b/IMO/md/en-IMO2009SL.md new file mode 100644 index 0000000000000000000000000000000000000000..9d9f92d2e96d1e078738bfa2c70c2bebdf2f7dad --- /dev/null +++ b/IMO/md/en-IMO2009SL.md @@ -0,0 +1,2790 @@ + + +Bremen + +# International Mathematical Olympiad + +Germany + +## 10 to 22 July 2009 + +## Problem Shortlist with solutions + + + +## Problem Shortlist with Solutions + +We insistently ask everybody to consider the following IMO Regulations rule: + +## These Shortlist Problems
have to be kept strictly confidential until IMO 2010. + +## The Problem Selection Committee + +Konrad Engel, Karl Fegert, Andreas Felgenhauer, Hans-Dietrich Gronau, Roger Labahn, Bernd Mulansky, Jürgen Prestin, Christian Reiher, Peter Scholze, Eckard Specht, Robert Strich, Martin Welk +gratefully received +132 problem proposals submitted by 39 countries: +Algeria, Australia, Austria, Belarus, Belgium, Bulgaria, Colombia, Croatia, Czech Republic, El Salvador, Estonia, Finland, France, Greece, Hong Kong, Hungary, India, Ireland, Islamic Republic of Iran, Japan, Democratic People's Republic of Korea, Lithuania, Luxembourg, The former Yugoslav Republic of Macedonia, Mongolia, Netherlands, New Zealand, Pakistan, Peru, Poland, Romania, Russian Federation, Slovenia, South Africa, Taiwan, Turkey, Ukraine, United Kingdom, United States of America. + +Layout: Roger Labahn with $\mathrm{LATE}_{\mathrm{E}} \mathrm{X}$ \& $\mathrm{T}_{\mathrm{E}} \mathrm{X}$ +Drawings: Eckard Specht with nicefig 2.0 + + +The Problem Selection Committee + +## Contents + +Problem Shortlist 4 +Algebra 12 +Combinatorics 26 +Geometry 47 +Number Theory 69 + +## Algebra + +## A1 CZE (Czech Republic) + +Find the largest possible integer $k$, such that the following statement is true: +Let 2009 arbitrary non-degenerated triangles be given. In every triangle the three sides are colored, such that one is blue, one is red and one is white. Now, for every color separately, let us sort the lengths of the sides. We obtain + +$$ +\begin{aligned} +& b_{1} \leq b_{2} \\ +& \leq \ldots \leq b_{2009} \quad \text { the lengths of the blue sides, } \\ +r_{1} & \leq r_{2} \leq \ldots \leq r_{2009} \quad \text { the lengths of the red sides, } \\ +\text { and } \quad w_{1} & \leq w_{2} \leq \ldots \leq w_{2009} \quad \text { the lengths of the white sides. } +\end{aligned} +$$ + +Then there exist $k$ indices $j$ such that we can form a non-degenerated triangle with side lengths $b_{j}, r_{j}, w_{j}$ 。 + +## A2 EST (Estonia) + +Let $a, b, c$ be positive real numbers such that $\frac{1}{a}+\frac{1}{b}+\frac{1}{c}=a+b+c$. Prove that + +$$ +\frac{1}{(2 a+b+c)^{2}}+\frac{1}{(2 b+c+a)^{2}}+\frac{1}{(2 c+a+b)^{2}} \leq \frac{3}{16} +$$ + +## A3 FRA (France) + +Determine all functions $f$ from the set of positive integers into the set of positive integers such that for all $x$ and $y$ there exists a non degenerated triangle with sides of lengths + +$$ +x, \quad f(y) \quad \text { and } \quad f(y+f(x)-1) +$$ + +## A4 BLR (Belarus) + +Let $a, b, c$ be positive real numbers such that $a b+b c+c a \leq 3 a b c$. Prove that + +$$ +\sqrt{\frac{a^{2}+b^{2}}{a+b}}+\sqrt{\frac{b^{2}+c^{2}}{b+c}}+\sqrt{\frac{c^{2}+a^{2}}{c+a}}+3 \leq \sqrt{2}(\sqrt{a+b}+\sqrt{b+c}+\sqrt{c+a}) . +$$ + +## A5 BLR (Belarus) + +Let $f$ be any function that maps the set of real numbers into the set of real numbers. Prove that there exist real numbers $x$ and $y$ such that + +$$ +f(x-f(y))>y f(x)+x +$$ + +## A6 USA (United States of America) + +Suppose that $s_{1}, s_{2}, s_{3}, \ldots$ is a strictly increasing sequence of positive integers such that the subsequences + +$$ +s_{s_{1}}, s_{s_{2}}, s_{s_{3}}, \ldots \quad \text { and } \quad s_{s_{1}+1}, s_{s_{2}+1}, s_{s_{3}+1}, \ldots +$$ + +are both arithmetic progressions. Prove that $s_{1}, s_{2}, s_{3}, \ldots$ is itself an arithmetic progression. + +## A7 JPN (Japan) + +Find all functions $f$ from the set of real numbers into the set of real numbers which satisfy for all real $x, y$ the identity + +$$ +f(x f(x+y))=f(y f(x))+x^{2} +$$ + +## Combinatorics + +## C1 NZL (New Zealand) + +Consider 2009 cards, each having one gold side and one black side, lying in parallel on a long table. Initially all cards show their gold sides. Two players, standing by the same long side of the table, play a game with alternating moves. Each move consists of choosing a block of 50 consecutive cards, the leftmost of which is showing gold, and turning them all over, so those which showed gold now show black and vice versa. The last player who can make a legal move wins. +(a) Does the game necessarily end? +(b) Does there exist a winning strategy for the starting player? + +## C2 ROU (Romania) + +For any integer $n \geq 2$, let $N(n)$ be the maximal number of triples $\left(a_{i}, b_{i}, c_{i}\right), i=1, \ldots, N(n)$, consisting of nonnegative integers $a_{i}, b_{i}$ and $c_{i}$ such that the following two conditions are satisfied: +(1) $a_{i}+b_{i}+c_{i}=n$ for all $i=1, \ldots, N(n)$, +(2) If $i \neq j$, then $a_{i} \neq a_{j}, b_{i} \neq b_{j}$ and $c_{i} \neq c_{j}$. + +Determine $N(n)$ for all $n \geq 2$. + +Comment. The original problem was formulated for $m$-tuples instead for triples. The numbers $N(m, n)$ are then defined similarly to $N(n)$ in the case $m=3$. The numbers $N(3, n)$ and $N(n, n)$ should be determined. The case $m=3$ is the same as in the present problem. The upper bound for $N(n, n)$ can be proved by a simple generalization. The construction of a set of triples attaining the bound can be easily done by induction from $n$ to $n+2$. + +## C3 RUS (Russian Federation) + +Let $n$ be a positive integer. Given a sequence $\varepsilon_{1}, \ldots, \varepsilon_{n-1}$ with $\varepsilon_{i}=0$ or $\varepsilon_{i}=1$ for each $i=1, \ldots, n-1$, the sequences $a_{0}, \ldots, a_{n}$ and $b_{0}, \ldots, b_{n}$ are constructed by the following rules: + +$$ +\begin{gathered} +a_{0}=b_{0}=1, \quad a_{1}=b_{1}=7, \\ +a_{i+1}=\left\{\begin{array}{ll} +2 a_{i-1}+3 a_{i}, & \text { if } \varepsilon_{i}=0, \\ +3 a_{i-1}+a_{i}, & \text { if } \varepsilon_{i}=1, +\end{array} \text { for each } i=1, \ldots, n-1,\right. \\ +b_{i+1}=\left\{\begin{array}{ll} +2 b_{i-1}+3 b_{i}, & \text { if } \varepsilon_{n-i}=0, \\ +3 b_{i-1}+b_{i}, & \text { if } \varepsilon_{n-i}=1, +\end{array} \text { for each } i=1, \ldots, n-1 .\right. +\end{gathered} +$$ + +Prove that $a_{n}=b_{n}$. + +## C4 NLD (Netherlands) + +For an integer $m \geq 1$, we consider partitions of a $2^{m} \times 2^{m}$ chessboard into rectangles consisting of cells of the chessboard, in which each of the $2^{m}$ cells along one diagonal forms a separate rectangle of side length 1 . Determine the smallest possible sum of rectangle perimeters in such a partition. + +## C5 NLD (Netherlands) + +Five identical empty buckets of 2-liter capacity stand at the vertices of a regular pentagon. Cinderella and her wicked Stepmother go through a sequence of rounds: At the beginning of every round, the Stepmother takes one liter of water from the nearby river and distributes it arbitrarily over the five buckets. Then Cinderella chooses a pair of neighboring buckets, empties them into the river, and puts them back. Then the next round begins. The Stepmother's goal is to make one of these buckets overflow. Cinderella's goal is to prevent this. Can the wicked Stepmother enforce a bucket overflow? + +## C6 BGR (Bulgaria) + +On a $999 \times 999$ board a limp rook can move in the following way: From any square it can move to any of its adjacent squares, i.e. a square having a common side with it, and every move must be a turn, i.e. the directions of any two consecutive moves must be perpendicular. A nonintersecting route of the limp rook consists of a sequence of pairwise different squares that the limp rook can visit in that order by an admissible sequence of moves. Such a non-intersecting route is called cyclic, if the limp rook can, after reaching the last square of the route, move directly to the first square of the route and start over. +How many squares does the longest possible cyclic, non-intersecting route of a limp rook visit? + +## C7 RUS (Russian Federation) + +Variant 1. A grasshopper jumps along the real axis. He starts at point 0 and makes 2009 jumps to the right with lengths $1,2, \ldots, 2009$ in an arbitrary order. Let $M$ be a set of 2008 positive integers less than 1005 - 2009. Prove that the grasshopper can arrange his jumps in such a way that he never lands on a point from $M$. + +Variant 2. Let $n$ be a nonnegative integer. A grasshopper jumps along the real axis. He starts at point 0 and makes $n+1$ jumps to the right with pairwise different positive integral lengths $a_{1}, a_{2}, \ldots, a_{n+1}$ in an arbitrary order. Let $M$ be a set of $n$ positive integers in the interval $(0, s)$, where $s=a_{1}+a_{2}+\cdots+a_{n+1}$. Prove that the grasshopper can arrange his jumps in such a way that he never lands on a point from $M$. + +## C8 AUT (Austria) + +For any integer $n \geq 2$, we compute the integer $h(n)$ by applying the following procedure to its decimal representation. Let $r$ be the rightmost digit of $n$. +(1) If $r=0$, then the decimal representation of $h(n)$ results from the decimal representation of $n$ by removing this rightmost digit 0 . +(2) If $1 \leq r \leq 9$ we split the decimal representation of $n$ into a maximal right part $R$ that solely consists of digits not less than $r$ and into a left part $L$ that either is empty or ends with a digit strictly smaller than $r$. Then the decimal representation of $h(n)$ consists of the decimal representation of $L$, followed by two copies of the decimal representation of $R-1$. For instance, for the number $n=17,151,345,543$, we will have $L=17,151, R=345,543$ and $h(n)=17,151,345,542,345,542$. +Prove that, starting with an arbitrary integer $n \geq 2$, iterated application of $h$ produces the integer 1 after finitely many steps. + +## Geometry + +## G1 BEL (Belgium) + +Let $A B C$ be a triangle with $A B=A C$. The angle bisectors of $A$ and $B$ meet the sides $B C$ and $A C$ in $D$ and $E$, respectively. Let $K$ be the incenter of triangle $A D C$. Suppose that $\angle B E K=45^{\circ}$. Find all possible values of $\angle B A C$. + +## G2 RUS (Russian Federation) + +Let $A B C$ be a triangle with circumcenter $O$. The points $P$ and $Q$ are interior points of the sides $C A$ and $A B$, respectively. The circle $k$ passes through the midpoints of the segments $B P$, $C Q$, and $P Q$. Prove that if the line $P Q$ is tangent to circle $k$ then $O P=O Q$. + +## G3 IRN (Islamic Republic of Iran) + +Let $A B C$ be a triangle. The incircle of $A B C$ touches the sides $A B$ and $A C$ at the points $Z$ and $Y$, respectively. Let $G$ be the point where the lines $B Y$ and $C Z$ meet, and let $R$ and $S$ be points such that the two quadrilaterals $B C Y R$ and $B C S Z$ are parallelograms. +Prove that $G R=G S$. + +## G4 UNK (United Kingdom) + +Given a cyclic quadrilateral $A B C D$, let the diagonals $A C$ and $B D$ meet at $E$ and the lines $A D$ and $B C$ meet at $F$. The midpoints of $A B$ and $C D$ are $G$ and $H$, respectively. Show that $E F$ is tangent at $E$ to the circle through the points $E, G$, and $H$. + +## G5 POL (Poland) + +Let $P$ be a polygon that is convex and symmetric to some point $O$. Prove that for some parallelogram $R$ satisfying $P \subset R$ we have + +$$ +\frac{|R|}{|P|} \leq \sqrt{2} +$$ + +where $|R|$ and $|P|$ denote the area of the sets $R$ and $P$, respectively. + +## G6 UKR (Ukraine) + +Let the sides $A D$ and $B C$ of the quadrilateral $A B C D$ (such that $A B$ is not parallel to $C D$ ) intersect at point $P$. Points $O_{1}$ and $O_{2}$ are the circumcenters and points $H_{1}$ and $H_{2}$ are the orthocenters of triangles $A B P$ and $D C P$, respectively. Denote the midpoints of segments $O_{1} H_{1}$ and $O_{2} H_{2}$ by $E_{1}$ and $E_{2}$, respectively. Prove that the perpendicular from $E_{1}$ on $C D$, the perpendicular from $E_{2}$ on $A B$ and the line $H_{1} H_{2}$ are concurrent. + +## G7 IRN (Islamic Republic of Iran) + +Let $A B C$ be a triangle with incenter $I$ and let $X, Y$ and $Z$ be the incenters of the triangles $B I C, C I A$ and $A I B$, respectively. Let the triangle $X Y Z$ be equilateral. Prove that $A B C$ is equilateral too. + +## G8 BGR (Bulgaria) + +Let $A B C D$ be a circumscribed quadrilateral. Let $g$ be a line through $A$ which meets the segment $B C$ in $M$ and the line $C D$ in $N$. Denote by $I_{1}, I_{2}$, and $I_{3}$ the incenters of $\triangle A B M$, $\triangle M N C$, and $\triangle N D A$, respectively. Show that the orthocenter of $\triangle I_{1} I_{2} I_{3}$ lies on $g$. + +## Number Theory + +## N1 AUS (Australia) + +A social club has $n$ members. They have the membership numbers $1,2, \ldots, n$, respectively. From time to time members send presents to other members, including items they have already received as presents from other members. In order to avoid the embarrassing situation that a member might receive a present that he or she has sent to other members, the club adds the following rule to its statutes at one of its annual general meetings: +"A member with membership number $a$ is permitted to send a present to a member with membership number $b$ if and only if $a(b-1)$ is a multiple of $n$." +Prove that, if each member follows this rule, none will receive a present from another member that he or she has already sent to other members. + +Alternative formulation: Let $G$ be a directed graph with $n$ vertices $v_{1}, v_{2}, \ldots, v_{n}$, such that there is an edge going from $v_{a}$ to $v_{b}$ if and only if $a$ and $b$ are distinct and $a(b-1)$ is a multiple of $n$. Prove that this graph does not contain a directed cycle. + +## N2 PER (Peru) + +A positive integer $N$ is called balanced, if $N=1$ or if $N$ can be written as a product of an even number of not necessarily distinct primes. Given positive integers $a$ and $b$, consider the polynomial $P$ defined by $P(x)=(x+a)(x+b)$. +(a) Prove that there exist distinct positive integers $a$ and $b$ such that all the numbers $P(1), P(2)$, $\ldots, P(50)$ are balanced. +(b) Prove that if $P(n)$ is balanced for all positive integers $n$, then $a=b$. + +## N3 EST (Estonia) + +Let $f$ be a non-constant function from the set of positive integers into the set of positive integers, such that $a-b$ divides $f(a)-f(b)$ for all distinct positive integers $a, b$. Prove that there exist infinitely many primes $p$ such that $p$ divides $f(c)$ for some positive integer $c$. + +## N4 PRK (Democratic People's Republic of Korea) + +Find all positive integers $n$ such that there exists a sequence of positive integers $a_{1}, a_{2}, \ldots, a_{n}$ satisfying + +$$ +a_{k+1}=\frac{a_{k}^{2}+1}{a_{k-1}+1}-1 +$$ + +for every $k$ with $2 \leq k \leq n-1$. + +## N5 HUN (Hungary) + +Let $P(x)$ be a non-constant polynomial with integer coefficients. Prove that there is no function $T$ from the set of integers into the set of integers such that the number of integers $x$ with $T^{n}(x)=x$ is equal to $P(n)$ for every $n \geq 1$, where $T^{n}$ denotes the $n$-fold application of $T$. + +## N6 TUR (Turkey) + +Let $k$ be a positive integer. Show that if there exists a sequence $a_{0}, a_{1}, \ldots$ of integers satisfying the condition + +$$ +a_{n}=\frac{a_{n-1}+n^{k}}{n} \quad \text { for all } n \geq 1 +$$ + +then $k-2$ is divisible by 3 . + +## N7 MNG (Mongolia) + +Let $a$ and $b$ be distinct integers greater than 1 . Prove that there exists a positive integer $n$ such that $\left(a^{n}-1\right)\left(b^{n}-1\right)$ is not a perfect square. + +## Algebra + +## A1 CZE (Czech Republic) + +Find the largest possible integer $k$, such that the following statement is true: +Let 2009 arbitrary non-degenerated triangles be given. In every triangle the three sides are colored, such that one is blue, one is red and one is white. Now, for every color separately, let us sort the lengths of the sides. We obtain + +$$ +\begin{array}{rlrl} +b_{1} & \leq b_{2} & \leq \ldots \leq b_{2009} \quad & \\ +& & \text { the lengths of the blue sides, } \\ +r_{1} & \leq r_{2} & \leq \ldots \leq r_{2009} \quad \text { the lengths of the red sides, } \\ +w_{1} & \leq w_{2} & \leq \ldots \leq w_{2009} \quad \text { the lengths of the white sides. } +\end{array} +$$ + +Then there exist $k$ indices $j$ such that we can form a non-degenerated triangle with side lengths $b_{j}, r_{j}, w_{j}$ 。 + +Solution. We will prove that the largest possible number $k$ of indices satisfying the given condition is one. +Firstly we prove that $b_{2009}, r_{2009}, w_{2009}$ are always lengths of the sides of a triangle. Without loss of generality we may assume that $w_{2009} \geq r_{2009} \geq b_{2009}$. We show that the inequality $b_{2009}+r_{2009}>w_{2009}$ holds. Evidently, there exists a triangle with side lengths $w, b, r$ for the white, blue and red side, respectively, such that $w_{2009}=w$. By the conditions of the problem we have $b+r>w, b_{2009} \geq b$ and $r_{2009} \geq r$. From these inequalities it follows + +$$ +b_{2009}+r_{2009} \geq b+r>w=w_{2009} +$$ + +Secondly we will describe a sequence of triangles for which $w_{j}, b_{j}, r_{j}$ with $j<2009$ are not the lengths of the sides of a triangle. Let us define the sequence $\Delta_{j}, j=1,2, \ldots, 2009$, of triangles, where $\Delta_{j}$ has +a blue side of length $2 j$, +a red side of length $j$ for all $j \leq 2008$ and 4018 for $j=2009$, +and a white side of length $j+1$ for all $j \leq 2007$, 4018 for $j=2008$ and 1 for $j=2009$. +Since + +$$ +\begin{array}{rrrl} +(j+1)+j>2 j & \geq j+1>j, & \text { if } & j \leq 2007 \\ +2 j+j>4018>2 j \quad>j, & \text { if } & j=2008 \\ +4018+1>2 j & =4018>1, & \text { if } & j=2009 +\end{array} +$$ + +such a sequence of triangles exists. Moreover, $w_{j}=j, r_{j}=j$ and $b_{j}=2 j$ for $1 \leq j \leq 2008$. Then + +$$ +w_{j}+r_{j}=j+j=2 j=b_{j} +$$ + +i.e., $b_{j}, r_{j}$ and $w_{j}$ are not the lengths of the sides of a triangle for $1 \leq j \leq 2008$. + +## A2 EST (Estonia) + +Let $a, b, c$ be positive real numbers such that $\frac{1}{a}+\frac{1}{b}+\frac{1}{c}=a+b+c$. Prove that + +$$ +\frac{1}{(2 a+b+c)^{2}}+\frac{1}{(2 b+c+a)^{2}}+\frac{1}{(2 c+a+b)^{2}} \leq \frac{3}{16} +$$ + +Solution 1. For positive real numbers $x, y, z$, from the arithmetic-geometric-mean inequality, + +$$ +2 x+y+z=(x+y)+(x+z) \geq 2 \sqrt{(x+y)(x+z)} +$$ + +we obtain + +$$ +\frac{1}{(2 x+y+z)^{2}} \leq \frac{1}{4(x+y)(x+z)} +$$ + +Applying this to the left-hand side terms of the inequality to prove, we get + +$$ +\begin{aligned} +\frac{1}{(2 a+b+c)^{2}} & +\frac{1}{(2 b+c+a)^{2}}+\frac{1}{(2 c+a+b)^{2}} \\ +& \leq \frac{1}{4(a+b)(a+c)}+\frac{1}{4(b+c)(b+a)}+\frac{1}{4(c+a)(c+b)} \\ +& =\frac{(b+c)+(c+a)+(a+b)}{4(a+b)(b+c)(c+a)}=\frac{a+b+c}{2(a+b)(b+c)(c+a)} . +\end{aligned} +$$ + +A second application of the inequality of the arithmetic-geometric mean yields + +$$ +a^{2} b+a^{2} c+b^{2} a+b^{2} c+c^{2} a+c^{2} b \geq 6 a b c +$$ + +or, equivalently, + +$$ +9(a+b)(b+c)(c+a) \geq 8(a+b+c)(a b+b c+c a) +$$ + +The supposition $\frac{1}{a}+\frac{1}{b}+\frac{1}{c}=a+b+c$ can be written as + +$$ +a b+b c+c a=a b c(a+b+c) . +$$ + +Applying the arithmetic-geometric-mean inequality $x^{2} y^{2}+x^{2} z^{2} \geq 2 x^{2} y z$ thrice, we get + +$$ +a^{2} b^{2}+b^{2} c^{2}+c^{2} a^{2} \geq a^{2} b c+a b^{2} c+a b c^{2} +$$ + +which is equivalent to + +$$ +(a b+b c+c a)^{2} \geq 3 a b c(a+b+c) +$$ + +Combining (1), (2), (3), and (4), we will finish the proof: + +$$ +\begin{aligned} +\frac{a+b+c}{2(a+b)(b+c)(c+a)} & =\frac{(a+b+c)(a b+b c+c a)}{2(a+b)(b+c)(c+a)} \cdot \frac{a b+b c+c a}{a b c(a+b+c)} \cdot \frac{a b c(a+b+c)}{(a b+b c+c a)^{2}} \\ +& \leq \frac{9}{2 \cdot 8} \cdot 1 \cdot \frac{1}{3}=\frac{3}{16} +\end{aligned} +$$ + +Solution 2. Equivalently, we prove the homogenized inequality + +$$ +\frac{(a+b+c)^{2}}{(2 a+b+c)^{2}}+\frac{(a+b+c)^{2}}{(a+2 b+c)^{2}}+\frac{(a+b+c)^{2}}{(a+b+2 c)^{2}} \leq \frac{3}{16}(a+b+c)\left(\frac{1}{a}+\frac{1}{b}+\frac{1}{c}\right) +$$ + +for all positive real numbers $a, b, c$. Without loss of generality we choose $a+b+c=1$. Thus, the problem is equivalent to prove for all $a, b, c>0$, fulfilling this condition, the inequality + +$$ +\frac{1}{(1+a)^{2}}+\frac{1}{(1+b)^{2}}+\frac{1}{(1+c)^{2}} \leq \frac{3}{16}\left(\frac{1}{a}+\frac{1}{b}+\frac{1}{c}\right) . +$$ + +Applying Jensen's inequality to the function $f(x)=\frac{x}{(1+x)^{2}}$, which is concave for $0 \leq x \leq 2$ and increasing for $0 \leq x \leq 1$, we obtain + +$$ +\alpha \frac{a}{(1+a)^{2}}+\beta \frac{b}{(1+b)^{2}}+\gamma \frac{c}{(1+c)^{2}} \leq(\alpha+\beta+\gamma) \frac{A}{(1+A)^{2}}, \quad \text { where } \quad A=\frac{\alpha a+\beta b+\gamma c}{\alpha+\beta+\gamma} +$$ + +Choosing $\alpha=\frac{1}{a}, \beta=\frac{1}{b}$, and $\gamma=\frac{1}{c}$, we can apply the harmonic-arithmetic-mean inequality + +$$ +A=\frac{3}{\frac{1}{a}+\frac{1}{b}+\frac{1}{c}} \leq \frac{a+b+c}{3}=\frac{1}{3}<1 +$$ + +Finally we prove (5): + +$$ +\begin{aligned} +\frac{1}{(1+a)^{2}}+\frac{1}{(1+b)^{2}}+\frac{1}{(1+c)^{2}} & \leq\left(\frac{1}{a}+\frac{1}{b}+\frac{1}{c}\right) \frac{A}{(1+A)^{2}} \\ +& \leq\left(\frac{1}{a}+\frac{1}{b}+\frac{1}{c}\right) \frac{\frac{1}{3}}{\left(1+\frac{1}{3}\right)^{2}}=\frac{3}{16}\left(\frac{1}{a}+\frac{1}{b}+\frac{1}{c}\right) . +\end{aligned} +$$ + +## A3 FRA (France) + +Determine all functions $f$ from the set of positive integers into the set of positive integers such that for all $x$ and $y$ there exists a non degenerated triangle with sides of lengths + +$$ +x, \quad f(y) \quad \text { and } \quad f(y+f(x)-1) . +$$ + +Solution. The identity function $f(x)=x$ is the only solution of the problem. +If $f(x)=x$ for all positive integers $x$, the given three lengths are $x, y=f(y)$ and $z=$ $f(y+f(x)-1)=x+y-1$. Because of $x \geq 1, y \geq 1$ we have $z \geq \max \{x, y\}>|x-y|$ and $z1$ we would conclude $f(y)=f(y+m)$ for all $y$ considering the triangle with the side lengths $1, f(y)$ and $f(y+m)$. Thus, $f$ would be $m$-periodic and, consequently, bounded. Let $B$ be a bound, $f(x) \leq B$. If we choose $x>2 B$ we obtain the contradiction $x>2 B \geq f(y)+f(y+f(x)-1)$. + +Step 2. For all positive integers $z$, we have $f(f(z))=z$. +Setting $x=z$ and $y=1$ this follows immediately from Step 1. + +Step 3. For all integers $z \geq 1$, we have $f(z) \leq z$. +Let us show, that the contrary leads to a contradiction. Assume $w+1=f(z)>z$ for some $z$. From Step 1 we know that $w \geq z \geq 2$. Let $M=\max \{f(1), f(2), \ldots, f(w)\}$ be the largest value of $f$ for the first $w$ integers. First we show, that no positive integer $t$ exists with + +$$ +f(t)>\frac{z-1}{w} \cdot t+M +$$ + +otherwise we decompose the smallest value $t$ as $t=w r+s$ where $r$ is an integer and $1 \leq s \leq w$. Because of the definition of $M$, we have $t>w$. Setting $x=z$ and $y=t-w$ we get from the triangle inequality + +$$ +z+f(t-w)>f((t-w)+f(z)-1)=f(t-w+w)=f(t) +$$ + +Hence, + +$$ +f(t-w) \geq f(t)-(z-1)>\frac{z-1}{w}(t-w)+M +$$ + +a contradiction to the minimality of $t$. +Therefore the inequality (1) fails for all $t \geq 1$, we have proven + +$$ +f(t) \leq \frac{z-1}{w} \cdot t+M +$$ + +instead. + +Now, using (2), we finish the proof of Step 3. Because of $z \leq w$ we have $\frac{z-1}{w}<1$ and we can choose an integer $t$ sufficiently large to fulfill the condition + +$$ +\left(\frac{z-1}{w}\right)^{2} t+\left(\frac{z-1}{w}+1\right) M y f(x)+x +$$ + +Solution 1. Assume that + +$$ +f(x-f(y)) \leq y f(x)+x \quad \text { for all real } x, y +$$ + +Let $a=f(0)$. Setting $y=0$ in (1) gives $f(x-a) \leq x$ for all real $x$ and, equivalently, + +$$ +f(y) \leq y+a \quad \text { for all real } y +$$ + +Setting $x=f(y)$ in (1) yields in view of (2) + +$$ +a=f(0) \leq y f(f(y))+f(y) \leq y f(f(y))+y+a . +$$ + +This implies $0 \leq y(f(f(y))+1)$ and thus + +$$ +f(f(y)) \geq-1 \quad \text { for all } y>0 +$$ + +From (2) and (3) we obtain $-1 \leq f(f(y)) \leq f(y)+a$ for all $y>0$, so + +$$ +f(y) \geq-a-1 \quad \text { for all } y>0 +$$ + +Now we show that + +$$ +f(x) \leq 0 \quad \text { for all real } x +$$ + +Assume the contrary, i.e. there is some $x$ such that $f(x)>0$. Take any $y$ such that + +$$ +y 0 +$$ + +and with (1) and (4) we obtain + +$$ +y f(x)+x \geq f(x-f(y)) \geq-a-1, +$$ + +whence + +$$ +y \geq \frac{-a-x-1}{f(x)} +$$ + +contrary to our choice of $y$. Thereby, we have established (5). +Setting $x=0$ in (5) leads to $a=f(0) \leq 0$ and (2) then yields + +$$ +f(x) \leq x \quad \text { for all real } x +$$ + +Now choose $y$ such that $y>0$ and $y>-f(-1)-1$ and set $x=f(y)-1$. From (11), (5) and +(6) we obtain + +$$ +f(-1)=f(x-f(y)) \leq y f(x)+x=y f(f(y)-1)+f(y)-1 \leq y(f(y)-1)-1 \leq-y-1, +$$ + +i.e. $y \leq-f(-1)-1$, a contradiction to the choice of $y$. + +Solution 2. Assume that + +$$ +f(x-f(y)) \leq y f(x)+x \quad \text { for all real } x, y +$$ + +Let $a=f(0)$. Setting $y=0$ in (7) gives $f(x-a) \leq x$ for all real $x$ and, equivalently, + +$$ +f(y) \leq y+a \quad \text { for all real } y +$$ + +Now we show that + +$$ +f(z) \geq 0 \quad \text { for all } z \geq 1 +$$ + +Let $z \geq 1$ be fixed, set $b=f(z)$ and assume that $b<0$. Setting $x=w+b$ and $y=z$ in (7) gives + +$$ +f(w)-z f(w+b) \leq w+b \quad \text { for all real } w +$$ + +Applying (10) to $w, w+b, \ldots, w+(n-1) b$, where $n=1,2, \ldots$, leads to + +$$ +\begin{gathered} +f(w)-z^{n} f(w+n b)=(f(w)-z f(w+b))+z(f(w+b)-z f(w+2 b)) \\ ++\cdots+z^{n-1}(f(w+(n-1) b)-z f(w+n b)) \\ +\leq(w+b)+z(w+2 b)+\cdots+z^{n-1}(w+n b) +\end{gathered} +$$ + +From (8) we obtain + +$$ +f(w+n b) \leq w+n b+a +$$ + +and, thus, we have for all positive integers $n$ + +$$ +f(w) \leq\left(1+z+\cdots+z^{n-1}+z^{n}\right) w+\left(1+2 z+\cdots+n z^{n-1}+n z^{n}\right) b+z^{n} a . +$$ + +With $w=0$ we get + +$$ +a \leq\left(1+2 z+\cdots+n z^{n-1}+n z^{n}\right) b+a z^{n} . +$$ + +In view of the assumption $b<0$ we find some $n$ such that + +$$ +a>(n b+a) z^{n} +$$ + +because the right hand side tends to $-\infty$ as $n \rightarrow \infty$. Now (12) and (13) give the desired contradiction and (9) is established. In addition, we have for $z=1$ the strict inequality + +$$ +f(1)>0 \text {. } +$$ + +Indeed, assume that $f(1)=0$. Then setting $w=-1$ and $z=1$ in (11) leads to + +$$ +f(-1) \leq-(n+1)+a +$$ + +which is false if $n$ is sufficiently large. +To complete the proof we set $t=\min \{-a,-2 / f(1)\}$. Setting $x=1$ and $y=t$ in (7) gives + +$$ +f(1-f(t)) \leq t f(1)+1 \leq-2+1=-1 . +$$ + +On the other hand, by (8) and the choice of $t$ we have $f(t) \leq t+a \leq 0$ and hence $1-f(t) \geq 1$. The inequality (9) yields + +$$ +f(1-f(t)) \geq 0 +$$ + +which contradicts (15). + +## A6 USA (United States of America) + +Suppose that $s_{1}, s_{2}, s_{3}, \ldots$ is a strictly increasing sequence of positive integers such that the subsequences + +$$ +s_{s_{1}}, s_{s_{2}}, s_{s_{3}}, \ldots \quad \text { and } \quad s_{s_{1}+1}, s_{s_{2}+1}, s_{s_{3}+1}, \ldots +$$ + +are both arithmetic progressions. Prove that $s_{1}, s_{2}, s_{3}, \ldots$ is itself an arithmetic progression. + +Solution 1. Let $D$ be the common difference of the progression $s_{s_{1}}, s_{s_{2}}, \ldots$. Let for $n=$ 1, 2, ... + +$$ +d_{n}=s_{n+1}-s_{n} +$$ + +We have to prove that $d_{n}$ is constant. First we show that the numbers $d_{n}$ are bounded. Indeed, by supposition $d_{n} \geq 1$ for all $n$. Thus, we have for all $n$ + +$$ +d_{n}=s_{n+1}-s_{n} \leq d_{s_{n}}+d_{s_{n}+1}+\cdots+d_{s_{n+1}-1}=s_{s_{n+1}}-s_{s_{n}}=D . +$$ + +The boundedness implies that there exist + +$$ +m=\min \left\{d_{n}: n=1,2, \ldots\right\} \quad \text { and } \quad M=\max \left\{d_{n}: n=1,2, \ldots\right\} +$$ + +It suffices to show that $m=M$. Assume that $m n$ if $d_{n}=n$, because in the case $s_{n}=n$ we would have $m=d_{n}=d_{s_{n}}=M$ in contradiction to the assumption $m n$. Consequently, there is a strictly increasing sequence $n_{1}, n_{2}, \ldots$ such that + +$$ +d_{s_{n_{1}}}=M, \quad d_{s_{n_{2}}}=m, \quad d_{s_{n_{3}}}=M, \quad d_{s_{n_{4}}}=m, \quad \ldots +$$ + +The sequence $d_{s_{1}}, d_{s_{2}}, \ldots$ is the sequence of pairwise differences of $s_{s_{1}+1}, s_{s_{2}+1}, \ldots$ and $s_{s_{1}}, s_{s_{2}}, \ldots$, hence also an arithmetic progression. Thus $m=M$. + +Solution 2. Let the integers $D$ and $E$ be the common differences of the progressions $s_{s_{1}}, s_{s_{2}}, \ldots$ and $s_{s_{1}+1}, s_{s_{2}+1}, \ldots$, respectively. Let briefly $A=s_{s_{1}}-D$ and $B=s_{s_{1}+1}-E$. Then, for all positive integers $n$, + +$$ +s_{s_{n}}=A+n D, \quad s_{s_{n}+1}=B+n E +$$ + +Since the sequence $s_{1}, s_{2}, \ldots$ is strictly increasing, we have for all positive integers $n$ + +$$ +s_{s_{n}} s_{n}+m$. Then $\left.m(m+1) \leq m\left(s_{n+1}-s_{n}\right) \leq s_{s_{n+1}}-s_{s_{n}}=(A+(n+1) D)-(A+n D)\right)=D=m(B-A)=m^{2}$, a contradiction. Hence $s_{1}, s_{2}, \ldots$ is an arithmetic progression with common difference $m$. + +## A7 JPN (Japan) + +Find all functions $f$ from the set of real numbers into the set of real numbers which satisfy for all real $x, y$ the identity + +$$ +f(x f(x+y))=f(y f(x))+x^{2} +$$ + +Solution 1. It is no hard to see that the two functions given by $f(x)=x$ and $f(x)=-x$ for all real $x$ respectively solve the functional equation. In the sequel, we prove that there are no further solutions. +Let $f$ be a function satisfying the given equation. It is clear that $f$ cannot be a constant. Let us first show that $f(0)=0$. Suppose that $f(0) \neq 0$. For any real $t$, substituting $(x, y)=\left(0, \frac{t}{f(0)}\right)$ into the given functional equation, we obtain + +$$ +f(0)=f(t) +$$ + +contradicting the fact that $f$ is not a constant function. Therefore, $f(0)=0$. Next for any $t$, substituting $(x, y)=(t, 0)$ and $(x, y)=(t,-t)$ into the given equation, we get + +$$ +f(t f(t))=f(0)+t^{2}=t^{2} +$$ + +and + +$$ +f(t f(0))=f(-t f(t))+t^{2} +$$ + +respectively. Therefore, we conclude that + +$$ +f(t f(t))=t^{2}, \quad f(-t f(t))=-t^{2}, \quad \text { for every real } t +$$ + +Consequently, for every real $v$, there exists a real $u$, such that $f(u)=v$. We also see that if $f(t)=0$, then $0=f(t f(t))=t^{2}$ so that $t=0$, and thus 0 is the only real number satisfying $f(t)=0$. +We next show that for any real number $s$, + +$$ +f(-s)=-f(s) +$$ + +This is clear if $f(s)=0$. Suppose now $f(s)<0$, then we can find a number $t$ for which $f(s)=-t^{2}$. As $t \neq 0$ implies $f(t) \neq 0$, we can also find number $a$ such that $a f(t)=s$. Substituting $(x, y)=(t, a)$ into the given equation, we get + +$$ +f(t f(t+a))=f(a f(t))+t^{2}=f(s)+t^{2}=0 +$$ + +and therefore, $t f(t+a)=0$, which implies $t+a=0$, and hence $s=-t f(t)$. Consequently, $f(-s)=f(t f(t))=t^{2}=-\left(-t^{2}\right)=-f(s)$ holds in this case. +Finally, suppose $f(s)>0$ holds. Then there exists a real number $t \neq 0$ for which $f(s)=t^{2}$. Choose a number $a$ such that $t f(a)=s$. Substituting $(x, y)=(t, a-t)$ into the given equation, we get $f(s)=f(t f(a))=f((a-t) f(t))+t^{2}=f((a-t) f(t))+f(s)$. So we have $f((a-t) f(t))=0$, from which we conclude that $(a-t) f(t)=0$. Since $f(t) \neq 0$, we get $a=t$ so that $s=t f(t)$ and thus we see $f(-s)=f(-t f(t))=-t^{2}=-f(s)$ holds in this case also. This observation finishes the proof of (3). +By substituting $(x, y)=(s, t),(x, y)=(t,-s-t)$ and $(x, y)=(-s-t, s)$ into the given equation, +we obtain + +$$ +\begin{array}{r} +f(s f(s+t)))=f(t f(s))+s^{2} \\ +f(t f(-s))=f((-s-t) f(t))+t^{2} +\end{array} +$$ + +and + +$$ +f((-s-t) f(-t))=f(s f(-s-t))+(s+t)^{2} +$$ + +respectively. Using the fact that $f(-x)=-f(x)$ holds for all $x$ to rewrite the second and the third equation, and rearranging the terms, we obtain + +$$ +\begin{aligned} +f(t f(s))-f(s f(s+t)) & =-s^{2} \\ +f(t f(s))-f((s+t) f(t)) & =-t^{2} \\ +f((s+t) f(t))+f(s f(s+t)) & =(s+t)^{2} +\end{aligned} +$$ + +Adding up these three equations now yields $2 f(t f(s))=2 t s$, and therefore, we conclude that $f(t f(s))=t s$ holds for every pair of real numbers $s, t$. By fixing $s$ so that $f(s)=1$, we obtain $f(x)=s x$. In view of the given equation, we see that $s= \pm 1$. It is easy to check that both functions $f(x)=x$ and $f(x)=-x$ satisfy the given functional equation, so these are the desired solutions. + +Solution 2. As in Solution 1 we obtain (1), (2) and (3). +Now we prove that $f$ is injective. For this purpose, let us assume that $f(r)=f(s)$ for some $r \neq s$. Then, by (2) + +$$ +r^{2}=f(r f(r))=f(r f(s))=f((s-r) f(r))+r^{2} +$$ + +where the last statement follows from the given functional equation with $x=r$ and $y=s-r$. Hence, $h=(s-r) f(r)$ satisfies $f(h)=0$ which implies $h^{2}=f(h f(h))=f(0)=0$, i.e., $h=0$. Then, by $s \neq r$ we have $f(r)=0$ which implies $r=0$, and finally $f(s)=f(r)=f(0)=0$. Analogously, it follows that $s=0$ which gives the contradiction $r=s$. +To prove $|f(1)|=1$ we apply (2) with $t=1$ and also with $t=f(1)$ and obtain $f(f(1))=1$ and $(f(1))^{2}=f(f(1) \cdot f(f(1)))=f(f(1))=1$. +Now we choose $\eta \in\{-1,1\}$ with $f(1)=\eta$. Using that $f$ is odd and the given equation with $x=1, y=z$ (second equality) and with $x=-1, y=z+2$ (fourth equality) we obtain + +$$ +\begin{aligned} +& f(z)+2 \eta=\eta(f(z \eta)+2)=\eta(f(f(z+1))+1)=\eta(-f(-f(z+1))+1) \\ +& =-\eta f((z+2) f(-1))=-\eta f((z+2)(-\eta))=\eta f((z+2) \eta)=f(z+2) +\end{aligned} +$$ + +Hence, + +$$ +f(z+2 \eta)=\eta f(\eta z+2)=\eta(f(\eta z)+2 \eta)=f(z)+2 +$$ + +Using this argument twice we obtain + +$$ +f(z+4 \eta)=f(z+2 \eta)+2=f(z)+4 +$$ + +Substituting $z=2 f(x)$ we have + +$$ +f(2 f(x))+4=f(2 f(x)+4 \eta)=f(2 f(x+2)) +$$ + +where the last equality follows from (4). Applying the given functional equation we proceed to + +$$ +f(2 f(x+2))=f(x f(2))+4=f(2 \eta x)+4 +$$ + +where the last equality follows again from (4) with $z=0$, i.e., $f(2)=2 \eta$. Finally, $f(2 f(x))=$ $f(2 \eta x)$ and by injectivity of $f$ we get $2 f(x)=2 \eta x$ and hence the two solutions. + +## Combinatorics + +## C1 NZL (New Zealand) + +Consider 2009 cards, each having one gold side and one black side, lying in parallel on a long table. Initially all cards show their gold sides. Two players, standing by the same long side of the table, play a game with alternating moves. Each move consists of choosing a block of 50 consecutive cards, the leftmost of which is showing gold, and turning them all over, so those which showed gold now show black and vice versa. The last player who can make a legal move wins. +(a) Does the game necessarily end? +(b) Does there exist a winning strategy for the starting player? + +Solution. (a) We interpret a card showing black as the digit 0 and a card showing gold as the digit 1. Thus each position of the 2009 cards, read from left to right, corresponds bijectively to a nonnegative integer written in binary notation of 2009 digits, where leading zeros are allowed. Each move decreases this integer, so the game must end. +(b) We show that there is no winning strategy for the starting player. We label the cards from right to left by $1, \ldots, 2009$ and consider the set $S$ of cards with labels $50 i, i=1,2, \ldots, 40$. Let $g_{n}$ be the number of cards from $S$ showing gold after $n$ moves. Obviously, $g_{0}=40$. Moreover, $\left|g_{n}-g_{n+1}\right|=1$ as long as the play goes on. Thus, after an odd number of moves, the nonstarting player finds a card from $S$ showing gold and hence can make a move. Consequently, this player always wins. + +## C2 ROU (Romania) + +For any integer $n \geq 2$, let $N(n)$ be the maximal number of triples $\left(a_{i}, b_{i}, c_{i}\right), i=1, \ldots, N(n)$, consisting of nonnegative integers $a_{i}, b_{i}$ and $c_{i}$ such that the following two conditions are satisfied: +(1) $a_{i}+b_{i}+c_{i}=n$ for all $i=1, \ldots, N(n)$, +(2) If $i \neq j$, then $a_{i} \neq a_{j}, b_{i} \neq b_{j}$ and $c_{i} \neq c_{j}$. + +Determine $N(n)$ for all $n \geq 2$. + +Comment. The original problem was formulated for $m$-tuples instead for triples. The numbers $N(m, n)$ are then defined similarly to $N(n)$ in the case $m=3$. The numbers $N(3, n)$ and $N(n, n)$ should be determined. The case $m=3$ is the same as in the present problem. The upper bound for $N(n, n)$ can be proved by a simple generalization. The construction of a set of triples attaining the bound can be easily done by induction from $n$ to $n+2$. + +Solution. Let $n \geq 2$ be an integer and let $\left\{T_{1}, \ldots, T_{N}\right\}$ be any set of triples of nonnegative integers satisfying the conditions (1) and (2). Since the $a$-coordinates are pairwise distinct we have + +$$ +\sum_{i=1}^{N} a_{i} \geq \sum_{i=1}^{N}(i-1)=\frac{N(N-1)}{2} +$$ + +Analogously, + +$$ +\sum_{i=1}^{N} b_{i} \geq \frac{N(N-1)}{2} \quad \text { and } \quad \sum_{i=1}^{N} c_{i} \geq \frac{N(N-1)}{2} +$$ + +Summing these three inequalities and applying (1) yields + +$$ +3 \frac{N(N-1)}{2} \leq \sum_{i=1}^{N} a_{i}+\sum_{i=1}^{N} b_{i}+\sum_{i=1}^{N} c_{i}=\sum_{i=1}^{N}\left(a_{i}+b_{i}+c_{i}\right)=n N, +$$ + +hence $3 \frac{N-1}{2} \leq n$ and, consequently, + +$$ +N \leq\left\lfloor\frac{2 n}{3}\right\rfloor+1 +$$ + +By constructing examples, we show that this upper bound can be attained, so $N(n)=\left\lfloor\frac{2 n}{3}\right\rfloor+1$. + +We distinguish the cases $n=3 k-1, n=3 k$ and $n=3 k+1$ for $k \geq 1$ and present the extremal examples in form of a table. + +| $n=3 k-1$ | | | +| :---: | :---: | :---: | +| $\left\lfloor\frac{2 n}{3}\right\rfloor+1=2 k$ | | | +| $a_{i}$ | $b_{i}$ | $c_{i}$ | +| 0 | $k+1$ | $2 k-2$ | +| 1 | $k+2$ | $2 k-4$ | +| $\vdots$ | $\vdots$ | $\vdots$ | +| $k-1$ | $2 k$ | 0 | +| $k$ | 0 | $2 k-1$ | +| $k+1$ | 1 | $2 k-3$ | +| $\vdots$ | $\vdots$ | $\vdots$ | +| $2 k-1$ | $k-1$ | 1 | + + +| $n=3 k$ | | | +| :---: | :---: | :---: | +| $\rfloor+1=2 k+1$ | | | +| $a_{i}$ | $b_{i}$ | $c_{i}$ | +| 0 | $k$ | $2 k$ | +| 1 | $k+1$ | $2 k-2$ | +| $\vdots$ | $\vdots$ | $\vdots$ | +| $k$ | $2 k$ | 0 | +| $k+1$ | 0 | $2 k-1$ | +| $k+2$ | 1 | $2 k-3$ | +| $\vdots$ | $\vdots$ | $\vdots$ | +| $2 k$ | $k-1$ | 1 | + + +| $n=3 k+1$ | | | +| :---: | :---: | :---: | +| $\left\lfloor\left\lfloor\frac{2 n}{3}\right\rfloor+1=2 k+1\right.$ | | | +| $a_{i}$ | $b_{i}$ | $c_{i}$ | +| 0 | $k$ | $2 k+1$ | +| 1 | $k+1$ | $2 k-1$ | +| $\vdots$ | $\vdots$ | $\vdots$ | +| $k$ | $2 k$ | 1 | +| $k+1$ | 0 | $2 k$ | +| $k+2$ | 1 | $2 k-2$ | +| $\vdots$ | $\vdots$ | $\vdots$ | +| $2 k$ | $k-1$ | 2 | + +It can be easily seen that the conditions (1) and (2) are satisfied and that we indeed have $\left\lfloor\frac{2 n}{3}\right\rfloor+1$ triples in each case. + +Comment. A cute combinatorial model is given by an equilateral triangle, partitioned into $n^{2}$ congruent equilateral triangles by $n-1$ equidistant parallels to each of its three sides. Two chess-like bishops placed at any two vertices of the small triangles are said to menace one another if they lie on a same parallel. The problem is to determine the largest number of bishops that can be placed so that none menaces another. A bishop may be assigned three coordinates $a, b, c$, namely the numbers of sides of small triangles they are off each of the sides of the big triangle. It is readily seen that the sum of these coordinates is always $n$, therefore fulfilling the requirements. + +## C3 RUS (Russian Federation) + +Let $n$ be a positive integer. Given a sequence $\varepsilon_{1}, \ldots, \varepsilon_{n-1}$ with $\varepsilon_{i}=0$ or $\varepsilon_{i}=1$ for each $i=1, \ldots, n-1$, the sequences $a_{0}, \ldots, a_{n}$ and $b_{0}, \ldots, b_{n}$ are constructed by the following rules: + +$$ +\begin{gathered} +a_{0}=b_{0}=1, \quad a_{1}=b_{1}=7, \\ +a_{i+1}=\left\{\begin{array}{ll} +2 a_{i-1}+3 a_{i}, & \text { if } \varepsilon_{i}=0, \\ +3 a_{i-1}+a_{i}, & \text { if } \varepsilon_{i}=1, +\end{array} \text { for each } i=1, \ldots, n-1,\right. \\ +b_{i+1}=\left\{\begin{array}{ll} +2 b_{i-1}+3 b_{i}, & \text { if } \varepsilon_{n-i}=0, \\ +3 b_{i-1}+b_{i}, & \text { if } \varepsilon_{n-i}=1, +\end{array} \text { for each } i=1, \ldots, n-1 .\right. +\end{gathered} +$$ + +Prove that $a_{n}=b_{n}$. + +Solution. For a binary word $w=\sigma_{1} \ldots \sigma_{n}$ of length $n$ and a letter $\sigma \in\{0,1\}$ let $w \sigma=$ $\sigma_{1} \ldots \sigma_{n} \sigma$ and $\sigma w=\sigma \sigma_{1} \ldots \sigma_{n}$. Moreover let $\bar{w}=\sigma_{n} \ldots \sigma_{1}$ and let $\emptyset$ be the empty word (of length 0 and with $\bar{\emptyset}=\emptyset$ ). Let $(u, v)$ be a pair of two real numbers. For binary words $w$ we define recursively the numbers $(u, v)^{w}$ as follows: + +$$ +\begin{gathered} +(u, v)^{\emptyset}=v, \quad(u, v)^{0}=2 u+3 v, \quad(u, v)^{1}=3 u+v, \\ +(u, v)^{w \sigma \varepsilon}= \begin{cases}3(u, v)^{w}+3(u, v)^{w \sigma}, & \text { if } \varepsilon=0, \\ +3(u, v)^{w}+(u, v)^{w \sigma}, & \text { if } \varepsilon=1\end{cases} +\end{gathered} +$$ + +It easily follows by induction on the length of $w$ that for all real numbers $u_{1}, v_{1}, u_{2}, v_{2}, \lambda_{1}$ and $\lambda_{2}$ + +$$ +\left(\lambda_{1} u_{1}+\lambda_{2} u_{2}, \lambda_{1} v_{1}+\lambda_{2} v_{2}\right)^{w}=\lambda_{1}\left(u_{1}, v_{1}\right)^{w}+\lambda_{2}\left(u_{2}, v_{2}\right)^{w} +$$ + +and that for $\varepsilon \in\{0,1\}$ + +$$ +(u, v)^{\varepsilon w}=\left(v,(u, v)^{\varepsilon}\right)^{w} . +$$ + +Obviously, for $n \geq 1$ and $w=\varepsilon_{1} \ldots \varepsilon_{n-1}$, we have $a_{n}=(1,7)^{w}$ and $b_{n}=(1,7)^{\bar{w}}$. Thus it is sufficient to prove that + +$$ +(1,7)^{w}=(1,7)^{\bar{w}} +$$ + +for each binary word $w$. We proceed by induction on the length of $w$. The assertion is obvious if $w$ has length 0 or 1 . Now let $w \sigma \varepsilon$ be a binary word of length $n \geq 2$ and suppose that the assertion is true for all binary words of length at most $n-1$. +Note that $(2,1)^{\sigma}=7=(1,7)^{\emptyset}$ for $\sigma \in\{0,1\},(1,7)^{0}=23$, and $(1,7)^{1}=10$. +First let $\varepsilon=0$. Then in view of the induction hypothesis and the equalities (1) and (2), we obtain + +$$ +\begin{aligned} +&(1,7)^{w \sigma 0}=2(1,7)^{w}+3(1,7)^{w \sigma}=2(1,7)^{\bar{w}}+3(1,7)^{\sigma \bar{w}}=2(2,1)^{\sigma \bar{w}}+3(1,7)^{\sigma \bar{w}} \\ +&=(7,23)^{\sigma \bar{w}}=(1,7)^{0 \sigma \bar{w}} +\end{aligned} +$$ + +Now let $\varepsilon=1$. Analogously, we obtain + +$$ +\begin{aligned} +&(1,7)^{w \sigma 1}=3(1,7)^{w}+(1,7)^{w \sigma}=3(1,7)^{\bar{w}}+(1,7)^{\sigma \bar{w}}=3(2,1)^{\sigma \bar{w}}+(1,7)^{\sigma \bar{w}} \\ +&=(7,10)^{\sigma \bar{w}}=(1,7)^{1 \sigma \bar{w}} +\end{aligned} +$$ + +Thus the induction step is complete, (3) and hence also $a_{n}=b_{n}$ are proved. + +Comment. The original solution uses the relation + +$$ +(1,7)^{\alpha \beta w}=\left((1,7)^{w},(1,7)^{\beta w}\right)^{\alpha}, \quad \alpha, \beta \in\{0,1\} +$$ + +which can be proved by induction on the length of $w$. Then (3) also follows by induction on the length of $w$ : + +$$ +(1,7)^{\alpha \beta w}=\left((1,7)^{w},(1,7)^{\beta w}\right)^{\alpha}=\left((1,7)^{\bar{w}},(1,7)^{\bar{w} \beta}\right)^{\alpha}=(1,7)^{\bar{w} \beta \alpha} . +$$ + +Here $w$ may be the empty word. + +## C4 NLD (Netherlands) + +For an integer $m \geq 1$, we consider partitions of a $2^{m} \times 2^{m}$ chessboard into rectangles consisting of cells of the chessboard, in which each of the $2^{m}$ cells along one diagonal forms a separate rectangle of side length 1 . Determine the smallest possible sum of rectangle perimeters in such a partition. + +Solution 1. For a $k \times k$ chessboard, we introduce in a standard way coordinates of the vertices of the cells and assume that the cell $C_{i j}$ in row $i$ and column $j$ has vertices $(i-1, j-1),(i-$ $1, j),(i, j-1),(i, j)$, where $i, j \in\{1, \ldots, k\}$. Without loss of generality assume that the cells $C_{i i}$, $i=1, \ldots, k$, form a separate rectangle. Then we may consider the boards $B_{k}=\bigcup_{1 \leq i 0$, JEnSEN's inequality immediately shows that the minimum of the right hand sight of (1) is attained for $i=k / 2$. Hence the total perimeter of the optimal partition of $B_{k}$ is at least $2 k+2 k / 2 \log _{2} k / 2+2(k / 2) \log _{2}(k / 2)=D_{k}$. + +Solution 2. We start as in Solution 1 and present another proof that $m 2^{m+1}$ is a lower bound for the total perimeter of a partition of $B_{2^{m}}$ into $n$ rectangles. Let briefly $M=2^{m}$. For $1 \leq i \leq M$, let $r_{i}$ denote the number of rectangles in the partition that cover some cell from row $i$ and let $c_{j}$ be the number of rectangles that cover some cell from column $j$. Note that the total perimeter $p$ of all rectangles in the partition is + +$$ +p=2\left(\sum_{i=1}^{M} r_{i}+\sum_{i=1}^{M} c_{i}\right) . +$$ + +No rectangle can simultaneously cover cells from row $i$ and from column $i$ since otherwise it would also cover the cell $C_{i i}$. We classify subsets $S$ of rectangles of the partition as follows. We say that $S$ is of type $i, 1 \leq i \leq M$, if $S$ contains all $r_{i}$ rectangles that cover some cell from row $i$, but none of the $c_{i}$ rectangles that cover some cell from column $i$. Altogether there are $2^{n-r_{i}-c_{i}}$ subsets of type $i$. Now we show that no subset $S$ can be simultaneously of type $i$ and of type $j$ if $i \neq j$. Assume the contrary and let without loss of generality $i 1$. By condition $\left(2^{\prime}\right)$, after the Stepmother has distributed her water we have $y_{0}+y_{1}+y_{2}+y_{3}+y_{4} \leq \frac{5}{2}$. Therefore, + +$$ +\left(y_{0}+y_{2}\right)+\left(y_{1}+y_{3}\right)+\left(y_{2}+y_{4}\right)+\left(y_{3}+y_{0}\right)+\left(y_{4}+y_{1}\right)=2\left(y_{0}+y_{1}+y_{2}+y_{3}+y_{4}\right) \leq 5 +$$ + +and hence there is a pair of non-neighboring buckets which is not critical, say $\left(B_{0}, B_{2}\right)$. Now, if both of the pairs $\left(B_{3}, B_{0}\right)$ and $\left(B_{2}, B_{4}\right)$ are critical, we must have $y_{1}<\frac{1}{2}$ and Cinderella can empty the buckets $B_{3}$ and $B_{4}$. This clearly leaves no critical pair of buckets and the total contents of all the buckets is then $y_{1}+\left(y_{0}+y_{2}\right) \leq \frac{3}{2}$. Therefore, conditions $\left(1^{\prime}\right)$ and $\left(2^{\prime}\right)$ are fulfilled. + +Now suppose that without loss of generality the pair $\left(B_{3}, B_{0}\right)$ is not critical. If in this case $y_{0} \leq \frac{1}{2}$, then one of the inequalities $y_{0}+y_{1}+y_{2} \leq \frac{3}{2}$ and $y_{0}+y_{3}+y_{4} \leq \frac{3}{2}$ must hold. But then Cinderella can empty $B_{3}$ and $B_{4}$ or $B_{1}$ and $B_{2}$, respectively and clearly fulfill the conditions. +Finally consider the case $y_{0}>\frac{1}{2}$. By $y_{0}+y_{1}+y_{2}+y_{3}+y_{4} \leq \frac{5}{2}$, at least one of the pairs $\left(B_{1}, B_{3}\right)$ and $\left(B_{2}, B_{4}\right)$ is not critical. Without loss of generality let this be the pair $\left(B_{1}, B_{3}\right)$. Since the pair $\left(B_{3}, B_{0}\right)$ is not critical and $y_{0}>\frac{1}{2}$, we must have $y_{3} \leq \frac{1}{2}$. But then, as before, Cinderella can maintain the two conditions at the beginning of the next round by either emptying $B_{1}$ and $B_{2}$ or $B_{4}$ and $B_{0}$. + +Comments on GREEDY approaches. A natural approach for Cinderella would be a GREEDY strategy as for example: Always remove as much water as possible from the system. It is straightforward to prove that GREEDY can avoid buckets of capacity $\frac{5}{2}$ from overflowing: If before the Stepmothers move one has $x_{0}+x_{1}+x_{2}+x_{3}+x_{4} \leq \frac{3}{2}$ then after her move the inequality $Y=y_{0}+y_{1}+y_{2}+y_{3}+y_{4} \leq \frac{5}{2}$ holds. If now Cinderella removes the two adjacent buckets with maximum total contents she removes at least $\frac{2 Y}{5}$ and thus the remaining buckets contain at most $\frac{3}{5} \cdot Y \leq \frac{3}{2}$. +But GREEDY is in general not strong enough to settle this problem as can be seen in the following example: + +- In an initial phase, the Stepmother brings all the buckets (after her move) to contents of at least $\frac{1}{2}-2 \epsilon$, where $\epsilon$ is an arbitrary small positive number. This can be done by always splitting the 1 liter she has to distribute so that all buckets have the same contents. After her $r$-th move the total contents of each of the buckets is then $c_{r}$ with $c_{1}=1$ and $c_{r+1}=1+\frac{3}{5} \cdot c_{r}$ and hence $c_{r}=\frac{5}{2}-\frac{3}{2} \cdot\left(\frac{3}{5}\right)^{r-1}$. So the contents of each single bucket indeed approaches $\frac{1}{2}$ (from below). In particular, any two adjacent buckets have total contents strictly less than 1 which enables the Stepmother to always refill the buckets that Cinderella just emptied and then distribute the remaining water evenly over all buckets. +- After that phase GREEDY faces a situation like this ( $\left.\frac{1}{2}-2 \epsilon, \frac{1}{2}-2 \epsilon, \frac{1}{2}-2 \epsilon, \frac{1}{2}-2 \epsilon, \frac{1}{2}-2 \epsilon\right)$ and leaves a situation of the form $\left(x_{0}, x_{1}, x_{2}, x_{3}, x_{4}\right)=\left(\frac{1}{2}-2 \epsilon, \frac{1}{2}-2 \epsilon, \frac{1}{2}-2 \epsilon, 0,0\right)$. +- Then the Stepmother can add the amounts $\left(0, \frac{1}{4}+\epsilon, \epsilon, \frac{3}{4}-2 \epsilon, 0\right)$ to achieve a situation like this: $\left(y_{0}, y_{1}, y_{2}, y_{3}, y_{4}\right)=\left(\frac{1}{2}-2 \epsilon, \frac{3}{4}-\epsilon, \frac{1}{2}-\epsilon, \frac{3}{4}-2 \epsilon, 0\right)$. +- Now $B_{1}$ and $B_{2}$ are the adjacent buckets with the maximum total contents and thus GREEDY empties them to yield $\left(x_{0}, x_{1}, x_{2}, x_{3}, x_{4}\right)=\left(\frac{1}{2}-2 \epsilon, 0,0, \frac{3}{4}-2 \epsilon, 0\right)$. +- Then the Stepmother adds $\left(\frac{5}{8}, 0,0, \frac{3}{8}, 0\right)$, which yields $\left(\frac{9}{8}-2 \epsilon, 0,0, \frac{9}{8}-2 \epsilon, 0\right)$. +- Now GREEDY can only empty one of the two nonempty buckets and in the next step the Stepmother adds her liter to the other bucket and brings it to $\frac{17}{8}-2 \epsilon$, i.e. an overflow. + +A harder variant. Five identical empty buckets of capacity $b$ stand at the vertices of a regular pentagon. Cinderella and her wicked Stepmother go through a sequence of rounds: At the beginning of every round, the Stepmother takes one liter of water from the nearby river and distributes it arbitrarily over the five buckets. Then Cinderella chooses a pair of neighboring buckets, empties them into the river, and puts them back. Then the next round begins. The Stepmother's goal is to make one of these buckets overflow. Cinderella's goal is to prevent this. Determine all bucket capacities $b$ for which the Stepmother can enforce a bucket to overflow. + +Solution to the harder variant. The answer is $b<2$. +The previous proof shows that for all $b \geq 2$ the Stepmother cannot enforce overflowing. Now if $b<2$, let $R$ be a positive integer such that $b<2-2^{1-R}$. In the first $R$ rounds the Stepmother now ensures that at least one of the (nonadjacent) buckets $B_{1}$ and $B_{3}$ have contents of at least $1-2^{1-r}$ at the beginning of round $r(r=1,2, \ldots, R)$. This is trivial for $r=1$ and if it holds at the beginning of round $r$, she can fill the bucket which contains at least $1-2^{1-r}$ liters with another $2^{-r}$ liters and put the rest of her water $-1-2^{-r}$ liters - in the other bucket. As Cinderella now can remove the water of at most one of the two buckets, the other bucket carries its contents into the next round. +At the beginning of the $R$-th round there are $1-2^{1-R}$ liters in $B_{1}$ or $B_{3}$. The Stepmother puts the entire liter into that bucket and produces an overflow since $b<2-2^{1-R}$. + +## C6 BGR (Bulgaria) + +On a $999 \times 999$ board a limp rook can move in the following way: From any square it can move to any of its adjacent squares, i.e. a square having a common side with it, and every move must be a turn, i.e. the directions of any two consecutive moves must be perpendicular. A nonintersecting route of the limp rook consists of a sequence of pairwise different squares that the limp rook can visit in that order by an admissible sequence of moves. Such a non-intersecting route is called cyclic, if the limp rook can, after reaching the last square of the route, move directly to the first square of the route and start over. +How many squares does the longest possible cyclic, non-intersecting route of a limp rook visit? + +Solution. The answer is $998^{2}-4=4 \cdot\left(499^{2}-1\right)$ squares. +First we show that this number is an upper bound for the number of cells a limp rook can visit. To do this we color the cells with four colors $A, B, C$ and $D$ in the following way: for $(i, j) \equiv(0,0) \bmod 2$ use $A$, for $(i, j) \equiv(0,1) \bmod 2$ use $B$, for $(i, j) \equiv(1,0) \bmod 2$ use $C$ and for $(i, j) \equiv(1,1) \bmod 2$ use $D$. From an $A$-cell the rook has to move to a $B$-cell or a $C$-cell. In the first case, the order of the colors of the cells visited is given by $A, B, D, C, A, B, D, C, A, \ldots$, in the second case it is $A, C, D, B, A, C, D, B, A, \ldots$ Since the route is closed it must contain the same number of cells of each color. There are only $499^{2} A$-cells. In the following we will show that the rook cannot visit all the $A$-cells on its route and hence the maximum possible number of cells in a route is $4 \cdot\left(499^{2}-1\right)$. +Assume that the route passes through every single $A$-cell. Color the $A$-cells in black and white in a chessboard manner, i.e. color any two $A$-cells at distance 2 in different color. Since the number of $A$-cells is odd the rook cannot always alternate between visiting black and white $A$-cells along its route. Hence there are two $A$-cells of the same color which are four rook-steps apart that are visited directly one after the other. Let these two $A$-cells have row and column numbers $(a, b)$ and $(a+2, b+2)$ respectively. + + +There is up to reflection only one way the rook can take from $(a, b)$ to $(a+2, b+2)$. Let this way be $(a, b) \rightarrow(a, b+1) \rightarrow(a+1, b+1) \rightarrow(a+1, b+2) \rightarrow(a+2, b+2)$. Also let without loss of generality the color of the cell $(a, b+1)$ be $B$ (otherwise change the roles of columns and rows). +Now consider the $A$-cell $(a, b+2)$. The only way the rook can pass through it is via $(a-1, b+2) \rightarrow$ $(a, b+2) \rightarrow(a, b+3)$ in this order, since according to our assumption after every $A$-cell the rook passes through a $B$-cell. Hence, to connect these two parts of the path, there must be +a path connecting the cell $(a, b+3)$ and $(a, b)$ and also a path connecting $(a+2, b+2)$ and $(a-1, b+2)$. + +But these four cells are opposite vertices of a convex quadrilateral and the paths are outside of that quadrilateral and hence they must intersect. This is due to the following fact: +The path from $(a, b)$ to $(a, b+3)$ together with the line segment joining these two cells form a closed loop that has one of the cells $(a-1, b+2)$ and $(a+2, b+2)$ in its inside and the other one on the outside. Thus the path between these two points must cross the previous path. +But an intersection is only possible if a cell is visited twice. This is a contradiction. +Hence the number of cells visited is at most $4 \cdot\left(499^{2}-1\right)$. +The following picture indicates a recursive construction for all $n \times n$-chessboards with $n \equiv 3$ $\bmod 4$ which clearly yields a path that misses exactly one $A$-cell (marked with a dot, the center cell of the $15 \times 15$-chessboard) and hence, in the case of $n=999$ crosses exactly $4 \cdot\left(499^{2}-1\right)$ cells. + + +## C7 RUS (Russian Federation) + +Variant 1. A grasshopper jumps along the real axis. He starts at point 0 and makes 2009 jumps to the right with lengths $1,2, \ldots, 2009$ in an arbitrary order. Let $M$ be a set of 2008 positive integers less than $1005 \cdot 2009$. Prove that the grasshopper can arrange his jumps in such a way that he never lands on a point from $M$. + +Variant 2. Let $n$ be a nonnegative integer. A grasshopper jumps along the real axis. He starts at point 0 and makes $n+1$ jumps to the right with pairwise different positive integral lengths $a_{1}, a_{2}, \ldots, a_{n+1}$ in an arbitrary order. Let $M$ be a set of $n$ positive integers in the interval $(0, s)$, where $s=a_{1}+a_{2}+\cdots+a_{n+1}$. Prove that the grasshopper can arrange his jumps in such a way that he never lands on a point from $M$. + +Solution of Variant 1. We construct the set of landing points of the grasshopper. +Case 1. $M$ does not contain numbers divisible by 2009. +We fix the numbers $2009 k$ as landing points, $k=1,2, \ldots, 1005$. Consider the open intervals $I_{k}=(2009(k-1), 2009 k), k=1,2, \ldots, 1005$. We show that we can choose exactly one point outside of $M$ as a landing point in 1004 of these intervals such that all lengths from 1 to 2009 are realized. Since there remains one interval without a chosen point, the length 2009 indeed will appear. Each interval has length 2009, hence a new landing point in an interval yields with a length $d$ also the length $2009-d$. Thus it is enough to implement only the lengths from $D=\{1,2, \ldots, 1004\}$. We will do this in a greedy way. Let $n_{k}, k=1,2, \ldots, 1005$, be the number of elements of $M$ that belong to the interval $I_{k}$. We order these numbers in a decreasing way, so let $p_{1}, p_{2}, \ldots, p_{1005}$ be a permutation of $\{1,2, \ldots, 1005\}$ such that $n_{p_{1}} \geq n_{p_{2}} \geq \cdots \geq n_{p_{1005}}$. In $I_{p_{1}}$ we do not choose a landing point. Assume that landing points have already been chosen in the intervals $I_{p_{2}}, \ldots, I_{p_{m}}$ and the lengths $d_{2}, \ldots, d_{m}$ from $D$ are realized, $m=1, \ldots, 1004$. We show that there is some $d \in D \backslash\left\{d_{2}, \ldots, d_{m}\right\}$ that can be implemented with a new landing point in $I_{p_{m+1}}$. Assume the contrary. Then the $1004-(m-1)$ other lengths are obstructed by the $n_{p_{m+1}}$ points of $M$ in $I_{p_{m+1}}$. Each length $d$ can be realized by two landing points, namely $2009\left(p_{m+1}-1\right)+d$ and $2009 p_{m+1}-d$, hence + +$$ +n_{p_{m+1}} \geq 2(1005-m) +$$ + +Moreover, since $|M|=2008=n_{1}+\cdots+n_{1005}$, + +$$ +2008 \geq n_{p_{1}}+n_{p_{2}}+\cdots+n_{p_{m+1}} \geq(m+1) n_{p_{m+1}} +$$ + +Consequently, by (1) and (2), + +$$ +2008 \geq 2(m+1)(1005-m) +$$ + +The right hand side of the last inequality obviously attains its minimum for $m=1004$ and this minimum value is greater than 2008, a contradiction. +Case 2. $M$ does contain a number $\mu$ divisible by 2009. +By the pigeonhole principle there exists some $r \in\{1, \ldots, 2008\}$ such that $M$ does not contain numbers with remainder $r$ modulo 2009. We fix the numbers $2009(k-1)+r$ as landing points, $k=1,2, \ldots, 1005$. Moreover, $1005 \cdot 2009$ is a landing point. Consider the open intervals +$I_{k}=(2009(k-1)+r, 2009 k+r), k=1,2, \ldots, 1004$. Analogously to Case 1 , it is enough to show that we can choose in 1003 of these intervals exactly one landing point outside of $M \backslash\{\mu\}$ such that each of the lengths of $D=\{1,2, \ldots, 1004\} \backslash\{r\}$ are implemented. Note that $r$ and $2009-r$ are realized by the first and last jump and that choosing $\mu$ would realize these two differences again. Let $n_{k}, k=1,2, \ldots, 1004$, be the number of elements of $M \backslash\{\mu\}$ that belong to the interval $I_{k}$ and $p_{1}, p_{2}, \ldots, p_{1004}$ be a permutation of $\{1,2, \ldots, 1004\}$ such that $n_{p_{1}} \geq n_{p_{2}} \geq \cdots \geq n_{p_{1004}}$. With the same reasoning as in Case 1 we can verify that a greedy choice of the landing points in $I_{p_{2}}, I_{p_{3}}, \ldots, I_{p_{1004}}$ is possible. We only have to replace (1) by + +$$ +n_{p_{m+1}} \geq 2(1004-m) +$$ + +( $D$ has one element less) and (2) by + +$$ +2007 \geq n_{p_{1}}+n_{p_{2}}+\cdots+n_{p_{m+1}} \geq(m+1) n_{p_{m+1}} +$$ + +Comment. The cardinality 2008 of $M$ in the problem is the maximum possible value. For $M=\{1,2, \ldots, 2009\}$, the grasshopper necessarily lands on a point from $M$. + +Solution of Variant 2. First of all we remark that the statement in the problem implies a strengthening of itself: Instead of $|M|=n$ it is sufficient to suppose that $|M \cap(0, s-\bar{a}]| \leq n$, where $\bar{a}=\min \left\{a_{1}, a_{2}, \ldots, a_{n+1}\right\}$. This fact will be used in the proof. +We prove the statement by induction on $n$. The case $n=0$ is obvious. Let $n>0$ and let the assertion be true for all nonnegative integers less than $n$. Moreover let $a_{1}, a_{2}, \ldots, a_{n+1}, s$ and $M$ be given as in the problem. Without loss of generality we may assume that $a_{n+1} 1$. If $T_{\bar{k}-1} \in M$, then (4.) follows immediately by the minimality of $\bar{k}$. If $T_{\bar{k}-1} \notin M$, by the smoothness of $\bar{k}-1$, we obtain a situation as in Claim 1 with $m=\bar{k}-1$ provided that $\mid M \cap\left(0, T_{\bar{k}-1}| | \geq \bar{k}-1\right.$. Hence, we may even restrict ourselves to $\mid M \cap\left(0, T_{\bar{k}-1} \mid \leq \bar{k}-2\right.$ in this case and Claim 3 is proved. +Choose an integer $v \geq 0$ with $\left|M \cap\left(0, T_{\bar{k}}\right)\right|=\bar{k}+v$. Let $r_{1}>r_{2}>\cdots>r_{l}$ be exactly those indices $r$ from $\{\bar{k}+1, \bar{k}+2, \ldots, n+1\}$ for which $T_{\bar{k}}+a_{r} \notin M$. Then + +$$ +n=|M|=\left|M \cap\left(0, T_{\bar{k}}\right)\right|+1+\left|M \cap\left(T_{\bar{k}}, s\right)\right| \geq \bar{k}+v+1+(n+1-\bar{k}-l) +$$ + +and consequently $l \geq v+2$. Note that +$T_{\bar{k}}+a_{r_{1}}-a_{1} f_{i}(\varepsilon)$ for all $i=0, \ldots, k$. +We will show the essential fact: +Fact 3. $f_{0}(n)>f_{0}(h(n))$. +Then the empty string will necessarily be reached after a finite number of applications of $h$. But starting from a string without leading zeros, $\varepsilon$ can only be reached via the strings $1 \rightarrow 00 \rightarrow 0 \rightarrow \varepsilon$. Hence also the number 1 will appear after a finite number of applications of $h$. +Proof of Fact 3. If the last digit $r$ of $n$ is 0 , then we write $n=x_{0} 0 \ldots 0 x_{m-1} 0 \varepsilon$ where the $x_{i}$ do not contain the digit 0 . Then $h(n)=x_{0} 0 \ldots 0 x_{m-1}$ and $f_{0}(n)-f_{0}(h(n))=f_{0}(\varepsilon)>0$. +So let the last digit $r$ of $n$ be at least 1 . Let $L=y k$ and $R=z r$ be the corresponding left and right parts where $y$ is some string, $k \leq r-1$ and the string $z$ consists only of digits not less +than $r$. Then $n=y k z r$ and $h(n)=y k z(r-1) z(r-1)$. Let $d(y)$ be the smallest digit of $y$. We consider two cases which do not exclude each other. + +Case 1. $d(y) \geq k$. +Then + +$$ +f_{k}(n)-f_{k}(h(n))=f_{k}(z r)-f_{k}(z(r-1) z(r-1)) . +$$ + +In view of Fact 1 this difference is positive if and only if + +$$ +f_{r-1}(z r)-f_{r-1}(z(r-1) z(r-1))>0 +$$ + +We have, using Fact 2, + +$$ +f_{r-1}(z r)=4^{f_{r}(z r)}=4^{f_{r}(z)+4^{f_{r+1}(z)}} \geq 4 \cdot 4^{f_{r}(z)}>4^{f_{r}(z)}+4^{f_{r}(z)}+4^{f_{r}(z)}=f_{r-1}(z(r-1) z(r-1)) . +$$ + +Here we use the additional definition $f_{10}(\varepsilon)=0$ if $r=9$. Consequently, $f_{k}(n)-f_{k}(h(n))>0$ and according to Fact $1, f_{0}(n)-f_{0}(h(n))>0$. +Case 2. $d(y) \leq k$. +We prove by induction on $d(y)=k, k-1, \ldots, 0$ that $f_{i}(n)-f_{i}(h(n))>0$ for all $i=0, \ldots, d(y)$. By Fact 1, it suffices to do so for $i=d(y)$. The initialization $d(y)=k$ was already treated in Case 1. Let $t=d(y) 0 +$$ + +Thus the inequality $f_{d(y)}(n)-f_{d(y)}(h(n))>0$ is established and from Fact 1 it follows that $f_{0}(n)-f_{0}(h(n))>0$. + +Solution 2. We identify integers $n \geq 2$ with the digit-strings, briefly strings, of their decimal representation and extend the definition of $h$ to all non-empty strings with digits from 0 to 9. Moreover, let us define that the empty string, $\varepsilon$, is being mapped to the empty string. In the following all functions map the set of strings into the set of strings. For two functions $f$ and $g$ let $g \circ f$ be defined by $(g \circ f)(x)=g(f(x))$ for all strings $x$ and let, for non-negative integers $n$, $f^{n}$ denote the $n$-fold application of $f$. For any string $x$ let $s(x)$ be the smallest digit of $x$, and for the empty string let $s(\varepsilon)=\infty$. We define nine functions $g_{1}, \ldots, g_{9}$ as follows: Let $k \in\{1, \ldots, 9\}$ and let $x$ be a string. If $x=\varepsilon$ then $g_{k}(x)=\varepsilon$. Otherwise, write $x$ in the form $x=y z r$ where $y$ is either the empty string or ends with a digit smaller than $k, s(z) \geq k$ and $r$ is the rightmost digit of $x$. Then $g_{k}(x)=z r$. + +Lemma 1. We have $g_{k} \circ h=g_{k} \circ h \circ g_{k}$ for all $k=1, \ldots, 9$. +Proof of Lemma 1. Let $x=y z r$ be as in the definition of $g_{k}$. If $y=\varepsilon$, then $g_{k}(x)=x$, whence + +$$ +g_{k}(h(x))=g_{k}\left(h\left(g_{k}(x)\right) .\right. +$$ + +So let $y \neq \varepsilon$. +Case 1. $z$ contains a digit smaller than $r$. +Let $z=u a v$ where $a 0\end{cases} +$$ + +and + +$$ +h\left(g_{k}(x)\right)=h(z r)=h(\text { uavr })= \begin{cases}\operatorname{uav} & \text { if } r=0 \\ \operatorname{uav}(r-1) v(r-1) & \text { if } r>0\end{cases} +$$ + +Since $y$ ends with a digit smaller than $k$, (1) is obviously true. +Case 2. $z$ does not contain a digit smaller than $r$. +Let $y=u v$ where $u$ is either the empty string or ends with a digit smaller than $r$ and $s(v) \geq r$. We have + +$$ +h(x)= \begin{cases}u v z & \text { if } r=0 \\ u v z(r-1) v z(r-1) & \text { if } r>0\end{cases} +$$ + +and + +$$ +h\left(g_{k}(x)\right)=h(z r)= \begin{cases}z & \text { if } r=0 \\ z(r-1) z(r-1) & \text { if } r>0\end{cases} +$$ + +Recall that $y$ and hence $v$ ends with a digit smaller than $k$, but all digits of $v$ are at least $r$. Now if $r>k$, then $v=\varepsilon$, whence the terminal digit of $u$ is smaller than $k$, which entails + +$$ +g_{k}(h(x))=z(r-1) z(r-1)=g_{k}\left(h\left(g_{k}(x)\right)\right) . +$$ + +If $r \leq k$, then + +$$ +g_{k}(h(x))=z(r-1)=g_{k}\left(h\left(g_{k}(x)\right)\right), +$$ + +so that in both cases (1) is true. Thus Lemma 1 is proved. +Lemma 2. Let $k \in\{1, \ldots, 9\}$, let $x$ be a non-empty string and let $n$ be a positive integer. If $h^{n}(x)=\varepsilon$ then $\left(g_{k} \circ h\right)^{n}(x)=\varepsilon$. +Proof of Lemma 2. We proceed by induction on $n$. If $n=1$ we have + +$$ +\varepsilon=h(x)=g_{k}(h(x))=\left(g_{k} \circ h\right)(x) . +$$ + +Now consider the step from $n-1$ to $n$ where $n \geq 2$. Let $h^{n}(x)=\varepsilon$ and let $y=h(x)$. Then $h^{n-1}(y)=\varepsilon$ and by the induction hypothesis $\left(g_{k} \circ h\right)^{n-1}(y)=\varepsilon$. In view of Lemma 1 , + +$$ +\begin{aligned} +& \varepsilon=\left(g_{k} \circ h\right)^{n-2}\left(\left(g_{k} \circ h\right)(y)\right)=\left(g_{k} \circ h\right)^{n-2}\left(g_{k}(h(y))\right. \\ +&=\left(g_{k} \circ h\right)^{n-2}\left(g_{k}\left(h\left(g_{k}(y)\right)\right)=\left(g_{k} \circ h\right)^{n-2}\left(g_{k}\left(h\left(g_{k}(h(x))\right)\right)=\left(g_{k} \circ h\right)^{n}(x)\right.\right. +\end{aligned} +$$ + +Thus the induction step is complete and Lemma 2 is proved. +We say that the non-empty string $x$ terminates if $h^{n}(x)=\varepsilon$ for some non-negative integer $n$. +Lemma 3. Let $x=y z r$ where $s(y) \geq k, s(z) \geq k, y$ ends with the digit $k$ and $z$ is possibly empty. If $y$ and $z r$ terminate then also $x$ terminates. +Proof of Lemma 3. Suppose that $y$ and $z r$ terminate. We proceed by induction on $k$. Let $k=0$. Obviously, $h(y w)=y h(w)$ for any non-empty string $w$. Let $h^{n}(z r)=\epsilon$. It follows easily by induction on $m$ that $h^{m}(y z r)=y h^{m}(z r)$ for $m=1, \ldots, n$. Consequently, $h^{n}(y z r)=y$. Since $y$ terminates, also $x=y z r$ terminates. +Now let the assertion be true for all nonnegative integers less than $k$ and let us prove it for $k$ where $k \geq 1$. It turns out that it is sufficient to prove that $y g_{k}(h(z r))$ terminates. Indeed: +Case 1. $r=0$. +Then $h(y z r)=y z=y g_{k}(h(z r))$. +Case 2. $0 k$. +Then $h(y z r)=y h(z r)=y g_{k}(h(z r))$. +Note that $y g_{k}(h(z r))$ has the form $y z^{\prime} r^{\prime}$ where $s\left(z^{\prime}\right) \geq k$. By the same arguments it is sufficient to prove that $y g_{k}\left(h\left(z^{\prime} r^{\prime}\right)\right)=y\left(g_{k} \circ h\right)^{2}(z r)$ terminates and, by induction, that $y\left(g_{k} \circ h\right)^{m}(z r)$ terminates for some positive integer $m$. In view of Lemma 2 there is some $m$ such that $\left(g_{k} \circ\right.$ $h)^{m}(z r)=\epsilon$, so $x=y z r$ terminates if $y$ terminates. Thus Lemma 3 is proved. +Now assume that there is some string $x$ that does not terminate. We choose $x$ minimal. If $x \geq 10$, we can write $x$ in the form $x=y z r$ of Lemma 3 and by this lemma $x$ terminates since $y$ and $z r$ are smaller than $x$. If $x \leq 9$, then $h(x)=(x-1)(x-1)$ and $h(x)$ terminates again by Lemma 3 and the minimal choice of $x$. + +Solution 3. We commence by introducing some terminology. Instead of integers, we will consider the set $S$ of all strings consisting of the digits $0,1, \ldots, 9$, including the empty string $\epsilon$. If $\left(a_{1}, a_{2}, \ldots, a_{n}\right)$ is a nonempty string, we let $\rho(a)=a_{n}$ denote the terminal digit of $a$ and $\lambda(a)$ be the string with the last digit removed. We also define $\lambda(\epsilon)=\epsilon$ and denote the set of non-negative integers by $\mathbb{N}_{0}$. +Now let $k \in\{0,1,2, \ldots, 9\}$ denote any digit. We define a function $f_{k}: S \longrightarrow S$ on the set of strings: First, if the terminal digit of $n$ belongs to $\{0,1, \ldots, k\}$, then $f_{k}(n)$ is obtained from $n$ by deleting this terminal digit, i.e $f_{k}(n)=\lambda(n)$. Secondly, if the terminal digit of $n$ belongs to $\{k+1, \ldots, 9\}$, then $f_{k}(n)$ is obtained from $n$ by the process described in the problem. We also define $f_{k}(\epsilon)=\epsilon$. Note that up to the definition for integers $n \leq 1$, the function $f_{0}$ coincides with the function $h$ in the problem, through interpreting integers as digit strings. The argument will be roughly as follows. We begin by introducing a straightforward generalization of our claim about $f_{0}$. Then it will be easy to see that $f_{9}$ has all these stronger properties, which means that is suffices to show for $k \in\{0,1, \ldots, 8\}$ that $f_{k}$ possesses these properties provided that $f_{k+1}$ does. +We continue to use $k$ to denote any digit. The operation $f_{k}$ is said to be separating, if the followings holds: Whenever $a$ is an initial segment of $b$, there is some $N \in \mathbb{N}_{0}$ such that $f_{k}^{N}(b)=a$. The following two notions only apply to the case where $f_{k}$ is indeed separating, otherwise they remain undefined. For every $a \in S$ we denote the least $N \in \mathbb{N}_{0}$ for which $f_{k}^{N}(a)=\epsilon$ occurs by $g_{k}(a)$ (because $\epsilon$ is an initial segment of $a$, such an $N$ exists if $f_{k}$ is separating). If for every two strings $a$ and $b$ such that $a$ is a terminal segment of $b$ one has $g_{k}(a) \leq g_{k}(b)$, we say that $f_{k}$ is coherent. In case that $f_{k}$ is separating and coherent we call the digit $k$ seductive. +As $f_{9}(a)=\lambda(a)$ for all $a$, it is obvious that 9 is seductive. Hence in order to show that 0 is seductive, which clearly implies the statement of the problem, it suffices to take any $k \in\{0,1, \ldots, 8\}$ such that $k+1$ is seductive and to prove that $k$ has to be seductive as well. Note that in doing so, we have the function $g_{k+1}$ at our disposal. We have to establish two things and we begin with + +Step 1. $f_{k}$ is separating. + +Before embarking on the proof of this, we record a useful observation which is easily proved by induction on $M$. + +Claim 1. For any strings $A, B$ and any positive integer $M$ such that $f_{k}^{M-1}(B) \neq \epsilon$, we have + +$$ +f_{k}^{M}(A k B)=A k f_{k}^{M}(B) +$$ + +Now we call a pair $(a, b)$ of strings wicked provided that $a$ is an initial segment of $b$, but there is no $N \in \mathbb{N}_{0}$ such that $f_{k}^{N}(b)=a$. We need to show that there are none, so assume that there were such pairs. Choose a wicked pair $(a, b)$ for which $g_{k+1}(b)$ attains its minimal possible value. Obviously $b \neq \epsilon$ for any wicked pair $(a, b)$. Let $z$ denote the terminal digit of $b$. Observe that $a \neq b$, which means that $a$ is also an initial segment of $\lambda(b)$. To facilitate the construction of the eventual contradiction, we prove +Claim 2. There cannot be an $N \in \mathbb{N}_{0}$ such that + +$$ +f_{k}^{N}(b)=\lambda(b) +$$ + +Proof of Claim 2. For suppose that such an $N$ existed. Because $g_{k+1}(\lambda(b)) k+1$ is impossible: Set $B=f_{k}(b)$. Then also $f_{k+1}(b)=B$, but $g_{k+1}(B) g_{k}(b)$. Observe that if $f_{k}$ was incoherent, which we shall assume from now on, then such pairs existed. Now among all aggressive pairs we choose one, say $(a, b)$, for which $g_{k}(b)$ attains its least possible value. Obviously $f_{k}(a)$ cannot be injectible into $f_{k}(b)$, for otherwise the pair $\left(f_{k}(a), f_{k}(b)\right)$ was aggressive and contradicted our choice of $(a, b)$. Let $\left(A_{1}, A_{2}, \ldots, A_{m}\right)$ and $\left(B_{1}, B_{2}, \ldots, B_{n}\right)$ be the decompositions of $a$ and $b$ and take a function $H:\{1,2, \ldots, m\} \longrightarrow\{1,2, \ldots, n\}$ exemplifying that $a$ is indeed injectible into $b$. If we had $H(m) |O A B|$, which is contradictory to the choice of $A$ and $B$. If it is one of the lines $b, a^{\prime}$ or $b^{\prime}$ almost identical arguments lead to a similar contradiction. +Let $R_{2}$ be the parallelogram $A B A^{\prime} B^{\prime}$. Since $A$ and $B$ are points of $P$, segment $A B \subset P$ and so $R_{2} \subset R_{1}$. Since $A, B, A^{\prime}$ and $B^{\prime}$ are midpoints of the sides of $R_{1}$, an easy argument yields + +$$ +\left|R_{1}\right|=2 \cdot\left|R_{2}\right| +$$ + +Let $R_{3}$ be the smallest parallelogram enclosing $P$ defined by lines parallel to $A B$ and $B A^{\prime}$. Obviously $R_{2} \subset R_{3}$ and every side of $R_{3}$ contains at least one point of the boundary of $P$. Denote by $C$ the intersection point of $a$ and $b$, by $X$ the intersection point of $A B$ and $O C$, and by $X^{\prime}$ the intersection point of $X C$ and the boundary of $R_{3}$. In a similar way denote by $D$ +the intersection point of $b$ and $a^{\prime}$, by $Y$ the intersection point of $A^{\prime} B$ and $O D$, and by $Y^{\prime}$ the intersection point of $Y D$ and the boundary of $R_{3}$. +Note that $O C=2 \cdot O X$ and $O D=2 \cdot O Y$, so there exist real numbers $x$ and $y$ with $1 \leq x, y \leq 2$ and $O X^{\prime}=x \cdot O X$ and $O Y^{\prime}=y \cdot O Y$. Corresponding sides of $R_{3}$ and $R_{2}$ are parallel which yields + +$$ +\left|R_{3}\right|=x y \cdot\left|R_{2}\right| +$$ + +The side of $R_{3}$ containing $X^{\prime}$ contains at least one point $X^{*}$ of $P$; due to the convexity of $P$ we have $A X^{*} B \subset P$. Since this side of the parallelogram $R_{3}$ is parallel to $A B$ we have $\left|A X^{*} B\right|=\left|A X^{\prime} B\right|$, so $\left|O A X^{\prime} B\right|$ does not exceed the area of $P$ confined to the sector defined by the rays $O B$ and $O A$. In a similar way we conclude that $\left|O B^{\prime} Y^{\prime} A^{\prime}\right|$ does not exceed the area of $P$ confined to the sector defined by the rays $O B$ and $O A^{\prime}$. Putting things together we have $\left|O A X^{\prime} B\right|=x \cdot|O A B|,\left|O B D A^{\prime}\right|=y \cdot\left|O B A^{\prime}\right|$. Since $|O A B|=\left|O B A^{\prime}\right|$, we conclude that $|P| \geq 2 \cdot\left|A X^{\prime} B Y^{\prime} A^{\prime}\right|=2 \cdot\left(x \cdot|O A B|+y \cdot\left|O B A^{\prime}\right|\right)=4 \cdot \frac{x+y}{2} \cdot|O A B|=\frac{x+y}{2} \cdot R_{2}$; this is in short + +$$ +\frac{x+y}{2} \cdot\left|R_{2}\right| \leq|P| +$$ + +Since all numbers concerned are positive, we can combine (1)-(3). Using the arithmetic-geometric-mean inequality we obtain + +$$ +\left|R_{1}\right| \cdot\left|R_{3}\right|=2 \cdot\left|R_{2}\right| \cdot x y \cdot\left|R_{2}\right| \leq 2 \cdot\left|R_{2}\right|^{2}\left(\frac{x+y}{2}\right)^{2} \leq 2 \cdot|P|^{2} +$$ + +This implies immediately the desired result $\left|R_{1}\right| \leq \sqrt{2} \cdot|P|$ or $\left|R_{3}\right| \leq \sqrt{2} \cdot|P|$. + +Solution 2. We construct the parallelograms $R_{1}, R_{2}$ and $R_{3}$ in the same way as in Solution 1 and will show that $\frac{\left|R_{1}\right|}{|P|} \leq \sqrt{2}$ or $\frac{\left|R_{3}\right|}{|P|} \leq \sqrt{2}$. + + +Figure 2 +Recall that affine one-to-one maps of the plane preserve the ratio of areas of subsets of the plane. On the other hand, every parallelogram can be transformed with an affine map onto a square. It follows that without loss of generality we may assume that $R_{1}$ is a square (see Figure 2). +Then $R_{2}$, whose vertices are the midpoints of the sides of $R_{1}$, is a square too, and $R_{3}$, whose sides are parallel to the diagonals of $R_{1}$, is a rectangle. +Let $a>0, b \geq 0$ and $c \geq 0$ be the distances introduced in Figure 2. Then $\left|R_{1}\right|=2 a^{2}$ and +$\left|R_{3}\right|=(a+2 b)(a+2 c)$. +Points $A, A^{\prime}, B$ and $B^{\prime}$ are in the convex polygon $P$. Hence the square $A B A^{\prime} B^{\prime}$ is a subset of $P$. Moreover, each of the sides of the rectangle $R_{3}$ contains a point of $P$, otherwise $R_{3}$ would not be minimal. It follows that + +$$ +|P| \geq a^{2}+2 \cdot \frac{a b}{2}+2 \cdot \frac{a c}{2}=a(a+b+c) +$$ + +Now assume that both $\frac{\left|R_{1}\right|}{|P|}>\sqrt{2}$ and $\frac{\left|R_{3}\right|}{|P|}>\sqrt{2}$, then + +$$ +2 a^{2}=\left|R_{1}\right|>\sqrt{2} \cdot|P| \geq \sqrt{2} \cdot a(a+b+c) +$$ + +and + +$$ +(a+2 b)(a+2 c)=\left|R_{3}\right|>\sqrt{2} \cdot|P| \geq \sqrt{2} \cdot a(a+b+c) +$$ + +All numbers concerned are positive, so after multiplying these inequalities we get + +$$ +2 a^{2}(a+2 b)(a+2 c)>2 a^{2}(a+b+c)^{2} +$$ + +But the arithmetic-geometric-mean inequality implies the contradictory result + +$$ +2 a^{2}(a+2 b)(a+2 c) \leq 2 a^{2}\left(\frac{(a+2 b)+(a+2 c)}{2}\right)^{2}=2 a^{2}(a+b+c)^{2} +$$ + +Hence $\frac{\left|R_{1}\right|}{|P|} \leq \sqrt{2}$ or $\frac{\left|R_{3}\right|}{|P|} \leq \sqrt{2}$, as desired. + +## G6 UKR (Ukraine) + +Let the sides $A D$ and $B C$ of the quadrilateral $A B C D$ (such that $A B$ is not parallel to $C D$ ) intersect at point $P$. Points $O_{1}$ and $O_{2}$ are the circumcenters and points $H_{1}$ and $H_{2}$ are the orthocenters of triangles $A B P$ and $D C P$, respectively. Denote the midpoints of segments $O_{1} H_{1}$ and $O_{2} H_{2}$ by $E_{1}$ and $E_{2}$, respectively. Prove that the perpendicular from $E_{1}$ on $C D$, the perpendicular from $E_{2}$ on $A B$ and the line $H_{1} H_{2}$ are concurrent. + +Solution 1. We keep triangle $A B P$ fixed and move the line $C D$ parallel to itself uniformly, i.e. linearly dependent on a single parameter $\lambda$ (see Figure 1). Then the points $C$ and $D$ also move uniformly. Hence, the points $O_{2}, H_{2}$ and $E_{2}$ move uniformly, too. Therefore also the perpendicular from $E_{2}$ on $A B$ moves uniformly. Obviously, the points $O_{1}, H_{1}, E_{1}$ and the perpendicular from $E_{1}$ on $C D$ do not move at all. Hence, the intersection point $S$ of these two perpendiculars moves uniformly. Since $H_{1}$ does not move, while $H_{2}$ and $S$ move uniformly along parallel lines (both are perpendicular to $C D$ ), it is sufficient to prove their collinearity for two different positions of $C D$. + + +Figure 1 +Let $C D$ pass through either point $A$ or point $B$. Note that by hypothesis these two cases are different. We will consider the case $A \in C D$, i.e. $A=D$. So we have to show that the perpendiculars from $E_{1}$ on $A C$ and from $E_{2}$ on $A B$ intersect on the altitude $A H$ of triangle $A B C$ (see Figure 2). + + +Figure 2 + +To this end, we consider the midpoints $A_{1}, B_{1}, C_{1}$ of $B C, C A, A B$, respectively. As $E_{1}$ is the center of Feuerbach's circle (nine-point circle) of $\triangle A B P$, we have $E_{1} C_{1}=E_{1} H$. Similarly, $E_{2} B_{1}=E_{2} H$. Note further that a point $X$ lies on the perpendicular from $E_{1}$ on $A_{1} C_{1}$ if and only if + +$$ +X C_{1}^{2}-X A_{1}^{2}=E_{1} C_{1}^{2}-E_{1} A_{1}^{2} +$$ + +Similarly, the perpendicular from $E_{2}$ on $A_{1} B_{1}$ is characterized by + +$$ +X A_{1}^{2}-X B_{1}^{2}=E_{2} A_{1}^{2}-E_{2} B_{1}^{2} +$$ + +The line $H_{1} H_{2}$, which is perpendicular to $B_{1} C_{1}$ and contains $A$, is given by + +$$ +X B_{1}^{2}-X C_{1}^{2}=A B_{1}^{2}-A C_{1}^{2} +$$ + +The three lines are concurrent if and only if + +$$ +\begin{aligned} +0 & =X C_{1}^{2}-X A_{1}^{2}+X A_{1}^{2}-X B_{1}^{2}+X B_{1}^{2}-X C_{1}^{2} \\ +& =E_{1} C_{1}^{2}-E_{1} A_{1}^{2}+E_{2} A_{1}^{2}-E_{2} B_{1}^{2}+A B_{1}^{2}-A C_{1}^{2} \\ +& =-E_{1} A_{1}^{2}+E_{2} A_{1}^{2}+E_{1} H^{2}-E_{2} H^{2}+A B_{1}^{2}-A C_{1}^{2} +\end{aligned} +$$ + +i.e. it suffices to show that + +$$ +E_{1} A_{1}^{2}-E_{2} A_{1}^{2}-E_{1} H^{2}+E_{2} H^{2}=\frac{A C^{2}-A B^{2}}{4} +$$ + +We have + +$$ +\frac{A C^{2}-A B^{2}}{4}=\frac{H C^{2}-H B^{2}}{4}=\frac{(H C+H B)(H C-H B)}{4}=\frac{H A_{1} \cdot B C}{2} +$$ + +Let $F_{1}, F_{2}$ be the projections of $E_{1}, E_{2}$ on $B C$. Obviously, these are the midpoints of $H P_{1}$, +$H P_{2}$, where $P_{1}, P_{2}$ are the midpoints of $P B$ and $P C$ respectively. Then + +$$ +\begin{aligned} +& E_{1} A_{1}^{2}-E_{2} A_{1}^{2}-E_{1} H^{2}+E_{2} H^{2} \\ +& =F_{1} A_{1}^{2}-F_{1} H^{2}-F_{2} A_{1}^{2}+F_{2} H^{2} \\ +& =\left(F_{1} A_{1}-F_{1} H\right)\left(F_{1} A_{1}+F_{1} H\right)-\left(F_{2} A_{1}-F_{2} H\right)\left(F_{2} A_{1}+F_{2} H\right) \\ +& =A_{1} H \cdot\left(A_{1} P_{1}-A_{1} P_{2}\right) \\ +& =\frac{A_{1} H \cdot B C}{2} \\ +& =\frac{A C^{2}-A B^{2}}{4} +\end{aligned} +$$ + +which proves the claim. + +Solution 2. Let the perpendicular from $E_{1}$ on $C D$ meet $P H_{1}$ at $X$, and the perpendicular from $E_{2}$ on $A B$ meet $P H_{2}$ at $Y$ (see Figure 3). Let $\varphi$ be the intersection angle of $A B$ and $C D$. Denote by $M, N$ the midpoints of $P H_{1}, P H_{2}$ respectively. + + +Figure 3 +We will prove now that triangles $E_{1} X M$ and $E_{2} Y N$ have equal angles at $E_{1}, E_{2}$, and supplementary angles at $X, Y$. +In the following, angles are understood as oriented, and equalities of angles modulo $180^{\circ}$. +Let $\alpha=\angle H_{2} P D, \psi=\angle D P C, \beta=\angle C P H_{1}$. Then $\alpha+\psi+\beta=\varphi, \angle E_{1} X H_{1}=\angle H_{2} Y E_{2}=\varphi$, thus $\angle M X E_{1}+\angle N Y E_{2}=180^{\circ}$. +By considering the Feuerbach circle of $\triangle A B P$ whose center is $E_{1}$ and which goes through $M$, we have $\angle E_{1} M H_{1}=\psi+2 \beta$. Analogous considerations with the Feuerbach circle of $\triangle D C P$ yield $\angle H_{2} N E_{2}=\psi+2 \alpha$. Hence indeed $\angle X E_{1} M=\varphi-(\psi+2 \beta)=(\psi+2 \alpha)-\varphi=\angle Y E_{2} N$. +It follows now that + +$$ +\frac{X M}{M E_{1}}=\frac{Y N}{N E_{2}} +$$ + +Furthermore, $M E_{1}$ is half the circumradius of $\triangle A B P$, while $P H_{1}$ is the distance of $P$ to the orthocenter of that triangle, which is twice the circumradius times the cosine of $\psi$. Together +with analogous reasoning for $\triangle D C P$ we have + +$$ +\frac{M E_{1}}{P H_{1}}=\frac{1}{4 \cos \psi}=\frac{N E_{2}}{P H_{2}} +$$ + +By multiplication, + +$$ +\frac{X M}{P H_{1}}=\frac{Y N}{P H_{2}} +$$ + +and therefore + +$$ +\frac{P X}{X H_{1}}=\frac{H_{2} Y}{Y P} +$$ + +Let $E_{1} X, E_{2} Y$ meet $H_{1} H_{2}$ in $R, S$ respectively. +Applying the intercept theorem to the parallels $E_{1} X, P H_{2}$ and center $H_{1}$ gives + +$$ +\frac{H_{2} R}{R H_{1}}=\frac{P X}{X H_{1}} +$$ + +while with parallels $E_{2} Y, P H_{1}$ and center $H_{2}$ we obtain + +$$ +\frac{H_{2} S}{S H_{1}}=\frac{H_{2} Y}{Y P} +$$ + +Combination of the last three equalities yields that $R$ and $S$ coincide. + +## G7 IRN (Islamic Republic of Iran) + +Let $A B C$ be a triangle with incenter $I$ and let $X, Y$ and $Z$ be the incenters of the triangles $B I C, C I A$ and $A I B$, respectively. Let the triangle $X Y Z$ be equilateral. Prove that $A B C$ is equilateral too. + +Solution. $A Z, A I$ and $A Y$ divide $\angle B A C$ into four equal angles; denote them by $\alpha$. In the same way we have four equal angles $\beta$ at $B$ and four equal angles $\gamma$ at $C$. Obviously $\alpha+\beta+\gamma=\frac{180^{\circ}}{4}=45^{\circ}$; and $0^{\circ}<\alpha, \beta, \gamma<45^{\circ}$. + + +Easy calculations in various triangles yield $\angle B I C=180^{\circ}-2 \beta-2 \gamma=180^{\circ}-\left(90^{\circ}-2 \alpha\right)=$ $90^{\circ}+2 \alpha$, hence (for $X$ is the incenter of triangle $B C I$, so $I X$ bisects $\angle B I C$ ) we have $\angle X I C=$ $\angle B I X=\frac{1}{2} \angle B I C=45^{\circ}+\alpha$ and with similar aguments $\angle C I Y=\angle Y I A=45^{\circ}+\beta$ and $\angle A I Z=\angle Z I B=45^{\circ}+\gamma$. Furthermore, we have $\angle X I Y=\angle X I C+\angle C I Y=\left(45^{\circ}+\alpha\right)+$ $\left(45^{\circ}+\beta\right)=135^{\circ}-\gamma, \angle Y I Z=135^{\circ}-\alpha$, and $\angle Z I X=135^{\circ}-\beta$. +Now we calculate the lengths of $I X, I Y$ and $I Z$ in terms of $\alpha, \beta$ and $\gamma$. The perpendicular from $I$ on $C X$ has length $I X \cdot \sin \angle C X I=I X \cdot \sin \left(90^{\circ}+\beta\right)=I X \cdot \cos \beta$. But $C I$ bisects $\angle Y C X$, so the perpendicular from $I$ on $C Y$ has the same length, and we conclude + +$$ +I X \cdot \cos \beta=I Y \cdot \cos \alpha +$$ + +To make calculations easier we choose a length unit that makes $I X=\cos \alpha$. Then $I Y=\cos \beta$ and with similar arguments $I Z=\cos \gamma$. +Since $X Y Z$ is equilateral we have $Z X=Z Y$. The law of Cosines in triangles $X Y I, Y Z I$ yields + +$$ +\begin{aligned} +& Z X^{2}=Z Y^{2} \\ +\Longrightarrow & I Z^{2}+I X^{2}-2 \cdot I Z \cdot I X \cdot \cos \angle Z I X=I Z^{2}+I Y^{2}-2 \cdot I Z \cdot I Y \cdot \cos \angle Y I Z \\ +\Longrightarrow & I X^{2}-I Y^{2}=2 \cdot I Z \cdot(I X \cdot \cos \angle Z I X-I Y \cdot \cos \angle Y I Z) \\ +\Longrightarrow & \underbrace{\cos ^{2} \alpha-\cos ^{2} \beta}_{\text {L.H.S. }}=\underbrace{2 \cdot \cos \gamma \cdot\left(\cos \alpha \cdot \cos \left(135^{\circ}-\beta\right)-\cos \beta \cdot \cos \left(135^{\circ}-\alpha\right)\right)}_{\text {R.H.S. }} . +\end{aligned} +$$ + +A transformation of the left-hand side (L.H.S.) yields + +$$ +\begin{aligned} +\text { L.H.S. } & =\cos ^{2} \alpha \cdot\left(\sin ^{2} \beta+\cos ^{2} \beta\right)-\cos ^{2} \beta \cdot\left(\sin ^{2} \alpha+\cos ^{2} \alpha\right) \\ +& =\cos ^{2} \alpha \cdot \sin ^{2} \beta-\cos ^{2} \beta \cdot \sin ^{2} \alpha +\end{aligned} +$$ + +$$ +\begin{aligned} +& =(\cos \alpha \cdot \sin \beta+\cos \beta \cdot \sin \alpha) \cdot(\cos \alpha \cdot \sin \beta-\cos \beta \cdot \sin \alpha) \\ +& =\sin (\beta+\alpha) \cdot \sin (\beta-\alpha)=\sin \left(45^{\circ}-\gamma\right) \cdot \sin (\beta-\alpha) +\end{aligned} +$$ + +whereas a transformation of the right-hand side (R.H.S.) leads to + +$$ +\begin{aligned} +\text { R.H.S. } & =2 \cdot \cos \gamma \cdot\left(\cos \alpha \cdot\left(-\cos \left(45^{\circ}+\beta\right)\right)-\cos \beta \cdot\left(-\cos \left(45^{\circ}+\alpha\right)\right)\right) \\ +& =2 \cdot \frac{\sqrt{2}}{2} \cdot \cos \gamma \cdot(\cos \alpha \cdot(\sin \beta-\cos \beta)+\cos \beta \cdot(\cos \alpha-\sin \alpha)) \\ +& =\sqrt{2} \cdot \cos \gamma \cdot(\cos \alpha \cdot \sin \beta-\cos \beta \cdot \sin \alpha) \\ +& =\sqrt{2} \cdot \cos \gamma \cdot \sin (\beta-\alpha) +\end{aligned} +$$ + +Equating L.H.S. and R.H.S. we obtain + +$$ +\begin{aligned} +& \sin \left(45^{\circ}-\gamma\right) \cdot \sin (\beta-\alpha)=\sqrt{2} \cdot \cos \gamma \cdot \sin (\beta-\alpha) \\ +\Longrightarrow & \sin (\beta-\alpha) \cdot\left(\sqrt{2} \cdot \cos \gamma-\sin \left(45^{\circ}-\gamma\right)\right)=0 \\ +\Longrightarrow & \alpha=\beta \quad \text { or } \quad \sqrt{2} \cdot \cos \gamma=\sin \left(45^{\circ}-\gamma\right) . +\end{aligned} +$$ + +But $\gamma<45^{\circ}$; so $\sqrt{2} \cdot \cos \gamma>\cos \gamma>\cos 45^{\circ}=\sin 45^{\circ}>\sin \left(45^{\circ}-\gamma\right)$. This leaves $\alpha=\beta$. With similar reasoning we have $\alpha=\gamma$, which means triangle $A B C$ must be equilateral. + +## G8 BGR (Bulgaria) + +Let $A B C D$ be a circumscribed quadrilateral. Let $g$ be a line through $A$ which meets the segment $B C$ in $M$ and the line $C D$ in $N$. Denote by $I_{1}, I_{2}$, and $I_{3}$ the incenters of $\triangle A B M$, $\triangle M N C$, and $\triangle N D A$, respectively. Show that the orthocenter of $\triangle I_{1} I_{2} I_{3}$ lies on $g$. + +Solution 1. Let $k_{1}, k_{2}$ and $k_{3}$ be the incircles of triangles $A B M, M N C$, and $N D A$, respectively (see Figure 1). We shall show that the tangent $h$ from $C$ to $k_{1}$ which is different from $C B$ is also tangent to $k_{3}$. + + +Figure 1 +To this end, let $X$ denote the point of intersection of $g$ and $h$. Then $A B C X$ and $A B C D$ are circumscribed quadrilaterals, whence + +$$ +C D-C X=(A B+C D)-(A B+C X)=(B C+A D)-(B C+A X)=A D-A X +$$ + +i.e. + +$$ +A X+C D=C X+A D +$$ + +which in turn reveals that the quadrilateral $A X C D$ is also circumscribed. Thus $h$ touches indeed the circle $k_{3}$. +Moreover, we find that $\angle I_{3} C I_{1}=\angle I_{3} C X+\angle X C I_{1}=\frac{1}{2}(\angle D C X+\angle X C B)=\frac{1}{2} \angle D C B=$ $\frac{1}{2}\left(180^{\circ}-\angle M C N\right)=180^{\circ}-\angle M I_{2} N=\angle I_{3} I_{2} I_{1}$, from which we conclude that $C, I_{1}, I_{2}, I_{3}$ are concyclic. +Let now $L_{1}$ and $L_{3}$ be the reflection points of $C$ with respect to the lines $I_{2} I_{3}$ and $I_{1} I_{2}$ respectively. Since $I_{1} I_{2}$ is the angle bisector of $\angle N M C$, it follows that $L_{3}$ lies on $g$. By analogous reasoning, $L_{1}$ lies on $g$. +Let $H$ be the orthocenter of $\triangle I_{1} I_{2} I_{3}$. We have $\angle I_{2} L_{3} I_{1}=\angle I_{1} C I_{2}=\angle I_{1} I_{3} I_{2}=180^{\circ}-\angle I_{1} H I_{2}$, which entails that the quadrilateral $I_{2} H I_{1} L_{3}$ is cyclic. Analogously, $I_{3} H L_{1} I_{2}$ is cyclic. + +Then, working with oriented angles modulo $180^{\circ}$, we have + +$$ +\angle L_{3} H I_{2}=\angle L_{3} I_{1} I_{2}=\angle I_{2} I_{1} C=\angle I_{2} I_{3} C=\angle L_{1} I_{3} I_{2}=\angle L_{1} H I_{2}, +$$ + +whence $L_{1}, L_{3}$, and $H$ are collinear. By $L_{1} \neq L_{3}$, the claim follows. + +Comment. The last part of the argument essentially reproves the following fact: The Simson line of a point $P$ lying on the circumcircle of a triangle $A B C$ with respect to that triangle bisects the line segment connecting $P$ with the orthocenter of $A B C$. + +Solution 2. We start by proving that $C, I_{1}, I_{2}$, and $I_{3}$ are concyclic. + + +Figure 2 +To this end, notice first that $I_{2}, M, I_{1}$ are collinear, as are $N, I_{2}, I_{3}$ (see Figure 2). Denote by $\alpha, \beta, \gamma, \delta$ the internal angles of $A B C D$. By considerations in triangle $C M N$, it follows that $\angle I_{3} I_{2} I_{1}=\frac{\gamma}{2}$. We will show that $\angle I_{3} C I_{1}=\frac{\gamma}{2}$, too. Denote by $I$ the incenter of $A B C D$. Clearly, $I_{1} \in B I, I_{3} \in D I, \angle I_{1} A I_{3}=\frac{\alpha}{2}$. +Using the abbreviation $[X, Y Z]$ for the distance from point $X$ to the line $Y Z$, we have because of $\angle B A I_{1}=\angle I A I_{3}$ and $\angle I_{1} A I=\angle I_{3} A D$ that + +$$ +\frac{\left[I_{1}, A B\right]}{\left[I_{1}, A I\right]}=\frac{\left[I_{3}, A I\right]}{\left[I_{3}, A D\right]} +$$ + +Furthermore, consideration of the angle sums in $A I B, B I C, C I D$ and $D I A$ implies $\angle A I B+$ $\angle C I D=\angle B I C+\angle D I A=180^{\circ}$, from which we see + +$$ +\frac{\left[I_{1}, A I\right]}{\left[I_{3}, C I\right]}=\frac{I_{1} I}{I_{3} I}=\frac{\left[I_{1}, C I\right]}{\left[I_{3}, A I\right]} . +$$ + +Because of $\left[I_{1}, A B\right]=\left[I_{1}, B C\right],\left[I_{3}, A D\right]=\left[I_{3}, C D\right]$, multiplication yields + +$$ +\frac{\left[I_{1}, B C\right]}{\left[I_{3}, C I\right]}=\frac{\left[I_{1}, C I\right]}{\left[I_{3}, C D\right]} . +$$ + +By $\angle D C I=\angle I C B=\gamma / 2$ it follows that $\angle I_{1} C B=\angle I_{3} C I$ which concludes the proof of the +above statement. +Let the perpendicular from $I_{1}$ on $I_{2} I_{3}$ intersect $g$ at $Z$. Then $\angle M I_{1} Z=90^{\circ}-\angle I_{3} I_{2} I_{1}=$ $90^{\circ}-\gamma / 2=\angle M C I_{2}$. Since we have also $\angle Z M I_{1}=\angle I_{2} M C$, triangles $M Z I_{1}$ and $M I_{2} C$ are similar. From this one easily proves that also $M I_{2} Z$ and $M C I_{1}$ are similar. Because $C, I_{1}, I_{2}$, and $I_{3}$ are concyclic, $\angle M Z I_{2}=\angle M I_{1} C=\angle N I_{3} C$, thus $N I_{2} Z$ and $N C I_{3}$ are similar, hence $N C I_{2}$ and $N I_{3} Z$ are similar. We conclude $\angle Z I_{3} I_{2}=\angle I_{2} C N=90^{\circ}-\gamma / 2$, hence $I_{1} I_{2} \perp Z I_{3}$. This completes the proof. + +## Number Theory + +## N1 AUS (Australia) + +A social club has $n$ members. They have the membership numbers $1,2, \ldots, n$, respectively. From time to time members send presents to other members, including items they have already received as presents from other members. In order to avoid the embarrassing situation that a member might receive a present that he or she has sent to other members, the club adds the following rule to its statutes at one of its annual general meetings: +"A member with membership number $a$ is permitted to send a present to a member with membership number $b$ if and only if $a(b-1)$ is a multiple of $n$." +Prove that, if each member follows this rule, none will receive a present from another member that he or she has already sent to other members. + +Alternative formulation: Let $G$ be a directed graph with $n$ vertices $v_{1}, v_{2}, \ldots, v_{n}$, such that there is an edge going from $v_{a}$ to $v_{b}$ if and only if $a$ and $b$ are distinct and $a(b-1)$ is a multiple of $n$. Prove that this graph does not contain a directed cycle. + +Solution 1. Suppose there is an edge from $v_{i}$ to $v_{j}$. Then $i(j-1)=i j-i=k n$ for some integer $k$, which implies $i=i j-k n$. If $\operatorname{gcd}(i, n)=d$ and $\operatorname{gcd}(j, n)=e$, then $e$ divides $i j-k n=i$ and thus $e$ also divides $d$. Hence, if there is an edge from $v_{i}$ to $v_{j}$, then $\operatorname{gcd}(j, n) \mid \operatorname{gcd}(i, n)$. +If there is a cycle in $G$, say $v_{i_{1}} \rightarrow v_{i_{2}} \rightarrow \cdots \rightarrow v_{i_{r}} \rightarrow v_{i_{1}}$, then we have + +$$ +\operatorname{gcd}\left(i_{1}, n\right)\left|\operatorname{gcd}\left(i_{r}, n\right)\right| \operatorname{gcd}\left(i_{r-1}, n\right)|\ldots| \operatorname{gcd}\left(i_{2}, n\right) \mid \operatorname{gcd}\left(i_{1}, n\right) +$$ + +which implies that all these greatest common divisors must be equal, say be equal to $t$. +Now we pick any of the $i_{k}$, without loss of generality let it be $i_{1}$. Then $i_{r}\left(i_{1}-1\right)$ is a multiple of $n$ and hence also (by dividing by $t$ ), $i_{1}-1$ is a multiple of $\frac{n}{t}$. Since $i_{1}$ and $i_{1}-1$ are relatively prime, also $t$ and $\frac{n}{t}$ are relatively prime. So, by the Chinese remainder theorem, the value of $i_{1}$ is uniquely determined modulo $n=t \cdot \frac{n}{t}$ by the value of $t$. But, as $i_{1}$ was chosen arbitrarily among the $i_{k}$, this implies that all the $i_{k}$ have to be equal, a contradiction. + +Solution 2. If $a, b, c$ are integers such that $a b-a$ and $b c-b$ are multiples of $n$, then also $a c-a=a(b c-b)+(a b-a)-(a b-a) c$ is a multiple of $n$. This implies that if there is an edge from $v_{a}$ to $v_{b}$ and an edge from $v_{b}$ to $v_{c}$, then there also must be an edge from $v_{a}$ to $v_{c}$. Therefore, if there are any cycles at all, the smallest cycle must have length 2. But suppose the vertices $v_{a}$ and $v_{b}$ form such a cycle, i. e., $a b-a$ and $a b-b$ are both multiples of $n$. Then $a-b$ is also a multiple of $n$, which can only happen if $a=b$, which is impossible. + +Solution 3. Suppose there was a cycle $v_{i_{1}} \rightarrow v_{i_{2}} \rightarrow \cdots \rightarrow v_{i_{r}} \rightarrow v_{i_{1}}$. Then $i_{1}\left(i_{2}-1\right)$ is a multiple of $n$, i.e., $i_{1} \equiv i_{1} i_{2} \bmod n$. Continuing in this manner, we get $i_{1} \equiv i_{1} i_{2} \equiv$ $i_{1} i_{2} i_{3} \equiv i_{1} i_{2} i_{3} \ldots i_{r} \bmod n$. But the same holds for all $i_{k}$, i. e., $i_{k} \equiv i_{1} i_{2} i_{3} \ldots i_{r} \bmod n$. Hence $i_{1} \equiv i_{2} \equiv \cdots \equiv i_{r} \bmod n$, which means $i_{1}=i_{2}=\cdots=i_{r}$, a contradiction. + +Solution 4. Let $n=k$ be the smallest value of $n$ for which the corresponding graph has a cycle. We show that $k$ is a prime power. +If $k$ is not a prime power, it can be written as a product $k=d e$ of relatively prime integers greater than 1. Reducing all the numbers modulo $d$ yields a single vertex or a cycle in the corresponding graph on $d$ vertices, because if $a(b-1) \equiv 0 \bmod k$ then this equation also holds modulo $d$. But since the graph on $d$ vertices has no cycles, by the minimality of $k$, we must have that all the indices of the cycle are congruent modulo $d$. The same holds modulo $e$ and hence also modulo $k=d e$. But then all the indices are equal, which is a contradiction. +Thus $k$ must be a prime power $k=p^{m}$. There are no edges ending at $v_{k}$, so $v_{k}$ is not contained in any cycle. All edges not starting at $v_{k}$ end at a vertex belonging to a non-multiple of $p$, and all edges starting at a non-multiple of $p$ must end at $v_{1}$. But there is no edge starting at $v_{1}$. Hence there is no cycle. + +Solution 5. Suppose there was a cycle $v_{i_{1}} \rightarrow v_{i_{2}} \rightarrow \cdots \rightarrow v_{i_{r}} \rightarrow v_{i_{1}}$. Let $q=p^{m}$ be a prime power dividing $n$. We claim that either $i_{1} \equiv i_{2} \equiv \cdots \equiv i_{r} \equiv 0 \bmod q$ or $i_{1} \equiv i_{2} \equiv \cdots \equiv i_{r} \equiv$ $1 \bmod q$. +Suppose that there is an $i_{s}$ not divisible by $q$. Then, as $i_{s}\left(i_{s+1}-1\right)$ is a multiple of $q, i_{s+1} \equiv$ $1 \bmod p$. Similarly, we conclude $i_{s+2} \equiv 1 \bmod p$ and so on. So none of the labels is divisible by $p$, but since $i_{s}\left(i_{s+1}-1\right)$ is a multiple of $q=p^{m}$ for all $s$, all $i_{s+1}$ are congruent to 1 modulo $q$. This proves the claim. +Now, as all the labels are congruent modulo all the prime powers dividing $n$, they must all be equal by the Chinese remainder theorem. This is a contradiction. + +## N2 PER (Peru) + +A positive integer $N$ is called balanced, if $N=1$ or if $N$ can be written as a product of an even number of not necessarily distinct primes. Given positive integers $a$ and $b$, consider the polynomial $P$ defined by $P(x)=(x+a)(x+b)$. +(a) Prove that there exist distinct positive integers $a$ and $b$ such that all the numbers $P(1), P(2)$, ..., $P(50)$ are balanced. +(b) Prove that if $P(n)$ is balanced for all positive integers $n$, then $a=b$. + +Solution. Define a function $f$ on the set of positive integers by $f(n)=0$ if $n$ is balanced and $f(n)=1$ otherwise. Clearly, $f(n m) \equiv f(n)+f(m) \bmod 2$ for all positive integers $n, m$. +(a) Now for each positive integer $n$ consider the binary sequence $(f(n+1), f(n+2), \ldots, f(n+$ $50)$ ). As there are only $2^{50}$ different such sequences there are two different positive integers $a$ and $b$ such that + +$$ +(f(a+1), f(a+2), \ldots, f(a+50))=(f(b+1), f(b+2), \ldots, f(b+50)) +$$ + +But this implies that for the polynomial $P(x)=(x+a)(x+b)$ all the numbers $P(1), P(2)$, $\ldots, P(50)$ are balanced, since for all $1 \leq k \leq 50$ we have $f(P(k)) \equiv f(a+k)+f(b+k) \equiv$ $2 f(a+k) \equiv 0 \bmod 2$. +(b) Now suppose $P(n)$ is balanced for all positive integers $n$ and $av_{p_{i}}(f(1))$ for all $i=1,2, \ldots, m$, e.g. $a=\left(p_{1} p_{2} \ldots p_{m}\right)^{\alpha}$ with $\alpha$ sufficiently large. Pick any such $a$. The condition of the problem then yields $a \mid(f(a+1)-f(1))$. Assume $f(a+1) \neq f(1)$. Then we must have $v_{p_{i}}(f(a+1)) \neq$ $v_{p_{i}}(f(1))$ for at least one $i$. This yields $v_{p_{i}}(f(a+1)-f(1))=\min \left\{v_{p_{i}}(f(a+1)), v_{p_{i}}(f(1))\right\} \leq$ $v_{p_{1}}(f(1)) p_{1}^{\alpha_{1}+1} p_{2}^{\alpha_{2}+1} \ldots p_{m}^{\alpha_{m}+1} \cdot(f(r)+r)-r \\ +& \geq p_{1}^{\alpha_{1}+1} p_{2}^{\alpha_{2}+1} \ldots p_{m}^{\alpha_{m}+1}+(f(r)+r)-r \\ +& >p_{1}^{\alpha_{1}} p_{2}^{\alpha_{2}} \ldots p_{m}^{\alpha_{m}}+f(r) \\ +& \geq|f(M)-f(r)| . +\end{aligned} +$$ + +But since $M-r$ divides $f(M)-f(r)$ this can only be true if $f(r)=f(M)=f(1)$, which contradicts the choice of $r$. + +Comment. In the case that $f$ is a polynomial with integer coefficients the result is well-known, see e.g. W. Schwarz, Einführung in die Methoden der Primzahltheorie, 1969. + +## N4 PRK (Democratic People's Republic of Korea) + +Find all positive integers $n$ such that there exists a sequence of positive integers $a_{1}, a_{2}, \ldots, a_{n}$ satisfying + +$$ +a_{k+1}=\frac{a_{k}^{2}+1}{a_{k-1}+1}-1 +$$ + +for every $k$ with $2 \leq k \leq n-1$. + +Solution 1. Such a sequence exists for $n=1,2,3,4$ and no other $n$. Since the existence of such a sequence for some $n$ implies the existence of such a sequence for all smaller $n$, it suffices to prove that $n=5$ is not possible and $n=4$ is possible. +Assume first that for $n=5$ there exists a sequence of positive integers $a_{1}, a_{2}, \ldots, a_{5}$ satisfying the conditions + +$$ +\begin{aligned} +& a_{2}^{2}+1=\left(a_{1}+1\right)\left(a_{3}+1\right), \\ +& a_{3}^{2}+1=\left(a_{2}+1\right)\left(a_{4}+1\right), \\ +& a_{4}^{2}+1=\left(a_{3}+1\right)\left(a_{5}+1\right) . +\end{aligned} +$$ + +Assume $a_{1}$ is odd, then $a_{2}$ has to be odd as well and as then $a_{2}^{2}+1 \equiv 2 \bmod 4, a_{3}$ has to be even. But this is a contradiction, since then the even number $a_{2}+1$ cannot divide the odd number $a_{3}^{2}+1$. +Hence $a_{1}$ is even. +If $a_{2}$ is odd, $a_{3}^{2}+1$ is even (as a multiple of $a_{2}+1$ ) and hence $a_{3}$ is odd, too. Similarly we must have $a_{4}$ odd as well. But then $a_{3}^{2}+1$ is a product of two even numbers $\left(a_{2}+1\right)\left(a_{4}+1\right)$ and thus is divisible by 4 , which is a contradiction as for odd $a_{3}$ we have $a_{3}^{2}+1 \equiv 2 \bmod 4$. +Hence $a_{2}$ is even. Furthermore $a_{3}+1$ divides the odd number $a_{2}^{2}+1$ and so $a_{3}$ is even. Similarly, $a_{4}$ and $a_{5}$ are even as well. +Now set $x=a_{2}$ and $y=a_{3}$. From the given condition we get $(x+1) \mid\left(y^{2}+1\right)$ and $(y+1) \mid\left(x^{2}+1\right)$. We will prove that there is no pair of positive even numbers $(x, y)$ satisfying these two conditions, thus yielding a contradiction to the assumption. +Assume there exists a pair $\left(x_{0}, y_{0}\right)$ of positive even numbers satisfying the two conditions $\left(x_{0}+1\right) \mid\left(y_{0}^{2}+1\right)$ and $\left(y_{0}+1\right) \mid\left(x_{0}^{2}+1\right)$. +Then one has $\left(x_{0}+1\right) \mid\left(y_{0}^{2}+1+x_{0}^{2}-1\right)$, i.e., $\left(x_{0}+1\right) \mid\left(x_{0}^{2}+y_{0}^{2}\right)$, and similarly $\left(y_{0}+1\right) \mid\left(x_{0}^{2}+y_{0}^{2}\right)$. Any common divisor $d$ of $x_{0}+1$ and $y_{0}+1$ must hence also divide the number $\left(x_{0}^{2}+1\right)+\left(y_{0}^{2}+1\right)-\left(x_{0}^{2}+y_{0}^{2}\right)=2$. But as $x_{0}+1$ and $y_{0}+1$ are both odd, we must have $d=1$. Thus $x_{0}+1$ and $y_{0}+1$ are relatively prime and therefore there exists a positive integer $k$ such that + +$$ +k(x+1)(y+1)=x^{2}+y^{2} +$$ + +has the solution $\left(x_{0}, y_{0}\right)$. We will show that the latter equation has no solution $(x, y)$ in positive even numbers. + +Assume there is a solution. Pick the solution $\left(x_{1}, y_{1}\right)$ with the smallest sum $x_{1}+y_{1}$ and assume $x_{1} \geq y_{1}$. Then $x_{1}$ is a solution to the quadratic equation + +$$ +x^{2}-k\left(y_{1}+1\right) x+y_{1}^{2}-k\left(y_{1}+1\right)=0 . +$$ + +Let $x_{2}$ be the second solution, which by Vieta's theorem fulfills $x_{1}+x_{2}=k\left(y_{1}+1\right)$ and $x_{1} x_{2}=y_{1}^{2}-k\left(y_{1}+1\right)$. If $x_{2}=0$, the second equation implies $y_{1}^{2}=k\left(y_{1}+1\right)$, which is impossible, as $y_{1}+1>1$ cannot divide the relatively prime number $y_{1}^{2}$. Therefore $x_{2} \neq 0$. +Also we get $\left(x_{1}+1\right)\left(x_{2}+1\right)=x_{1} x_{2}+x_{1}+x_{2}+1=y_{1}^{2}+1$ which is odd, and hence $x_{2}$ must be even and positive. Also we have $x_{2}+1=\frac{y_{1}^{2}+1}{x_{1}+1} \leq \frac{y_{1}^{2}+1}{y_{1}+1} \leq y_{1} \leq x_{1}$. But this means that the pair $\left(x^{\prime}, y^{\prime}\right)$ with $x^{\prime}=y_{1}$ and $y^{\prime}=x_{2}$ is another solution of $k(x+1)(y+1)=x^{2}+y^{2}$ in even positive numbers with $x^{\prime}+y^{\prime} y +$$ + +and similarly in the other case. +Now, if $a_{3}$ was odd, then $\left(a_{2}+1\right)\left(a_{4}+1\right)=a_{3}^{2}+1 \equiv 2 \bmod 4$ would imply that one of $a_{2}$ or $a_{4}$ is even, this contradicts (1). Thus $a_{3}$ and hence also $a_{1}, a_{2}, a_{4}$ and $a_{5}$ are even. According to (1), one has $a_{1} a_{2}>a_{3}>a_{4}>a_{5}$ but due to the minimality of $a_{1}$ the first series of inequalities must hold. +Consider the identity +$\left(a_{3}+1\right)\left(a_{1}+a_{3}\right)=a_{3}^{2}-1+\left(a_{1}+1\right)\left(a_{3}+1\right)=a_{2}^{2}+a_{3}^{2}=a_{2}^{2}-1+\left(a_{2}+1\right)\left(a_{4}+1\right)=\left(a_{2}+1\right)\left(a_{2}+a_{4}\right)$. +Any common divisor of the two odd numbers $a_{2}+1$ and $a_{3}+1$ must also divide $\left(a_{2}+1\right)\left(a_{4}+\right.$ $1)-\left(a_{3}+1\right)\left(a_{3}-1\right)=2$, so these numbers are relatively prime. Hence the last identity shows that $a_{1}+a_{3}$ must be a multiple of $a_{2}+1$, i.e. there is an integer $k$ such that + +$$ +a_{1}+a_{3}=k\left(a_{2}+1\right) +$$ + +Now set $a_{0}=k\left(a_{1}+1\right)-a_{2}$. This is an integer and we have + +$$ +\begin{aligned} +\left(a_{0}+1\right)\left(a_{2}+1\right) & =k\left(a_{1}+1\right)\left(a_{2}+1\right)-\left(a_{2}-1\right)\left(a_{2}+1\right) \\ +& =\left(a_{1}+1\right)\left(a_{1}+a_{3}\right)-\left(a_{1}+1\right)\left(a_{3}+1\right)+2 \\ +& =\left(a_{1}+1\right)\left(a_{1}-1\right)+2=a_{1}^{2}+1 +\end{aligned} +$$ + +Thus $a_{0} \geq 0$. If $a_{0}>0$, then by (1) we would have $a_{0} 1$ is relatively prime to $a_{1}^{2}$ and thus cannot be a divisior of this number. +Hence $n \geq 5$ is not possible. + +Comment 1. Finding the example for $n=4$ is not trivial and requires a tedious calculation, but it can be reduced to checking a few cases. The equations $\left(a_{1}+1\right)\left(a_{3}+1\right)=a_{2}^{2}+1$ and $\left(a_{2}+1\right)\left(a_{4}+1\right)=a_{3}^{2}+1$ imply, as seen in the proof, that $a_{1}$ is even and $a_{2}, a_{3}, a_{4}$ are odd. The case $a_{1}=2$ yields $a_{2}^{2} \equiv-1 \bmod 3$ which is impossible. Hence $a_{1}=4$ is the smallest possibility. In this case $a_{2}^{2} \equiv-1 \bmod 5$ and $a_{2}$ is odd, which implies $a_{2} \equiv 3$ or $a_{2} \equiv 7 \bmod 10$. Hence we have to start checking $a_{2}=7,13,17,23,27,33$ and in the last case we succeed. + +Comment 2. The choice of $a_{0}=k\left(a_{1}+1\right)-a_{2}$ in the second solution appears more natural if one considers that by the previous calculations one has $a_{1}=k\left(a_{2}+1\right)-a_{3}$ and $a_{2}=k\left(a_{3}+1\right)-a_{4}$. Alternatively, one can solve the equation (2) for $a_{3}$ and use $a_{2}^{2}+1=\left(a_{1}+1\right)\left(a_{3}+1\right)$ to get $a_{2}^{2}-k\left(a_{1}+1\right) a_{2}+a_{1}^{2}-k\left(a_{1}+1\right)=0$. Now $a_{0}$ is the second solution to this quadratic equation in $a_{2}$ (Vieta jumping). + +## N5 HUN (Hungary) + +Let $P(x)$ be a non-constant polynomial with integer coefficients. Prove that there is no function $T$ from the set of integers into the set of integers such that the number of integers $x$ with $T^{n}(x)=x$ is equal to $P(n)$ for every $n \geq 1$, where $T^{n}$ denotes the $n$-fold application of $T$. + +Solution 1. Assume there is a polynomial $P$ of degree at least 1 with the desired property for a given function $T$. Let $A(n)$ denote the set of all $x \in \mathbb{Z}$ such that $T^{n}(x)=x$ and let $B(n)$ denote the set of all $x \in \mathbb{Z}$ for which $T^{n}(x)=x$ and $T^{k}(x) \neq x$ for all $1 \leq k \sqrt{a b}, b^{\ell_{0}}>\sqrt{a b}$, we define the polynomial + +$$ +P(x)=\prod_{k=0, \ell=0}^{k_{0}-1, \ell_{0}-1}\left(a^{k} b^{\ell} x-\sqrt{a b}\right)=: \sum_{i=0}^{k_{0} \cdot \ell_{0}} d_{i} x^{i} +$$ + +with integer coefficients $d_{i}$. By our assumption, the zeros + +$$ +\frac{\sqrt{a b}}{a^{k} b^{\ell}}, \quad k=0, \ldots, k_{0}-1, \quad \ell=0, \ldots, \ell_{0}-1 +$$ + +of $P$ are pairwise distinct. +Furthermore, we consider the integer sequence + +$$ +y_{n}=\sum_{i=0}^{k_{0} \cdot \ell_{0}} d_{i} x_{n+i}, \quad n=1,2, \ldots +$$ + +By the theory of linear recursions, we obtain + +$$ +y_{n}=\sum_{\substack{k, \ell \geq 0 \\ k \geq k_{0} \text { or } \ell \geq \ell_{0}}} e_{k, \ell}\left(\frac{\sqrt{a b}}{a^{k} b^{\ell}}\right)^{n}, \quad n=1,2, \ldots +$$ + +with real numbers $e_{k, \ell}$. We have + +$$ +\left|y_{n}\right| \leq \sum_{\substack{k, \ell \geq 0 \\ k \geq k_{0} \text { or } \ell \geq \ell_{0}}}\left|e_{k, \ell}\right|\left(\frac{\sqrt{a b}}{a^{k} b^{\ell}}\right)^{n}=: M_{n} . +$$ + +Because the series in (4) is obtained by a finite linear combination of the absolutely convergent series (1), we conclude that in particular $M_{1}<\infty$. Since + +$$ +\frac{\sqrt{a b}}{a^{k} b^{\ell}} \leq \lambda:=\max \left\{\frac{\sqrt{a b}}{a^{k_{0}}}, \frac{\sqrt{a b}}{b^{\ell_{0}}}\right\} \quad \text { for all } k, \ell \geq 0 \text { such that } k \geq k_{0} \text { or } \ell \geq \ell_{0} +$$ + +we get the estimates $M_{n+1} \leq \lambda M_{n}, n=1,2, \ldots$ Our choice of $k_{0}$ and $\ell_{0}$ ensures $\lambda<1$, which implies $M_{n} \rightarrow 0$ and consequently $y_{n} \rightarrow 0$ as $n \rightarrow \infty$. It follows that $y_{n}=0$ for all sufficiently large $n$. +So, equation (3) reduces to $\sum_{i=0}^{k_{0} \cdot \ell_{0}} d_{i} x_{n+i}=0$. +Using the theory of linear recursions again, for sufficiently large $n$ we have + +$$ +x_{n}=\sum_{k=0, \ell=0}^{k_{0}-1, \ell_{0}-1} f_{k, \ell}\left(\frac{\sqrt{a b}}{a^{k} b^{\ell}}\right)^{n} +$$ + +for certain real numbers $f_{k, \ell}$. +Comparing with (2), we see that $f_{k, \ell}=c_{k, \ell}$ for all $k, \ell \geq 0$ with $k j_{0}$. But this means that + +$$ +\left(1-x^{\mu}\right)^{\frac{1}{2}}\left(1-x^{\nu}\right)^{\frac{1}{2}}=\sum_{j=0}^{j_{0}} g_{j} x^{j} +$$ + +for all real numbers $x \in(0,1)$. Squaring, we see that + +$$ +\left(1-x^{\mu}\right)\left(1-x^{\nu}\right) +$$ + +is the square of a polynomial in $x$. In particular, all its zeros are of order at least 2 , which implies $\mu=\nu$ by looking at roots of unity. So we obtain $\mu=\nu=1$, i. e., $a=b$, a contradiction. + +Solution 2. We set $a^{2}=A, b^{2}=B$, and $z_{n}=\sqrt{\left(A^{n}-1\right)\left(B^{n}-1\right)}$. Let us assume that $z_{n}$ is an integer for $n=1,2, \ldots$. Without loss of generality, we may suppose that $b0$ as $z_{n}>0$. As before, one obtains + +$$ +\begin{aligned} +& A^{n} B^{n}-A^{n}-B^{n}+1=z_{n}^{2} \\ +& =\left\{\delta_{0}(a b)^{n}-\delta_{1}\left(\frac{a}{b}\right)^{n}-\delta_{2}\left(\frac{a}{b^{3}}\right)^{n}-\cdots-\delta_{k}\left(\frac{a}{b^{2 k-1}}\right)^{n}\right\}^{2} \\ +& =\delta_{0}^{2} A^{n} B^{n}-2 \delta_{0} \delta_{1} A^{n}-\sum_{i=2}^{i=k}\left(2 \delta_{0} \delta_{i}-\sum_{j=1}^{j=i-1} \delta_{j} \delta_{i-j}\right)\left(\frac{A}{B^{i-1}}\right)^{n}+O\left(\frac{A}{B^{k}}\right)^{n} +\end{aligned} +$$ + +Easy asymptotic calculations yield $\delta_{0}=1, \delta_{1}=\frac{1}{2}, \delta_{i}=\frac{1}{2} \sum_{j=1}^{j=i-1} \delta_{j} \delta_{i-j}$ for $i=2,3, \ldots, k-2$, and then $a=b^{k-1}$. It follows that $k>2$ and there is some $P \in \mathbb{Q}[X]$ for which $(X-1)\left(X^{k-1}-1\right)=$ $P(X)^{2}$. But this cannot occur, for instance as $X^{k-1}-1$ has no double zeros. Thus our +assumption that $z_{n}$ was an integer for $n=1,2, \ldots$ turned out to be wrong, which solves the problem. + +Original formulation of the problem. $a, b$ are positive integers such that $a \cdot b$ is not a square of an integer. Prove that there exists a (infinitely many) positive integer $n$ such that ( $\left.a^{n}-1\right)\left(b^{n}-1\right)$ is not a square of an integer. + +Solution. Lemma. Let $c$ be a positive integer, which is not a perfect square. Then there exists an odd prime $p$ such that $c$ is not a quadratic residue modulo $p$. +Proof. Denoting the square-free part of $c$ by $c^{\prime}$, we have the equality $\left(\frac{c^{\prime}}{p}\right)=\left(\frac{c}{p}\right)$ of the corresponding LegEndre symbols. Suppose that $c^{\prime}=q_{1} \cdots q_{m}$, where $q_{1}<\cdots 1$ ); so, the expression $\frac{4}{3}(3-d)(d-1)\left(d^{2}-3\right)$ in the right-hand part of $(2)$ is nonnegative, and the desired inequality is proved. +Comment. The rightmost inequality is easier than the leftmost one. In particular, Solutions 2 and 3 show that only the condition $a^{2}+b^{2}+c^{2}+d^{2}=12$ is needed for the former one. + +A3. Let $x_{1}, \ldots, x_{100}$ be nonnegative real numbers such that $x_{i}+x_{i+1}+x_{i+2} \leq 1$ for all $i=1, \ldots, 100$ (we put $x_{101}=x_{1}, x_{102}=x_{2}$ ). Find the maximal possible value of the sum + +$$ +S=\sum_{i=1}^{100} x_{i} x_{i+2} +$$ + +(Russia) +Answer. $\frac{25}{2}$. +Solution 1. Let $x_{2 i}=0, x_{2 i-1}=\frac{1}{2}$ for all $i=1, \ldots, 50$. Then we have $S=50 \cdot\left(\frac{1}{2}\right)^{2}=\frac{25}{2}$. So, we are left to show that $S \leq \frac{25}{2}$ for all values of $x_{i}$ 's satisfying the problem conditions. + +Consider any $1 \leq i \leq 50$. By the problem condition, we get $x_{2 i-1} \leq 1-x_{2 i}-x_{2 i+1}$ and $x_{2 i+2} \leq 1-x_{2 i}-x_{2 i+1}$. Hence by the AM-GM inequality we get + +$$ +\begin{aligned} +x_{2 i-1} x_{2 i+1} & +x_{2 i} x_{2 i+2} \leq\left(1-x_{2 i}-x_{2 i+1}\right) x_{2 i+1}+x_{2 i}\left(1-x_{2 i}-x_{2 i+1}\right) \\ +& =\left(x_{2 i}+x_{2 i+1}\right)\left(1-x_{2 i}-x_{2 i+1}\right) \leq\left(\frac{\left(x_{2 i}+x_{2 i+1}\right)+\left(1-x_{2 i}-x_{2 i+1}\right)}{2}\right)^{2}=\frac{1}{4} +\end{aligned} +$$ + +Summing up these inequalities for $i=1,2, \ldots, 50$, we get the desired inequality + +$$ +\sum_{i=1}^{50}\left(x_{2 i-1} x_{2 i+1}+x_{2 i} x_{2 i+2}\right) \leq 50 \cdot \frac{1}{4}=\frac{25}{2} +$$ + +Comment. This solution shows that a bit more general fact holds. Namely, consider $2 n$ nonnegative numbers $x_{1}, \ldots, x_{2 n}$ in a row (with no cyclic notation) and suppose that $x_{i}+x_{i+1}+x_{i+2} \leq 1$ for all $i=1,2, \ldots, 2 n-2$. Then $\sum_{i=1}^{2 n-2} x_{i} x_{i+2} \leq \frac{n-1}{4}$. + +The proof is the same as above, though if might be easier to find it (for instance, applying induction). The original estimate can be obtained from this version by considering the sequence $x_{1}, x_{2}, \ldots, x_{100}, x_{1}, x_{2}$. + +Solution 2. We present another proof of the estimate. From the problem condition, we get + +$$ +\begin{aligned} +S=\sum_{i=1}^{100} x_{i} x_{i+2} \leq \sum_{i=1}^{100} x_{i}\left(1-x_{i}-x_{i+1}\right) & =\sum_{i=1}^{100} x_{i}-\sum_{i=1}^{100} x_{i}^{2}-\sum_{i=1}^{100} x_{i} x_{i+1} \\ +& =\sum_{i=1}^{100} x_{i}-\frac{1}{2} \sum_{i=1}^{100}\left(x_{i}+x_{i+1}\right)^{2} +\end{aligned} +$$ + +By the AM-QM inequality, we have $\sum\left(x_{i}+x_{i+1}\right)^{2} \geq \frac{1}{100}\left(\sum\left(x_{i}+x_{i+1}\right)\right)^{2}$, so + +$$ +\begin{aligned} +S \leq \sum_{i=1}^{100} x_{i}-\frac{1}{200}\left(\sum_{i=1}^{100}\left(x_{i}+x_{i+1}\right)\right)^{2} & =\sum_{i=1}^{100} x_{i}-\frac{2}{100}\left(\sum_{i=1}^{100} x_{i}\right)^{2} \\ +& =\frac{2}{100}\left(\sum_{i=1}^{100} x_{i}\right)\left(\frac{100}{2}-\sum_{i=1}^{100} x_{i}\right) +\end{aligned} +$$ + +And finally, by the AM-GM inequality + +$$ +S \leq \frac{2}{100} \cdot\left(\frac{1}{2}\left(\sum_{i=1}^{100} x_{i}+\frac{100}{2}-\sum_{i=1}^{100} x_{i}\right)\right)^{2}=\frac{2}{100} \cdot\left(\frac{100}{4}\right)^{2}=\frac{25}{2} +$$ + +Comment. These solutions are not as easy as they may seem at the first sight. There are two different optimal configurations in which the variables have different values, and not all of sums of three consecutive numbers equal 1. Although it is easy to find the value $\frac{25}{2}$, the estimates must be done with care to preserve equality in the optimal configurations. + +A4. A sequence $x_{1}, x_{2}, \ldots$ is defined by $x_{1}=1$ and $x_{2 k}=-x_{k}, x_{2 k-1}=(-1)^{k+1} x_{k}$ for all $k \geq 1$. Prove that $x_{1}+x_{2}+\cdots+x_{n} \geq 0$ for all $n \geq 1$. +(Austria) +Solution 1. We start with some observations. First, from the definition of $x_{i}$ it follows that for each positive integer $k$ we have + +$$ +x_{4 k-3}=x_{2 k-1}=-x_{4 k-2} \quad \text { and } \quad x_{4 k-1}=x_{4 k}=-x_{2 k}=x_{k} +$$ + +Hence, denoting $S_{n}=\sum_{i=1}^{n} x_{i}$, we have + +$$ +\begin{gathered} +S_{4 k}=\sum_{i=1}^{k}\left(\left(x_{4 k-3}+x_{4 k-2}\right)+\left(x_{4 k-1}+x_{4 k}\right)\right)=\sum_{i=1}^{k}\left(0+2 x_{k}\right)=2 S_{k}, \\ +S_{4 k+2}=S_{4 k}+\left(x_{4 k+1}+x_{4 k+2}\right)=S_{4 k} . +\end{gathered} +$$ + +Observe also that $S_{n}=\sum_{i=1}^{n} x_{i} \equiv \sum_{i=1}^{n} 1=n(\bmod 2)$. +Now we prove by induction on $k$ that $S_{i} \geq 0$ for all $i \leq 4 k$. The base case is valid since $x_{1}=x_{3}=x_{4}=1, x_{2}=-1$. For the induction step, assume that $S_{i} \geq 0$ for all $i \leq 4 k$. Using the relations (1)-(3), we obtain + +$$ +S_{4 k+4}=2 S_{k+1} \geq 0, \quad S_{4 k+2}=S_{4 k} \geq 0, \quad S_{4 k+3}=S_{4 k+2}+x_{4 k+3}=\frac{S_{4 k+2}+S_{4 k+4}}{2} \geq 0 +$$ + +So, we are left to prove that $S_{4 k+1} \geq 0$. If $k$ is odd, then $S_{4 k}=2 S_{k} \geq 0$; since $k$ is odd, $S_{k}$ is odd as well, so we have $S_{4 k} \geq 2$ and hence $S_{4 k+1}=S_{4 k}+x_{4 k+1} \geq 1$. + +Conversely, if $k$ is even, then we have $x_{4 k+1}=x_{2 k+1}=x_{k+1}$, hence $S_{4 k+1}=S_{4 k}+x_{4 k+1}=$ $2 S_{k}+x_{k+1}=S_{k}+S_{k+1} \geq 0$. The step is proved. + +Solution 2. We will use the notation of $S_{n}$ and the relations (1)-(3) from the previous solution. + +Assume the contrary and consider the minimal $n$ such that $S_{n+1}<0$; surely $n \geq 1$, and from $S_{n} \geq 0$ we get $S_{n}=0, x_{n+1}=-1$. Hence, we are especially interested in the set $M=\left\{n: S_{n}=0\right\}$; our aim is to prove that $x_{n+1}=1$ whenever $n \in M$ thus coming to a contradiction. + +For this purpose, we first describe the set $M$ inductively. We claim that (i) $M$ consists only of even numbers, (ii) $2 \in M$, and (iii) for every even $n \geq 4$ we have $n \in M \Longleftrightarrow[n / 4] \in M$. Actually, (i) holds since $S_{n} \equiv n(\bmod 2)$, (ii) is straightforward, while (iii) follows from the relations $S_{4 k+2}=S_{4 k}=2 S_{k}$. + +Now, we are left to prove that $x_{n+1}=1$ if $n \in M$. We use the induction on $n$. The base case is $n=2$, that is, the minimal element of $M$; here we have $x_{3}=1$, as desired. + +For the induction step, consider some $4 \leq n \in M$ and let $m=[n / 4] \in M$; then $m$ is even, and $x_{m+1}=1$ by the induction hypothesis. We prove that $x_{n+1}=x_{m+1}=1$. If $n=4 m$ then we have $x_{n+1}=x_{2 m+1}=x_{m+1}$ since $m$ is even; otherwise, $n=4 m+2$, and $x_{n+1}=-x_{2 m+2}=x_{m+1}$, as desired. The proof is complete. + +Comment. Using the inductive definition of set $M$, one can describe it explicitly. Namely, $M$ consists exactly of all positive integers not containing digits 1 and 3 in their 4 -base representation. + +A5. Denote by $\mathbb{Q}^{+}$the set of all positive rational numbers. Determine all functions $f: \mathbb{Q}^{+} \rightarrow \mathbb{Q}^{+}$ which satisfy the following equation for all $x, y \in \mathbb{Q}^{+}$: + +$$ +f\left(f(x)^{2} y\right)=x^{3} f(x y) +$$ + +(Switzerland) +Answer. The only such function is $f(x)=\frac{1}{x}$. +Solution. By substituting $y=1$, we get + +$$ +f\left(f(x)^{2}\right)=x^{3} f(x) +$$ + +Then, whenever $f(x)=f(y)$, we have + +$$ +x^{3}=\frac{f\left(f(x)^{2}\right)}{f(x)}=\frac{f\left(f(y)^{2}\right)}{f(y)}=y^{3} +$$ + +which implies $x=y$, so the function $f$ is injective. +Now replace $x$ by $x y$ in (2), and apply (1) twice, second time to $\left(y, f(x)^{2}\right)$ instead of $(x, y)$ : + +$$ +f\left(f(x y)^{2}\right)=(x y)^{3} f(x y)=y^{3} f\left(f(x)^{2} y\right)=f\left(f(x)^{2} f(y)^{2}\right) +$$ + +Since $f$ is injective, we get + +$$ +\begin{aligned} +f(x y)^{2} & =f(x)^{2} f(y)^{2} \\ +f(x y) & =f(x) f(y) . +\end{aligned} +$$ + +Therefore, $f$ is multiplicative. This also implies $f(1)=1$ and $f\left(x^{n}\right)=f(x)^{n}$ for all integers $n$. +Then the function equation (1) can be re-written as + +$$ +\begin{aligned} +f(f(x))^{2} f(y) & =x^{3} f(x) f(y), \\ +f(f(x)) & =\sqrt{x^{3} f(x)} . +\end{aligned} +$$ + +Let $g(x)=x f(x)$. Then, by (3), we have + +$$ +\begin{aligned} +g(g(x)) & =g(x f(x))=x f(x) \cdot f(x f(x))=x f(x)^{2} f(f(x))= \\ +& =x f(x)^{2} \sqrt{x^{3} f(x)}=(x f(x))^{5 / 2}=(g(x))^{5 / 2} +\end{aligned} +$$ + +and, by induction, +for every positive integer $n$. +Consider (4) for a fixed $x$. The left-hand side is always rational, so $(g(x))^{(5 / 2)^{n}}$ must be rational for every $n$. We show that this is possible only if $g(x)=1$. Suppose that $g(x) \neq 1$, and let the prime factorization of $g(x)$ be $g(x)=p_{1}^{\alpha_{1}} \ldots p_{k}^{\alpha_{k}}$ where $p_{1}, \ldots, p_{k}$ are distinct primes and $\alpha_{1}, \ldots, \alpha_{k}$ are nonzero integers. Then the unique prime factorization of (4) is + +$$ +\underbrace{g(g(\ldots g}_{n+1}(x) \ldots))=(g(x))^{(5 / 2)^{n}}=p_{1}^{(5 / 2)^{n} \alpha_{1}} \cdots p_{k}^{(5 / 2)^{n} \alpha_{k}} +$$ + +where the exponents should be integers. But this is not true for large values of $n$, for example $\left(\frac{5}{2}\right)^{n} \alpha_{1}$ cannot be a integer number when $2^{n} \nmid \alpha_{1}$. Therefore, $g(x) \neq 1$ is impossible. + +Hence, $g(x)=1$ and thus $f(x)=\frac{1}{x}$ for all $x$. +The function $f(x)=\frac{1}{x}$ satisfies the equation (1): + +$$ +f\left(f(x)^{2} y\right)=\frac{1}{f(x)^{2} y}=\frac{1}{\left(\frac{1}{x}\right)^{2} y}=\frac{x^{3}}{x y}=x^{3} f(x y) +$$ + +Comment. Among $\mathbb{R}^{+} \rightarrow \mathbb{R}^{+}$functions, $f(x)=\frac{1}{x}$ is not the only solution. Another solution is $f_{1}(x)=x^{3 / 2}$. Using transfinite tools, infinitely many other solutions can be constructed. + +A6. Suppose that $f$ and $g$ are two functions defined on the set of positive integers and taking positive integer values. Suppose also that the equations $f(g(n))=f(n)+1$ and $g(f(n))=$ $g(n)+1$ hold for all positive integers. Prove that $f(n)=g(n)$ for all positive integer $n$. +(Germany) +Solution 1. Throughout the solution, by $\mathbb{N}$ we denote the set of all positive integers. For any function $h: \mathbb{N} \rightarrow \mathbb{N}$ and for any positive integer $k$, define $h^{k}(x)=\underbrace{h(h(\ldots h}_{k}(x) \ldots)$ ) (in particular, $\left.h^{0}(x)=x\right)$. + +Observe that $f\left(g^{k}(x)\right)=f\left(g^{k-1}(x)\right)+1=\cdots=f(x)+k$ for any positive integer $k$, and similarly $g\left(f^{k}(x)\right)=g(x)+k$. Now let $a$ and $b$ are the minimal values attained by $f$ and $g$, respectively; say $f\left(n_{f}\right)=a, g\left(n_{g}\right)=b$. Then we have $f\left(g^{k}\left(n_{f}\right)\right)=a+k, g\left(f^{k}\left(n_{g}\right)\right)=b+k$, so the function $f$ attains all values from the set $N_{f}=\{a, a+1, \ldots\}$, while $g$ attains all the values from the set $N_{g}=\{b, b+1, \ldots\}$. + +Next, note that $f(x)=f(y)$ implies $g(x)=g(f(x))-1=g(f(y))-1=g(y)$; surely, the converse implication also holds. Now, we say that $x$ and $y$ are similar (and write $x \sim y$ ) if $f(x)=f(y)$ (equivalently, $g(x)=g(y)$ ). For every $x \in \mathbb{N}$, we define $[x]=\{y \in \mathbb{N}: x \sim y\}$; surely, $y_{1} \sim y_{2}$ for all $y_{1}, y_{2} \in[x]$, so $[x]=[y]$ whenever $y \in[x]$. + +Now we investigate the structure of the sets $[x]$. +Claim 1. Suppose that $f(x) \sim f(y)$; then $x \sim y$, that is, $f(x)=f(y)$. Consequently, each class $[x]$ contains at most one element from $N_{f}$, as well as at most one element from $N_{g}$. +Proof. If $f(x) \sim f(y)$, then we have $g(x)=g(f(x))-1=g(f(y))-1=g(y)$, so $x \sim y$. The second statement follows now from the sets of values of $f$ and $g$. + +Next, we clarify which classes do not contain large elements. +Claim 2. For any $x \in \mathbb{N}$, we have $[x] \subseteq\{1,2, \ldots, b-1\}$ if and only if $f(x)=a$. Analogously, $[x] \subseteq\{1,2, \ldots, a-1\}$ if and only if $g(x)=b$. +Proof. We will prove that $[x] \nsubseteq\{1,2, \ldots, b-1\} \Longleftrightarrow f(x)>a$; the proof of the second statement is similar. + +Note that $f(x)>a$ implies that there exists some $y$ satisfying $f(y)=f(x)-1$, so $f(g(y))=$ $f(y)+1=f(x)$, and hence $x \sim g(y) \geq b$. Conversely, if $b \leq c \sim x$ then $c=g(y)$ for some $y \in \mathbb{N}$, which in turn follows $f(x)=f(g(y))=f(y)+1 \geq a+1$, and hence $f(x)>a$. + +Claim 2 implies that there exists exactly one class contained in $\{1, \ldots, a-1\}$ (that is, the class $\left[n_{g}\right]$ ), as well as exactly one class contained in $\{1, \ldots, b-1\}$ (the class $\left[n_{f}\right]$ ). Assume for a moment that $a \leq b$; then $\left[n_{g}\right]$ is contained in $\{1, \ldots, b-1\}$ as well, hence it coincides with $\left[n_{g}\right]$. So, we get that + +$$ +f(x)=a \Longleftrightarrow g(x)=b \Longleftrightarrow x \sim n_{f} \sim n_{g} . +$$ + +Claim 3. $a=b$. +Proof. By Claim 2, we have $[a] \neq\left[n_{f}\right]$, so $[a]$ should contain some element $a^{\prime} \geq b$ by Claim 2 again. If $a \neq a^{\prime}$, then $[a]$ contains two elements $\geq a$ which is impossible by Claim 1. Therefore, $a=a^{\prime} \geq b$. Similarly, $b \geq a$. + +Now we are ready to prove the problem statement. First, we establish the following +Claim 4. For every integer $d \geq 0, f^{d+1}\left(n_{f}\right)=g^{d+1}\left(n_{f}\right)=a+d$. +Proof. Induction on $d$. For $d=0$, the statement follows from (1) and Claim 3. Next, for $d>1$ from the induction hypothesis we have $f^{d+1}\left(n_{f}\right)=f\left(f^{d}\left(n_{f}\right)\right)=f\left(g^{d}\left(n_{f}\right)\right)=f\left(n_{f}\right)+d=a+d$. The equality $g^{d+1}\left(n_{f}\right)=a+d$ is analogous. + +Finally, for each $x \in \mathbb{N}$, we have $f(x)=a+d$ for some $d \geq 0$, so $f(x)=f\left(g^{d}\left(n_{f}\right)\right)$ and hence $x \sim g^{d}\left(n_{f}\right)$. It follows that $g(x)=g\left(g^{d}\left(n_{f}\right)\right)=g^{d+1}\left(n_{f}\right)=a+d=f(x)$ by Claim 4 . + +Solution 2. We start with the same observations, introducing the relation $\sim$ and proving Claim 1 from the previous solution. + +Note that $f(a)>a$ since otherwise we have $f(a)=a$ and hence $g(a)=g(f(a))=g(a)+1$, which is false. +Claim 2'. $a=b$. +Proof. We can assume that $a \leq b$. Since $f(a) \geq a+1$, there exists some $x \in \mathbb{N}$ such that $f(a)=f(x)+1$, which is equivalent to $f(a)=f(g(x))$ and $a \sim g(x)$. Since $g(x) \geq b \geq a$, by Claim 1 we have $a=g(x) \geq b$, which together with $a \leq b$ proves the Claim. + +Now, almost the same method allows to find the values $f(a)$ and $g(a)$. +Claim 3'. $f(a)=g(a)=a+1$. +Proof. Assume the contrary; then $f(a) \geq a+2$, hence there exist some $x, y \in \mathbb{N}$ such that $f(x)=f(a)-2$ and $f(y)=g(x)($ as $g(x) \geq a=b)$. Now we get $f(a)=f(x)+2=f\left(g^{2}(x)\right)$, so $a \sim g^{2}(x) \geq a$, and by Claim 1 we get $a=g^{2}(x)=g(f(y))=1+g(y) \geq 1+a$; this is impossible. The equality $g(a)=a+1$ is similar. + +Now, we are prepared for the proof of the problem statement. First, we prove it for $n \geq a$. Claim 4'. For each integer $x \geq a$, we have $f(x)=g(x)=x+1$. +Proof. Induction on $x$. The base case $x=a$ is provided by Claim $3^{\prime}$, while the induction step follows from $f(x+1)=f(g(x))=f(x)+1=(x+1)+1$ and the similar computation for $g(x+1)$. + +Finally, for an arbitrary $n \in \mathbb{N}$ we have $g(n) \geq a$, so by Claim $4^{\prime}$ we have $f(n)+1=$ $f(g(n))=g(n)+1$, hence $f(n)=g(n)$. +Comment. It is not hard now to describe all the functions $f: \mathbb{N} \rightarrow \mathbb{N}$ satisfying the property $f(f(n))=$ $f(n)+1$. For each such function, there exists $n_{0} \in \mathbb{N}$ such that $f(n)=n+1$ for all $n \geq n_{0}$, while for each $n r$, we inductively define + +$$ +a_{n}=\max _{1 \leq k \leq n-1}\left(a_{k}+a_{n-k}\right) +$$ + +Prove that there exist positive integers $\ell \leq r$ and $N$ such that $a_{n}=a_{n-\ell}+a_{\ell}$ for all $n \geq N$. +(Iran) +Solution 1. First, from the problem conditions we have that each $a_{n}(n>r)$ can be expressed as $a_{n}=a_{j_{1}}+a_{j_{2}}$ with $j_{1}, j_{2} r$ then we can proceed in the same way with $a_{j_{1}}$, and so on. Finally, we represent $a_{n}$ in a form + +$$ +\begin{gathered} +a_{n}=a_{i_{1}}+\cdots+a_{i_{k}}, \\ +1 \leq i_{j} \leq r, \quad i_{1}+\cdots+i_{k}=n . +\end{gathered} +$$ + +Moreover, if $a_{i_{1}}$ and $a_{i_{2}}$ are the numbers in (2) obtained on the last step, then $i_{1}+i_{2}>r$. Hence we can adjust (3) as + +$$ +1 \leq i_{j} \leq r, \quad i_{1}+\cdots+i_{k}=n, \quad i_{1}+i_{2}>r . +$$ + +On the other hand, suppose that the indices $i_{1}, \ldots, i_{k}$ satisfy the conditions (4). Then, denoting $s_{j}=i_{1}+\cdots+i_{j}$, from (1) we have + +$$ +a_{n}=a_{s_{k}} \geq a_{s_{k-1}}+a_{i_{k}} \geq a_{s_{k-2}}+a_{i_{k-1}}+a_{i_{k}} \geq \cdots \geq a_{i_{1}}+\cdots+a_{i_{k}} +$$ + +Summarizing these observations we get the following +Claim. For every $n>r$, we have + +$$ +a_{n}=\max \left\{a_{i_{1}}+\cdots+a_{i_{k}}: \text { the collection }\left(i_{1}, \ldots, i_{k}\right) \text { satisfies }(4)\right\} +$$ + +Now we denote + +$$ +s=\max _{1 \leq i \leq r} \frac{a_{i}}{i} +$$ + +and fix some index $\ell \leq r$ such that $s=\frac{a_{\ell}}{\ell}$. +Consider some $n \geq r^{2} \ell+2 r$ and choose an expansion of $a_{n}$ in the form (2), (4). Then we have $n=i_{1}+\cdots+i_{k} \leq r k$, so $k \geq n / r \geq r \ell+2$. Suppose that none of the numbers $i_{3}, \ldots, i_{k}$ equals $\ell$. Then by the pigeonhole principle there is an index $1 \leq j \leq r$ which appears among $i_{3}, \ldots, i_{k}$ at least $\ell$ times, and surely $j \neq \ell$. Let us delete these $\ell$ occurrences of $j$ from $\left(i_{1}, \ldots, i_{k}\right)$, and add $j$ occurrences of $\ell$ instead, obtaining a sequence $\left(i_{1}, i_{2}, i_{3}^{\prime}, \ldots, i_{k^{\prime}}^{\prime}\right)$ also satisfying (4). By Claim, we have + +$$ +a_{i_{1}}+\cdots+a_{i_{k}}=a_{n} \geq a_{i_{1}}+a_{i_{2}}+a_{i_{3}^{\prime}}+\cdots+a_{i_{k^{\prime}}^{\prime}} +$$ + +or, after removing the coinciding terms, $\ell a_{j} \geq j a_{\ell}$, so $\frac{a_{\ell}}{\ell} \leq \frac{a_{j}}{j}$. By the definition of $\ell$, this means that $\ell a_{j}=j a_{\ell}$, hence + +$$ +a_{n}=a_{i_{1}}+a_{i_{2}}+a_{i_{3}^{\prime}}+\cdots+a_{i_{k^{\prime}}^{\prime}} +$$ + +Thus, for every $n \geq r^{2} \ell+2 r$ we have found a representation of the form (2), (4) with $i_{j}=\ell$ for some $j \geq 3$. Rearranging the indices we may assume that $i_{k}=\ell$. + +Finally, observe that in this representation, the indices $\left(i_{1}, \ldots, i_{k-1}\right)$ satisfy the conditions (4) with $n$ replaced by $n-\ell$. Thus, from the Claim we get + +$$ +a_{n-\ell}+a_{\ell} \geq\left(a_{i_{1}}+\cdots+a_{i_{k-1}}\right)+a_{\ell}=a_{n} +$$ + +which by (1) implies + +$$ +a_{n}=a_{n-\ell}+a_{\ell} \quad \text { for each } n \geq r^{2} \ell+2 r +$$ + +as desired. + +Solution 2. As in the previous solution, we involve the expansion (2), (3), and we fix some index $1 \leq \ell \leq r$ such that + +$$ +\frac{a_{\ell}}{\ell}=s=\max _{1 \leq i \leq r} \frac{a_{i}}{i} +$$ + +Now, we introduce the sequence $\left(b_{n}\right)$ as $b_{n}=a_{n}-s n$; then $b_{\ell}=0$. +We prove by induction on $n$ that $b_{n} \leq 0$, and $\left(b_{n}\right)$ satisfies the same recurrence relation as $\left(a_{n}\right)$. The base cases $n \leq r$ follow from the definition of $s$. Now, for $n>r$ from the induction hypothesis we have + +$$ +b_{n}=\max _{1 \leq k \leq n-1}\left(a_{k}+a_{n-k}\right)-n s=\max _{1 \leq k \leq n-1}\left(b_{k}+b_{n-k}+n s\right)-n s=\max _{1 \leq k \leq n-1}\left(b_{k}+b_{n-k}\right) \leq 0 +$$ + +as required. +Now, if $b_{k}=0$ for all $1 \leq k \leq r$, then $b_{n}=0$ for all $n$, hence $a_{n}=s n$, and the statement is trivial. Otherwise, define + +$$ +M=\max _{1 \leq i \leq r}\left|b_{i}\right|, \quad \varepsilon=\min \left\{\left|b_{i}\right|: 1 \leq i \leq r, b_{i}<0\right\} +$$ + +Then for $n>r$ we obtain + +$$ +b_{n}=\max _{1 \leq k \leq n-1}\left(b_{k}+b_{n-k}\right) \geq b_{\ell}+b_{n-\ell}=b_{n-\ell} +$$ + +so + +$$ +0 \geq b_{n} \geq b_{n-\ell} \geq b_{n-2 \ell} \geq \cdots \geq-M +$$ + +Thus, in view of the expansion (2), (3) applied to the sequence $\left(b_{n}\right)$, we get that each $b_{n}$ is contained in a set + +$$ +T=\left\{b_{i_{1}}+b_{i_{2}}+\cdots+b_{i_{k}}: i_{1}, \ldots, i_{k} \leq r\right\} \cap[-M, 0] +$$ + +We claim that this set is finite. Actually, for any $x \in T$, let $x=b_{i_{1}}+\cdots+b_{i_{k}}\left(i_{1}, \ldots, i_{k} \leq r\right)$. Then among $b_{i_{j}}$ 's there are at most $\frac{M}{\varepsilon}$ nonzero terms (otherwise $x<\frac{M}{\varepsilon} \cdot(-\varepsilon)<-M$ ). Thus $x$ can be expressed in the same way with $k \leq \frac{M}{\varepsilon}$, and there is only a finite number of such sums. + +Finally, for every $t=1,2, \ldots, \ell$ we get that the sequence + +$$ +b_{r+t}, b_{r+t+\ell}, b_{r+t+2 \ell}, \ldots +$$ + +is non-decreasing and attains the finite number of values; therefore it is constant from some index. Thus, the sequence $\left(b_{n}\right)$ is periodic with period $\ell$ from some index $N$, which means that + +$$ +b_{n}=b_{n-\ell}=b_{n-\ell}+b_{\ell} \quad \text { for all } n>N+\ell +$$ + +and hence + +$$ +a_{n}=b_{n}+n s=\left(b_{n-\ell}+(n-\ell) s\right)+\left(b_{\ell}+\ell s\right)=a_{n-\ell}+a_{\ell} \quad \text { for all } n>N+\ell \text {, } +$$ + +as desired. + +A8. Given six positive numbers $a, b, c, d, e, f$ such that $a\sqrt{3(S+T)(S(b d+b f+d f)+T(a c+a e+c e))} +$$ + +(South Korea) +Solution 1. We define also $\sigma=a c+c e+a e, \tau=b d+b f+d f$. The idea of the solution is to interpret (1) as a natural inequality on the roots of an appropriate polynomial. + +Actually, consider the polynomial + +$$ +\begin{aligned} +& P(x)=(b+d+f)(x-a)(x-c)(x-e)+(a+c+e)(x-b)(x-d)(x-f) \\ +&=T\left(x^{3}-S x^{2}+\sigma x-a c e\right)+S\left(x^{3}-T x^{2}+\tau x-b d f\right) +\end{aligned} +$$ + +Surely, $P$ is cubic with leading coefficient $S+T>0$. Moreover, we have + +$$ +\begin{array}{ll} +P(a)=S(a-b)(a-d)(a-f)<0, & P(c)=S(c-b)(c-d)(c-f)>0 \\ +P(e)=S(e-b)(e-d)(e-f)<0, & P(f)=T(f-a)(f-c)(f-e)>0 +\end{array} +$$ + +Hence, each of the intervals $(a, c),(c, e),(e, f)$ contains at least one root of $P(x)$. Since there are at most three roots at all, we obtain that there is exactly one root in each interval (denote them by $\alpha \in(a, c), \beta \in(c, e), \gamma \in(e, f))$. Moreover, the polynomial $P$ can be factorized as + +$$ +P(x)=(T+S)(x-\alpha)(x-\beta)(x-\gamma) +$$ + +Equating the coefficients in the two representations (2) and (3) of $P(x)$ provides + +$$ +\alpha+\beta+\gamma=\frac{2 T S}{T+S}, \quad \alpha \beta+\alpha \gamma+\beta \gamma=\frac{S \tau+T \sigma}{T+S} +$$ + +Now, since the numbers $\alpha, \beta, \gamma$ are distinct, we have + +$$ +0<(\alpha-\beta)^{2}+(\alpha-\gamma)^{2}+(\beta-\gamma)^{2}=2(\alpha+\beta+\gamma)^{2}-6(\alpha \beta+\alpha \gamma+\beta \gamma) +$$ + +which implies + +$$ +\frac{4 S^{2} T^{2}}{(T+S)^{2}}=(\alpha+\beta+\gamma)^{2}>3(\alpha \beta+\alpha \gamma+\beta \gamma)=\frac{3(S \tau+T \sigma)}{T+S} +$$ + +or + +$$ +4 S^{2} T^{2}>3(T+S)(T \sigma+S \tau) +$$ + +which is exactly what we need. +Comment 1. In fact, one can locate the roots of $P(x)$ more narrowly: they should lie in the intervals $(a, b),(c, d),(e, f)$. + +Surely, if we change all inequality signs in the problem statement to non-strict ones, the (non-strict) inequality will also hold by continuity. One can also find when the equality is achieved. This happens in that case when $P(x)$ is a perfect cube, which immediately implies that $b=c=d=e(=\alpha=\beta=\gamma)$, together with the additional condition that $P^{\prime \prime}(b)=0$. Algebraically, + +$$ +\begin{array}{rlr} +6(T+S) b-4 T S=0 & \Longleftrightarrow & 3 b(a+4 b+f)=2(a+2 b)(2 b+f) \\ +& \Longleftrightarrow & f=\frac{b(4 b-a)}{2 a+b}=b\left(1+\frac{3(b-a)}{2 a+b}\right)>b +\end{array} +$$ + +This means that for every pair of numbers $a, b$ such that $0b$ such that the point $(a, b, b, b, b, f)$ is a point of equality. + +Solution 2. Let + +$$ +U=\frac{1}{2}\left((e-a)^{2}+(c-a)^{2}+(e-c)^{2}\right)=S^{2}-3(a c+a e+c e) +$$ + +and + +$$ +V=\frac{1}{2}\left((f-b)^{2}+(f-d)^{2}+(d-b)^{2}\right)=T^{2}-3(b d+b f+d f) +$$ + +Then + +$$ +\begin{aligned} +& \text { (L.H.S. })^{2}-(\text { R.H.S. })^{2}=(2 S T)^{2}-(S+T)(S \cdot 3(b d+b f+d f)+T \cdot 3(a c+a e+c e))= \\ +& \quad=4 S^{2} T^{2}-(S+T)\left(S\left(T^{2}-V\right)+T\left(S^{2}-U\right)\right)=(S+T)(S V+T U)-S T(T-S)^{2} +\end{aligned} +$$ + +and the statement is equivalent with + +$$ +(S+T)(S V+T U)>S T(T-S)^{2} +$$ + +By the Cauchy-Schwarz inequality, + +$$ +(S+T)(T U+S V) \geq(\sqrt{S \cdot T U}+\sqrt{T \cdot S V})^{2}=S T(\sqrt{U}+\sqrt{V})^{2} +$$ + +Estimate the quantities $\sqrt{U}$ and $\sqrt{V}$ by the QM-AM inequality with the positive terms $(e-c)^{2}$ and $(d-b)^{2}$ being omitted: + +$$ +\begin{aligned} +\sqrt{U}+\sqrt{V} & >\sqrt{\frac{(e-a)^{2}+(c-a)^{2}}{2}}+\sqrt{\frac{(f-b)^{2}+(f-d)^{2}}{2}} \\ +& >\frac{(e-a)+(c-a)}{2}+\frac{(f-b)+(f-d)}{2}=\left(f-\frac{d}{2}-\frac{b}{2}\right)+\left(\frac{e}{2}+\frac{c}{2}-a\right) \\ +& =(T-S)+\frac{3}{2}(e-d)+\frac{3}{2}(c-b)>T-S . +\end{aligned} +$$ + +The estimates (5) and (6) prove (4) and hence the statement. +Solution 3. We keep using the notations $\sigma$ and $\tau$ from Solution 1. Moreover, let $s=c+e$. Note that + +$$ +(c-b)(c-d)+(e-f)(e-d)+(e-f)(c-b)<0 +$$ + +since each summand is negative. This rewrites as + +$$ +\begin{gathered} +(b d+b f+d f)-(a c+c e+a e)<(c+e)(b+d+f-a-c-e), \text { or } \\ +\tau-\sigma \sqrt{3(S+T)(S(b d+b f+d f)+T(a c+a e+c e))} +$$ + +Comment 2. The expression (7) can be found by considering the sum of the roots of the quadratic polynomial $q(x)=(x-b)(x-d)(x-f)-(x-a)(x-c)(x-e)$. + +Solution 4. We introduce the expressions $\sigma$ and $\tau$ as in the previous solutions. The idea of the solution is to change the values of variables $a, \ldots, f$ keeping the left-hand side unchanged and increasing the right-hand side; it will lead to a simpler inequality which can be proved in a direct way. + +Namely, we change the variables (i) keeping the (non-strict) inequalities $a \leq b \leq c \leq d \leq$ $e \leq f$; (ii) keeping the values of sums $S$ and $T$ unchanged; and finally (iii) increasing the values of $\sigma$ and $\tau$. Then the left-hand side of (1) remains unchanged, while the right-hand side increases. Hence, the inequality (1) (and even a non-strict version of (1)) for the changed values would imply the same (strict) inequality for the original values. + +First, we find the sufficient conditions for (ii) and (iii) to be satisfied. +Lemma. Let $x, y, z>0$; denote $U(x, y, z)=x+y+z, v(x, y, z)=x y+x z+y z$. Suppose that $x^{\prime}+y^{\prime}=x+y$ but $|x-y| \geq\left|x^{\prime}-y^{\prime}\right| ;$ then we have $U\left(x^{\prime}, y^{\prime}, z\right)=U(x, y, z)$ and $v\left(x^{\prime}, y^{\prime}, z\right) \geq$ $v(x, y, z)$ with equality achieved only when $|x-y|=\left|x^{\prime}-y^{\prime}\right|$. +Proof. The first equality is obvious. For the second, we have + +$$ +\begin{aligned} +v\left(x^{\prime}, y^{\prime}, z\right)=z\left(x^{\prime}+y^{\prime}\right)+x^{\prime} y^{\prime} & =z\left(x^{\prime}+y^{\prime}\right)+\frac{\left(x^{\prime}+y^{\prime}\right)^{2}-\left(x^{\prime}-y^{\prime}\right)^{2}}{4} \\ +& \geq z(x+y)+\frac{(x+y)^{2}-(x-y)^{2}}{4}=v(x, y, z) +\end{aligned} +$$ + +with the equality achieved only for $\left(x^{\prime}-y^{\prime}\right)^{2}=(x-y)^{2} \Longleftrightarrow\left|x^{\prime}-y^{\prime}\right|=|x-y|$, as desired. + +Now, we apply Lemma several times making the following changes. For each change, we denote the new values by the same letters to avoid cumbersome notations. + +1. Let $k=\frac{d-c}{2}$. Replace $(b, c, d, e)$ by $(b+k, c+k, d-k, e-k)$. After the change we have $a2^{N-2}$. Consider the collection of all $2^{N-2}$ flags having yellow first squares and blue second ones. Obviously, both colors appear on the diagonal of each $N \times N$ square formed by these flags. + +We are left to show that $M_{N} \leq 2^{N-2}+1$, thus obtaining the desired answer. We start with establishing this statement for $N=4$. + +Suppose that we have 5 flags of length 4 . We decompose each flag into two parts of 2 squares each; thereby, we denote each flag as $L R$, where the $2 \times 1$ flags $L, R \in \mathcal{S}=\{\mathrm{BB}, \mathrm{BY}, \mathrm{YB}, \mathrm{YY}\}$ are its left and right parts, respectively. First, we make two easy observations on the flags $2 \times 1$ which can be checked manually. +(i) For each $A \in \mathcal{S}$, there exists only one $2 \times 1$ flag $C \in \mathcal{S}$ (possibly $C=A$ ) such that $A$ and $C$ cannot form a $2 \times 2$ square with monochrome diagonal (for part BB, that is YY, and for BY that is YB). +(ii) Let $A_{1}, A_{2}, A_{3} \in \mathcal{S}$ be three distinct elements; then two of them can form a $2 \times 2$ square with yellow diagonal, and two of them can form a $2 \times 2$ square with blue diagonal (for all parts but BB , a pair $(\mathrm{BY}, \mathrm{YB})$ fits for both statements, while for all parts but BY, these pairs are $(\mathrm{YB}, \mathrm{YY})$ and (BB, YB)). + +Now, let $\ell$ and $r$ be the numbers of distinct left and right parts of our 5 flags, respectively. The total number of flags is $5 \leq r \ell$, hence one of the factors (say, $r$ ) should be at least 3 . On the other hand, $\ell, r \leq 4$, so there are two flags with coinciding right part; let them be $L_{1} R_{1}$ and $L_{2} R_{1}\left(L_{1} \neq L_{2}\right)$. + +Next, since $r \geq 3$, there exist some flags $L_{3} R_{3}$ and $L_{4} R_{4}$ such that $R_{1}, R_{3}, R_{4}$ are distinct. Let $L^{\prime} R^{\prime}$ be the remaining flag. By (i), one of the pairs $\left(L^{\prime}, L_{1}\right)$ and $\left(L^{\prime}, L_{2}\right)$ can form a $2 \times 2$ square with monochrome diagonal; we can assume that $L^{\prime}, L_{2}$ form a square with a blue diagonal. Finally, the right parts of two of the flags $L_{1} R_{1}, L_{3} R_{3}, L_{4} R_{4}$ can also form a $2 \times 2$ square with a blue diagonal by (ii). Putting these $2 \times 2$ squares on the diagonal of a $4 \times 4$ square, we find a desired arrangement of four flags. + +We are ready to prove the problem statement by induction on $N$; actually, above we have proved the base case $N=4$. For the induction step, assume that $N>4$, consider any $2^{N-2}+1$ flags of length $N$, and arrange them into a large flag of size $\left(2^{N-2}+1\right) \times N$. This flag contains a non-monochrome column since the flags are distinct; we may assume that this column is the first one. By the pigeonhole principle, this column contains at least $\left\lceil\frac{2^{N-2}+1}{2}\right\rceil=2^{N-3}+1$ squares of one color (say, blue). We call the flags with a blue first square good. + +Consider all the good flags and remove the first square from each of them. We obtain at least $2^{N-3}+1 \geq M_{N-1}$ flags of length $N-1$; by the induction hypothesis, $N-1$ of them +can form a square $Q$ with the monochrome diagonal. Now, returning the removed squares, we obtain a rectangle $(N-1) \times N$, and our aim is to supplement it on the top by one more flag. + +If $Q$ has a yellow diagonal, then we can take each flag with a yellow first square (it exists by a choice of the first column; moreover, it is not used in $Q$ ). Conversely, if the diagonal of $Q$ is blue then we can take any of the $\geq 2^{N-3}+1-(N-1)>0$ remaining good flags. So, in both cases we get a desired $N \times N$ square. + +Solution 2. We present a different proof of the estimate $M_{N} \leq 2^{N-2}+1$. We do not use the induction, involving Hall's lemma on matchings instead. + +Consider arbitrary $2^{N-2}+1$ distinct flags and arrange them into a large $\left(2^{N-2}+1\right) \times N$ flag. Construct two bipartite graphs $G_{\mathrm{y}}=\left(V \cup V^{\prime}, E_{\mathrm{y}}\right)$ and $G_{\mathrm{b}}=\left(V \cup V^{\prime}, E_{\mathrm{b}}\right)$ with the common set of vertices as follows. Let $V$ and $V^{\prime}$ be the set of columns and the set of flags under consideration, respectively. Next, let the edge $(c, f)$ appear in $E_{\mathrm{y}}$ if the intersection of column $c$ and flag $f$ is yellow, and $(c, f) \in E_{\mathrm{b}}$ otherwise. Then we have to prove exactly that one of the graphs $G_{\mathrm{y}}$ and $G_{\mathrm{b}}$ contains a matching with all the vertices of $V$ involved. + +Assume that these matchings do not exist. By Hall's lemma, it means that there exist two sets of columns $S_{\mathrm{y}}, S_{\mathrm{b}} \subset V$ such that $\left|E_{\mathrm{y}}\left(S_{\mathrm{y}}\right)\right| \leq\left|S_{\mathrm{y}}\right|-1$ and $\left|E_{\mathrm{b}}\left(S_{\mathrm{b}}\right)\right| \leq\left|S_{\mathrm{b}}\right|-1$ (in the left-hand sides, $E_{\mathrm{y}}\left(S_{\mathrm{y}}\right)$ and $E_{\mathrm{b}}\left(S_{\mathrm{b}}\right)$ denote respectively the sets of all vertices connected to $S_{\mathrm{y}}$ and $S_{\mathrm{b}}$ in the corresponding graphs). Our aim is to prove that this is impossible. Note that $S_{\mathrm{y}}, S_{\mathrm{b}} \neq V$ since $N \leq 2^{N-2}+1$. + +First, suppose that $S_{\mathrm{y}} \cap S_{\mathrm{b}} \neq \varnothing$, so there exists some $c \in S_{\mathrm{y}} \cap S_{\mathrm{b}}$. Note that each flag is connected to $c$ either in $G_{\mathrm{y}}$ or in $G_{\mathrm{b}}$, hence $E_{\mathrm{y}}\left(S_{\mathrm{y}}\right) \cup E_{\mathrm{b}}\left(S_{\mathrm{b}}\right)=V^{\prime}$. Hence we have $2^{N-2}+1=\left|V^{\prime}\right| \leq\left|E_{\mathrm{y}}\left(S_{\mathrm{y}}\right)\right|+\left|E_{\mathrm{b}}\left(S_{\mathrm{b}}\right)\right| \leq\left|S_{\mathrm{y}}\right|+\left|S_{\mathrm{b}}\right|-2 \leq 2 N-4$; this is impossible for $N \geq 4$. + +So, we have $S_{\mathrm{y}} \cap S_{\mathrm{b}}=\varnothing$. Let $y=\left|S_{\mathrm{y}}\right|, b=\left|S_{\mathrm{b}}\right|$. From the construction of our graph, we have that all the flags in the set $V^{\prime \prime}=V^{\prime} \backslash\left(E_{\mathrm{y}}\left(S_{\mathrm{y}}\right) \cup E_{\mathrm{b}}\left(S_{\mathrm{b}}\right)\right)$ have blue squares in the columns of $S_{\mathrm{y}}$ and yellow squares in the columns of $S_{\mathrm{b}}$. Hence the only undetermined positions in these flags are the remaining $N-y-b$ ones, so $2^{N-y-b} \geq\left|V^{\prime \prime}\right| \geq\left|V^{\prime}\right|-\left|E_{\mathrm{y}}\left(S_{\mathrm{y}}\right)\right|-\left|E_{\mathrm{b}}\left(S_{\mathrm{b}}\right)\right| \geq$ $2^{N-2}+1-(y-1)-(b-1)$, or, denoting $c=y+b, 2^{N-c}+c>2^{N-2}+2$. This is impossible since $N \geq c \geq 2$. + +C3. 2500 chess kings have to be placed on a $100 \times 100$ chessboard so that +(i) no king can capture any other one (i.e. no two kings are placed in two squares sharing a common vertex); +(ii) each row and each column contains exactly 25 kings. + +Find the number of such arrangements. (Two arrangements differing by rotation or symmetry are supposed to be different.) +(Russia) +Answer. There are two such arrangements. +Solution. Suppose that we have an arrangement satisfying the problem conditions. Divide the board into $2 \times 2$ pieces; we call these pieces blocks. Each block can contain not more than one king (otherwise these two kings would attack each other); hence, by the pigeonhole principle each block must contain exactly one king. + +Now assign to each block a letter T or B if a king is placed in its top or bottom half, respectively. Similarly, assign to each block a letter L or R if a king stands in its left or right half. So we define $T$-blocks, $B$-blocks, $L$-blocks, and $R$-blocks. We also combine the letters; we call a block a TL-block if it is simultaneously T-block and L-block. Similarly we define TR-blocks, $B L$-blocks, and BR-blocks. The arrangement of blocks determines uniquely the arrangement of kings; so in the rest of the solution we consider the $50 \times 50$ system of blocks (see Fig. 1). We identify the blocks by their coordinate pairs; the pair $(i, j)$, where $1 \leq i, j \leq 50$, refers to the $j$ th block in the $i$ th row (or the $i$ th block in the $j$ th column). The upper-left block is $(1,1)$. + +The system of blocks has the following properties.. +( $\left.\mathrm{i}^{\prime}\right)$ If $(i, j)$ is a B-block then $(i+1, j)$ is a B-block: otherwise the kings in these two blocks can take each other. Similarly: if $(i, j)$ is a T-block then $(i-1, j)$ is a T-block; if $(i, j)$ is an L-block then $(i, j-1)$ is an L-block; if $(i, j)$ is an R-block then $(i, j+1)$ is an R-block. +(ii') Each column contains exactly 25 L-blocks and 25 R-blocks, and each row contains exactly 25 T -blocks and 25 B-blocks. In particular, the total number of L-blocks (or R-blocks, or T-blocks, or B-blocks) is equal to $25 \cdot 50=1250$. + +Consider any B-block of the form $(1, j)$. By ( $\mathrm{i}^{\prime}$ ), all blocks in the $j$ th column are B-blocks; so we call such a column $B$-column. By (ii'), we have 25 B-blocks in the first row, so we obtain 25 B-columns. These 25 B-columns contain 1250 B-blocks, hence all blocks in the remaining columns are T-blocks, and we obtain 25 T-columns. Similarly, there are exactly $25 L$-rows and exactly $25 R$-rows. + +Now consider an arbitrary pair of a T-column and a neighboring B-column (columns with numbers $j$ and $j+1$ ). + + +Fig. 1 + + +Fig. 2 + +Case 1. Suppose that the $j$ th column is a T-column, and the $(j+1)$ th column is a Bcolumn. Consider some index $i$ such that the $i$ th row is an L-row; then $(i, j+1)$ is a BL-block. Therefore, $(i+1, j)$ cannot be a TR-block (see Fig. 2), hence $(i+1, j)$ is a TL-block, thus the +$(i+1)$ th row is an L-row. Now, choosing the $i$ th row to be the topmost L-row, we successively obtain that all rows from the $i$ th to the 50 th are L-rows. Since we have exactly 25 L-rows, it follows that the rows from the 1st to the 25 th are R-rows, and the rows from the 26 th to the 50th are L-rows. + +Now consider the neighboring R-row and L-row (that are the rows with numbers 25 and 26). Replacing in the previous reasoning rows by columns and vice versa, the columns from the 1 st to the 25 th are T-columns, and the columns from the 26 th to the 50 th are B-columns. So we have a unique arrangement of blocks that leads to the arrangement of kings satisfying the condition of the problem (see Fig. 3). + + +Fig. 3 + + +Fig. 4 + +Case 2. Suppose that the $j$ th column is a B-column, and the $(j+1)$ th column is a T-column. Repeating the arguments from Case 1, we obtain that the rows from the 1st to the 25th are L-rows (and all other rows are R-rows), the columns from the 1st to the 25 th are B-columns (and all other columns are T-columns), so we find exactly one more arrangement of kings (see Fig. 4). + +C4. Six stacks $S_{1}, \ldots, S_{6}$ of coins are standing in a row. In the beginning every stack contains a single coin. There are two types of allowed moves: +Move 1: If stack $S_{k}$ with $1 \leq k \leq 5$ contains at least one coin, you may remove one coin from $S_{k}$ and add two coins to $S_{k+1}$. +Move 2: If stack $S_{k}$ with $1 \leq k \leq 4$ contains at least one coin, then you may remove one coin from $S_{k}$ and exchange stacks $S_{k+1}$ and $S_{k+2}$. +Decide whether it is possible to achieve by a sequence of such moves that the first five stacks are empty, whereas the sixth stack $S_{6}$ contains exactly $2010^{2010^{2010}}$ coins. + +C4 ${ }^{\prime}$. Same as Problem C4, but the constant $2010^{2010^{2010}}$ is replaced by $2010^{2010}$. +(Netherlands) +Answer. Yes (in both variants of the problem). There exists such a sequence of moves. +Solution. Denote by $\left(a_{1}, a_{2}, \ldots, a_{n}\right) \rightarrow\left(a_{1}^{\prime}, a_{2}^{\prime}, \ldots, a_{n}^{\prime}\right)$ the following: if some consecutive stacks contain $a_{1}, \ldots, a_{n}$ coins, then it is possible to perform several allowed moves such that the stacks contain $a_{1}^{\prime}, \ldots, a_{n}^{\prime}$ coins respectively, whereas the contents of the other stacks remain unchanged. + +Let $A=2010^{2010}$ or $A=2010^{2010^{2010}}$, respectively. Our goal is to show that + +$$ +(1,1,1,1,1,1) \rightarrow(0,0,0,0,0, A) +$$ + +First we prove two auxiliary observations. +Lemma 1. $(a, 0,0) \rightarrow\left(0,2^{a}, 0\right)$ for every $a \geq 1$. +Proof. We prove by induction that $(a, 0,0) \rightarrow\left(a-k, 2^{k}, 0\right)$ for every $1 \leq k \leq a$. For $k=1$, apply Move 1 to the first stack: + +$$ +(a, 0,0) \rightarrow(a-1,2,0)=\left(a-1,2^{1}, 0\right) +$$ + +Now assume that $k0$, while in the latter one $S(T)=1^{3}+1^{3}+(-1)^{3}+(-1)^{3}=0$, as desired. + +Now we turn to the general problem. Consider a tournament $T$ with no bad companies and enumerate the players by the numbers from 1 to $n$. For every 4 players $i_{1}, i_{2}, i_{3}, i_{4}$ consider a "sub-tournament" $T_{i_{1} i_{2} i_{3} i_{4}}$ consisting of only these players and the games which they performed with each other. By the abovementioned, we have $S\left(T_{i_{1} i_{2} i_{3} i_{4}}\right) \geq 0$. Our aim is to prove that + +$$ +S(T)=\sum_{i_{1}, i_{2}, i_{3}, i_{4}} S\left(T_{i_{1} i_{2} i_{3} i_{4}}\right) +$$ + +where the sum is taken over all 4 -tuples of distinct numbers from the set $\{1, \ldots, n\}$. This way the problem statement will be established. + +We interpret the number $\left(w_{i}-\ell_{i}\right)^{3}$ as following. For $i \neq j$, let $\varepsilon_{i j}=1$ if the $i$ th player wins against the $j$ th one, and $\varepsilon_{i j}=-1$ otherwise. Then + +$$ +\left(w_{i}-\ell_{i}\right)^{3}=\left(\sum_{j \neq i} \varepsilon_{i j}\right)^{3}=\sum_{j_{1}, j_{2}, j_{3} \neq i} \varepsilon_{i j_{1}} \varepsilon_{i j_{2}} \varepsilon_{i j_{3}} . +$$ + +Hence, + +$$ +S(T)=\sum_{i \notin\left\{j_{1}, j_{2}, j_{3}\right\}} \varepsilon_{i j_{1}} \varepsilon_{i j_{2}} \varepsilon_{i j_{3}} +$$ + +To simplify this expression, consider all the terms in this sum where two indices are equal. If, for instance, $j_{1}=j_{2}$, then the term contains $\varepsilon_{i j_{1}}^{2}=1$, so we can replace this term by $\varepsilon_{i j_{3}}$. Make such replacements for each such term; obviously, after this change each term of the form $\varepsilon_{i j_{3}}$ will appear $P(T)$ times, hence + +$$ +S(T)=\sum_{\left|\left\{i, j_{1}, j_{2}, j_{3}\right\}\right|=4} \varepsilon_{i j_{1}} \varepsilon_{i j_{2}} \varepsilon_{i j_{3}}+P(T) \sum_{i \neq j} \varepsilon_{i j}=S_{1}(T)+P(T) S_{2}(T) +$$ + +We show that $S_{2}(T)=0$ and hence $S(T)=S_{1}(T)$ for each tournament. Actually, note that $\varepsilon_{i j}=-\varepsilon_{j i}$, and the whole sum can be split into such pairs. Since the sum in each pair is 0 , so is $S_{2}(T)$. + +Thus the desired equality (2) rewrites as + +$$ +S_{1}(T)=\sum_{i_{1}, i_{2}, i_{3}, i_{4}} S_{1}\left(T_{i_{1} i_{2} i_{3} i_{4}}\right) +$$ + +Now, if all the numbers $j_{1}, j_{2}, j_{3}$ are distinct, then the set $\left\{i, j_{1}, j_{2}, j_{3}\right\}$ is contained in exactly one 4 -tuple, hence the term $\varepsilon_{i j_{1}} \varepsilon_{i j_{2}} \varepsilon_{i j_{3}}$ appears in the right-hand part of (3) exactly once, as well as in the left-hand part. Clearly, there are no other terms in both parts, so the equality is established. + +Solution 2. Similarly to the first solution, we call the subsets of players as companies, and the $k$-element subsets will be called as $k$-companies. + +In any company of the players, call a player the local champion of the company if he defeated all other members of the company. Similarly, if a player lost all his games against the others in the company then call him the local loser of the company. Obviously every company has at most one local champion and at most one local loser. By the condition of the problem, whenever a 4-company has a local loser, then this company has a local champion as well. + +Suppose that $k$ is some positive integer, and let us count all cases when a player is the local champion of some $k$-company. The $i$ th player won against $w_{i}$ other player. To be the local champion of a $k$-company, he must be a member of the company, and the other $k-1$ members must be chosen from those whom he defeated. Therefore, the $i$ th player is the local champion of $\binom{w_{i}}{k-1} k$-companies. Hence, the total number of local champions of all $k$-companies is $\sum_{i=1}^{n}\binom{w_{i}}{k-1}$. + +Similarly, the total number of local losers of the $k$-companies is $\sum_{i=1}^{n}\binom{\ell_{i}}{k-1}$. +Now apply this for $k=2,3$ and 4. +Since every game has a winner and a loser, we have $\sum_{i=1}^{n} w_{i}=\sum_{i=1}^{n} \ell_{i}=\binom{n}{2}$, and hence + +$$ +\sum_{i=1}^{n}\left(w_{i}-\ell_{i}\right)=0 +$$ + +In every 3-company, either the players defeated one another in a cycle or the company has both a local champion and a local loser. Therefore, the total number of local champions and local losers in the 3-companies is the same, $\sum_{i=1}^{n}\binom{w_{i}}{2}=\sum_{i=1}^{n}\binom{\ell_{i}}{2}$. So we have + +$$ +\sum_{i=1}^{n}\left(\binom{w_{i}}{2}-\binom{\ell_{i}}{2}\right)=0 +$$ + +In every 4-company, by the problem's condition, the number of local losers is less than or equal to the number of local champions. Then the same holds for the total numbers of local +champions and local losers in all 4-companies, so $\sum_{i=1}^{n}\binom{w_{i}}{3} \geq \sum_{i=1}^{n}\binom{\ell_{i}}{3}$. Hence, + +$$ +\sum_{i=1}^{n}\left(\binom{w_{i}}{3}-\binom{\ell_{i}}{3}\right) \geq 0 +$$ + +Now we establish the problem statement (1) as a linear combination of (4), (5) and (6). It is easy check that + +$$ +(x-y)^{3}=24\left(\binom{x}{3}-\binom{y}{3}\right)+24\left(\binom{x}{2}-\binom{y}{2}\right)-\left(3(x+y)^{2}-4\right)(x-y) +$$ + +Apply this identity to $x=w_{1}$ and $y=\ell_{i}$. Since every player played $n-1$ games, we have $w_{i}+\ell_{i}=n-1$, and thus + +$$ +\left(w_{i}-\ell_{i}\right)^{3}=24\left(\binom{w_{i}}{3}-\binom{\ell_{i}}{3}\right)+24\left(\binom{w_{i}}{2}-\binom{\ell_{i}}{2}\right)-\left(3(n-1)^{2}-4\right)\left(w_{i}-\ell_{i}\right) +$$ + +Then + +$$ +\sum_{i=1}^{n}\left(w_{i}-\ell_{i}\right)^{3}=24 \underbrace{\sum_{i=1}^{n}\left(\binom{w_{i}}{3}-\binom{\ell_{i}}{3}\right)}_{\geq 0}+24 \underbrace{\sum_{i=1}^{n}\left(\binom{w_{i}}{2}-\binom{\ell_{i}}{2}\right)}_{0}-\left(3(n-1)^{2}-4\right) \underbrace{\sum_{i=1}^{n}\left(w_{i}-\ell_{i}\right)}_{0} \geq 0 +$$ + +C6. Given a positive integer $k$ and other two integers $b>w>1$. There are two strings of pearls, a string of $b$ black pearls and a string of $w$ white pearls. The length of a string is the number of pearls on it. + +One cuts these strings in some steps by the following rules. In each step: +(i) The strings are ordered by their lengths in a non-increasing order. If there are some strings of equal lengths, then the white ones precede the black ones. Then $k$ first ones (if they consist of more than one pearl) are chosen; if there are less than $k$ strings longer than 1 , then one chooses all of them. +(ii) Next, one cuts each chosen string into two parts differing in length by at most one. +(For instance, if there are strings of $5,4,4,2$ black pearls, strings of $8,4,3$ white pearls and $k=4$, then the strings of 8 white, 5 black, 4 white and 4 black pearls are cut into the parts $(4,4),(3,2),(2,2)$ and $(2,2)$, respectively.) + +The process stops immediately after the step when a first isolated white pearl appears. Prove that at this stage, there will still exist a string of at least two black pearls. +(Canada) +Solution 1. Denote the situation after the $i$ th step by $A_{i}$; hence $A_{0}$ is the initial situation, and $A_{i-1} \rightarrow A_{i}$ is the $i$ th step. We call a string containing $m$ pearls an $m$-string; it is an $m$-w-string or a $m$-b-string if it is white or black, respectively. + +We continue the process until every string consists of a single pearl. We will focus on three moments of the process: (a) the first stage $A_{s}$ when the first 1 -string (no matter black or white) appears; (b) the first stage $A_{t}$ where the total number of strings is greater than $k$ (if such moment does not appear then we put $t=\infty$ ); and (c) the first stage $A_{f}$ when all black pearls are isolated. It is sufficient to prove that in $A_{f-1}$ (or earlier), a 1-w-string appears. + +We start with some easy properties of the situations under consideration. Obviously, we have $s \leq f$. Moreover, all b-strings from $A_{f-1}$ become single pearls in the $f$ th step, hence all of them are 1- or 2-b-strings. + +Next, observe that in each step $A_{i} \rightarrow A_{i+1}$ with $i \leq t-1$, all $(>1)$-strings were cut since there are not more than $k$ strings at all; if, in addition, $i1$ as $s-1 \leq \min \{s, t\}$. Now, if $s=f$, then in $A_{s-1}$, there is no 1 -w-string as well as no ( $>2$ )-b-string. That is, $2=B_{s-1} \geq W_{s-1} \geq b_{s-1} \geq w_{s-1}>1$, hence all these numbers equal 2 . This means that in $A_{s-1}$, all strings contain 2 pearls, and there are $2^{s-1}$ black and $2^{s-1}$ white strings, which means $b=2 \cdot 2^{s-1}=w$. This contradicts the problem conditions. + +Hence we have $s \leq f-1$ and thus $s \leq t$. Therefore, in the $s$ th step each string is cut into two parts. Now, if a 1-b-string appears in this step, then from $w_{s-1} \leq b_{s-1}$ we see that a + +1-w-string appears as well; so, in each case in the sth step a 1-w-string appears, while not all black pearls become single, as desired. + +Case 2. Now assume that $t+1 \leq s$ and $t+2 \leq f$. Then in $A_{t}$ we have exactly $2^{t}$ white and $2^{t}$ black strings, all being larger than 1 , and $2^{t+1}>k \geq 2^{t}$ (the latter holds since $2^{t}$ is the total number of strings in $A_{t-1}$ ). Now, in the $(t+1)$ st step, exactly $k$ strings are cut, not more than $2^{t}$ of them being black; so the number of w-strings in $A_{t+1}$ is at least $2^{t}+\left(k-2^{t}\right)=k$. Since the number of w-strings does not decrease in our process, in $A_{f-1}$ we have at least $k$ white strings as well. + +Finally, in $A_{f-1}$, all b-strings are not larger than 2, and at least one 2-b-string is cut in the $f$ th step. Therefore, at most $k-1$ white strings are cut in this step, hence there exists a w-string $\mathcal{W}$ which is not cut in the $f$ th step. On the other hand, since a 2 -b-string is cut, all $(\geq 2)$-w-strings should also be cut in the $f$ th step; hence $\mathcal{W}$ should be a single pearl. This is exactly what we needed. + +Comment. In this solution, we used the condition $b \neq w$ only to avoid the case $b=w=2^{t}$. Hence, if a number $b=w$ is not a power of 2 , then the problem statement is also valid. + +Solution 2. We use the same notations as introduced in the first paragraph of the previous solution. We claim that at every stage, there exist a $u$-b-string and a $v$-w-string such that either +(i) $u>v \geq 1$, or +(ii) $2 \leq u \leq v<2 u$, and there also exist $k-1$ of ( $>v / 2$ )-strings other than considered above. + +First, we notice that this statement implies the problem statement. Actually, in both cases (i) and (ii) we have $u>1$, so at each stage there exists a ( $\geq 2$ )-b-string, and for the last stage it is exactly what we need. + +Now, we prove the claim by induction on the number of the stage. Obviously, for $A_{0}$ the condition (i) holds since $b>w$. Further, we suppose that the statement holds for $A_{i}$, and prove it for $A_{i+1}$. Two cases are possible. + +Case 1. Assume that in $A_{i}$, there are a $u$-b-string and a $v$-w-string with $u>v$. We can assume that $v$ is the length of the shortest w-string in $A_{i}$; since we are not at the final stage, we have $v \geq 2$. Now, in the $(i+1)$ st step, two subcases may occur. + +Subcase 1a. Suppose that either no $u$-b-string is cut, or both some $u$-b-string and some $v$-w-string are cut. Then in $A_{i+1}$, we have either a $u$-b-string and a $(\leq v)$-w-string (and (i) is valid), or we have a $\lceil u / 2\rceil$-b-string and a $\lfloor v / 2\rfloor$-w-string. In the latter case, from $u>v$ we get $\lceil u / 2\rceil>\lfloor v / 2\rfloor$, and (i) is valid again. + +Subcase $1 b$. Now, some $u$-b-string is cut, and no $v$-w-string is cut (and hence all the strings which are cut are longer than $v$ ). If $u^{\prime}=\lceil u / 2\rceil>v$, then the condition (i) is satisfied since we have a $u^{\prime}$-b-string and a $v$-w-string in $A_{i+1}$. Otherwise, notice that the inequality $u>v \geq 2$ implies $u^{\prime} \geq 2$. Furthermore, besides a fixed $u$-b-string, other $k-1$ of $(\geq v+1)$-strings should be cut in the $(i+1)$ st step, hence providing at least $k-1$ of $(\geq\lceil(v+1) / 2\rceil)$-strings, and $\lceil(v+1) / 2\rceil>v / 2$. So, we can put $v^{\prime}=v$, and we have $u^{\prime} \leq vv$, so each one results in a ( $>v / 2$ )string. Hence in $A_{i+1}$, there exist $k \geq k-1$ of $(>v / 2)$-strings other than the considered $u$ - and $v$-strings, and the condition (ii) is satisfied. + +Subcase 2c. In the remaining case, all $u$-b-strings are cut. This means that all $(\geq u)$-strings are cut as well, hence our $v$-w-string is cut. Therefore in $A_{i+1}$ there exists a $\lceil u / 2\rceil$-b-string together with a $\lfloor v / 2\rfloor$-w-string. Now, if $u^{\prime}=\lceil u / 2\rceil>\lfloor v / 2\rfloor=v^{\prime}$ then the condition (i) is fulfilled. Otherwise, we have $u^{\prime} \leq v^{\prime}$ $|f(W)|$; if there is no such set then we set $W=\varnothing$. Denote $W^{\prime}=f(W), U=V \backslash W, U^{\prime}=V^{\prime} \backslash W^{\prime}$. + +By our assumption and the Lemma condition, $|f(V)|=\left|V^{\prime}\right| \geq|V|$, hence $W \neq V$ and $U \neq \varnothing$. Permuting the coordinates, we can assume that $U^{\prime}=\left\{v_{i j}: 1 \leq i \leq \ell\right\}, W^{\prime}=\left\{v_{i j}: \ell+1 \leq i \leq k\right\}$. + +Consider the induced subgraph $G^{\prime}$ of $G$ on the vertices $U \cup U^{\prime}$. We claim that for every $X \subset U$, we get $\left|f(X) \cap U^{\prime}\right| \geq|X|$ (so $G^{\prime}$ satisfies the conditions of Hall's lemma). Actually, we have $|W| \geq|f(W)|$, so if $|X|>\left|f(X) \cap U^{\prime}\right|$ for some $X \subset U$, then we have + +$$ +|W \cup X|=|W|+|X|>|f(W)|+\left|f(X) \cap U^{\prime}\right|=\left|f(W) \cup\left(f(X) \cap U^{\prime}\right)\right|=|f(W \cup X)| +$$ + +This contradicts the maximality of $|W|$. +Thus, applying Hall's lemma, we can assign to each $L \in U$ some vertex $v_{i j} \in U^{\prime}$ so that to distinct elements of $U$, distinct vertices of $U^{\prime}$ are assigned. In this situation, we say that $L \in U$ corresponds to the $i$ th axis, and write $g(L)=i$. Since there are $n_{i}-1$ vertices of the form $v_{i j}$, we get that for each $1 \leq i \leq \ell$, not more than $n_{i}-1$ subgrids correspond to the $i$ th axis. + +Finally, we are ready to present the desired point. Since $W \neq V$, there exists a point $b=\left(b_{1}, b_{2}, \ldots, b_{k}\right) \in N \backslash\left(\cup_{L \in W} L\right)$. On the other hand, for every $1 \leq i \leq \ell$, consider any subgrid $L \in U$ with $g(L)=i$. This means exactly that $L$ is orthogonal to the $i$ th axis, and hence all its elements have the same $i$ th coordinate $c_{L}$. Since there are at most $n_{i}-1$ such subgrids, there exists a number $0 \leq a_{i} \leq n_{i}-1$ which is not contained in a set $\left\{c_{L}: g(L)=i\right\}$. Choose such number for every $1 \leq i \leq \ell$. Now we claim that point $a=\left(a_{1}, \ldots, a_{\ell}, b_{\ell+1}, \ldots, b_{k}\right)$ is not covered, hence contradicting the Lemma condition. + +Surely, point $a$ cannot lie in some $L \in U$, since all the points in $L$ have $g(L)$ th coordinate $c_{L} \neq a_{g(L)}$. On the other hand, suppose that $a \in L$ for some $L \in W$; recall that $b \notin L$. But the points $a$ and $b$ differ only at first $\ell$ coordinates, so $L$ should be orthogonal to at least one of the first $\ell$ axes, and hence our graph contains some edge $\left(L, v_{i j}\right)$ for $i \leq \ell$. It contradicts the definition of $W^{\prime}$. The Lemma is proved. + +Now we turn to the problem. Let $d_{j}$ be the step of the progression $P_{j}$. Note that since $n=$ l.c.m. $\left(d_{1}, \ldots, d_{s}\right)$, for each $1 \leq i \leq k$ there exists an index $j(i)$ such that $p_{i}^{\alpha_{i}} \mid d_{j(i)}$. We assume that $n>1$; otherwise the problem statement is trivial. + +For each $0 \leq m \leq n-1$ and $1 \leq i \leq k$, let $m_{i}$ be the residue of $m$ modulo $p_{i}^{\alpha_{i}}$, and let $m_{i}=\overline{r_{i \alpha_{i}} \ldots r_{i 1}}$ be the base $p_{i}$ representation of $m_{i}$ (possibly, with some leading zeroes). Now, we put into correspondence to $m$ the sequence $r(m)=\left(r_{11}, \ldots, r_{1 \alpha_{1}}, r_{21}, \ldots, r_{k \alpha_{k}}\right)$. Hence $r(m)$ lies in a $\underbrace{p_{1} \times \cdots \times p_{1}}_{\alpha_{1} \text { times }} \times \cdots \times \underbrace{p_{k} \times \cdots \times p_{k}}_{\alpha_{k} \text { times }}$ grid $N$. + +Surely, if $r(m)=r\left(m^{\prime}\right)$ then $p_{i}^{\alpha_{i}} \mid m_{i}-m_{i}^{\prime}$, which follows $p_{i}^{\alpha_{i}} \mid m-m^{\prime}$ for all $1 \leq i \leq k$; consequently, $n \mid m-m^{\prime}$. So, when $m$ runs over the set $\{0, \ldots, n-1\}$, the sequences $r(m)$ do not repeat; since $|N|=n$, this means that $r$ is a bijection between $\{0, \ldots, n-1\}$ and $N$. Now we will show that for each $1 \leq i \leq s$, the set $L_{i}=\left\{r(m): m \in P_{i}\right\}$ is a subgrid, and that for each axis there exists a subgrid orthogonal to this axis. Obviously, these subgrids cover $N$, and the condition (ii') follows directly from (ii). Hence the Lemma provides exactly the estimate we need. + +Consider some $1 \leq j \leq s$ and let $d_{j}=p_{1}^{\gamma_{1}} \ldots p_{k}^{\gamma_{k}}$. Consider some $q \in P_{j}$ and let $r(q)=$ $\left(r_{11}, \ldots, r_{k \alpha_{k}}\right)$. Then for an arbitrary $q^{\prime}$, setting $r\left(q^{\prime}\right)=\left(r_{11}^{\prime}, \ldots, r_{k \alpha_{k}}^{\prime}\right)$ we have + +$$ +q^{\prime} \in P_{j} \quad \Longleftrightarrow \quad p_{i}^{\gamma_{i}} \mid q-q^{\prime} \text { for each } 1 \leq i \leq k \quad \Longleftrightarrow \quad r_{i, t}=r_{i, t}^{\prime} \text { for all } t \leq \gamma_{i} +$$ + +Hence $L_{j}=\left\{\left(r_{11}^{\prime}, \ldots, r_{k \alpha_{k}}^{\prime}\right) \in N: r_{i, t}=r_{i, t}^{\prime}\right.$ for all $\left.t \leq \gamma_{i}\right\}$ which means that $L_{j}$ is a subgrid containing $r(q)$. Moreover, in $L_{j(i)}$, all the coordinates corresponding to $p_{i}$ are fixed, so it is orthogonal to all of their axes, as desired. + +Comment 1. The estimate in the problem is sharp for every $n$. One of the possible examples is the following one. For each $1 \leq i \leq k, 0 \leq j \leq \alpha_{i}-1,1 \leq k \leq p-1$, let + +$$ +P_{i, j, k}=k p_{i}^{j}+p_{i}^{j+1} \mathbb{Z} +$$ + +and add the progression $P_{0}=n \mathbb{Z}$. One can easily check that this set satisfies all the problem conditions. There also exist other examples. + +On the other hand, the estimate can be adjusted in the following sense. For every $1 \leq i \leq k$, let $0=\alpha_{i 0}, \alpha_{i 1}, \ldots, \alpha_{i h_{i}}$ be all the numbers of the form $\operatorname{ord}_{p_{i}}\left(d_{j}\right)$ in an increasing order (we delete the repeating occurences of a number, and add a number $0=\alpha_{i 0}$ if it does not occur). Then, repeating the arguments from the solution one can obtain that + +$$ +s \geq 1+\sum_{i=1}^{k} \sum_{j=1}^{h_{i}}\left(p^{\alpha_{j}-\alpha_{j-1}}-1\right) +$$ + +Note that $p^{\alpha}-1 \geq \alpha(p-1)$, and the equality is achieved only for $\alpha=1$. Hence, for reaching the minimal number of the progressions, one should have $\alpha_{i, j}=j$ for all $i, j$. In other words, for each $1 \leq j \leq \alpha_{i}$, there should be an index $t$ such that $\operatorname{ord}_{p_{i}}\left(d_{t}\right)=j$. + +Solution 2. We start with introducing some notation. For positive integer $r$, we denote $[r]=\{1,2, \ldots, r\}$. Next, we say that a set of progressions $\mathcal{P}=\left\{P_{1}, \ldots, P_{s}\right\}$ cover $\mathbb{Z}$ if each integer belongs to some of them; we say that this covering is minimal if no proper subset of $\mathcal{P}$ covers $\mathbb{Z}$. Obviously, each covering contains a minimal subcovering. + +Next, for a minimal covering $\left\{P_{1}, \ldots, P_{s}\right\}$ and for every $1 \leq i \leq s$, let $d_{i}$ be the step of progression $P_{i}$, and $h_{i}$ be some number which is contained in $P_{i}$ but in none of the other progressions. We assume that $n>1$, otherwise the problem is trivial. This implies $d_{i}>1$, otherwise the progression $P_{i}$ covers all the numbers, and $n=1$. + +We will prove a more general statement, namely the following +Claim. Assume that the progressions $P_{1}, \ldots, P_{s}$ and number $n=p_{1}^{\alpha_{1}} \ldots p_{k}^{\alpha_{k}}>1$ are chosen as in the problem statement. Moreover, choose some nonempty set of indices $I=\left\{i_{1}, \ldots, i_{t}\right\} \subseteq[k]$ and some positive integer $\beta_{i} \leq \alpha_{i}$ for every $i \in I$. Consider the set of indices + +$$ +T=\left\{j: 1 \leq j \leq s, \text { and } p_{i}^{\alpha_{i}-\beta_{i}+1} \mid d_{j} \text { for some } i \in I\right\} +$$ + +Then + +$$ +|T| \geq 1+\sum_{i \in I} \beta_{i}\left(p_{i}-1\right) +$$ + +Observe that the Claim for $I=[k]$ and $\beta_{i}=\alpha_{i}$ implies the problem statement, since the left-hand side in (2) is not greater than $s$. Hence, it suffices to prove the Claim. + +1. First, we prove the Claim assuming that all $d_{j}$ 's are prime numbers. If for some $1 \leq i \leq k$ we have at least $p_{i}$ progressions with the step $p_{i}$, then they do not intersect and hence cover all the integers; it means that there are no other progressions, and $n=p_{i}$; the Claim is trivial in this case. + +Now assume that for every $1 \leq i \leq k$, there are not more than $p_{i}-1$ progressions with step $p_{i}$; each such progression covers the numbers with a fixed residue modulo $p_{i}$, therefore there exists a residue $q_{i} \bmod p_{i}$ which is not touched by these progressions. By the Chinese Remainder Theorem, there exists a number $q$ such that $q \equiv q_{i}\left(\bmod p_{i}\right)$ for all $1 \leq i \leq k$; this number cannot be covered by any progression with step $p_{i}$, hence it is not covered at all. A contradiction. +2. Now, we assume that the general Claim is not valid, and hence we consider a counterexample $\left\{P_{1}, \ldots, P_{s}\right\}$ for the Claim; we can choose it to be minimal in the following sense: + +- the number $n$ is minimal possible among all the counterexamples; +- the sum $\sum_{i} d_{i}$ is minimal possible among all the counterexamples having the chosen value of $n$. + +As was mentioned above, not all numbers $d_{i}$ are primes; hence we can assume that $d_{1}$ is composite, say $p_{1} \mid d_{1}$ and $d_{1}^{\prime}=\frac{d_{1}}{p_{1}}>1$. Consider a progression $P_{1}^{\prime}$ having the step $d_{1}^{\prime}$, and containing $P_{1}$. We will focus on two coverings constructed as follows. +(i) Surely, the progressions $P_{1}^{\prime}, P_{2}, \ldots, P_{s}$ cover $\mathbb{Z}$, though this covering in not necessarily minimal. So, choose some minimal subcovering $\mathcal{P}^{\prime}$ in it; surely $P_{1}^{\prime} \in \mathcal{P}^{\prime}$ since $h_{1}$ is not covered by $P_{2}, \ldots, P_{s}$, so we may assume that $\mathcal{P}^{\prime}=\left\{P_{1}^{\prime}, P_{2}, \ldots, P_{s^{\prime}}\right\}$ for some $s^{\prime} \leq s$. Furthermore, the period of the covering $\mathcal{P}^{\prime}$ can appear to be less than $n$; so we denote this period by + +$$ +n^{\prime}=p_{1}^{\alpha_{1}-\sigma_{1}} \ldots p_{k}^{\alpha_{k}-\sigma_{k}}=\text { l.c.m. }\left(d_{1}^{\prime}, d_{2}, \ldots, d_{s^{\prime}}\right) +$$ + +Observe that for each $P_{j} \notin \mathcal{P}^{\prime}$, we have $h_{j} \in P_{1}^{\prime}$, otherwise $h_{j}$ would not be covered by $\mathcal{P}$. +(ii) On the other hand, each nonempty set of the form $R_{i}=P_{i} \cap P_{1}^{\prime}(1 \leq i \leq s)$ is also a progression with a step $r_{i}=$ l.c.m. $\left(d_{i}, d_{1}^{\prime}\right)$, and such sets cover $P_{1}^{\prime}$. Scaling these progressions with the ratio $1 / d_{1}^{\prime}$, we obtain the progressions $Q_{i}$ with steps $q_{i}=r_{i} / d_{1}^{\prime}$ which cover $\mathbb{Z}$. Now we choose a minimal subcovering $\mathcal{Q}$ of this covering; again we should have $Q_{1} \in \mathcal{Q}$ by the reasons of $h_{1}$. Now, denote the period of $\mathcal{Q}$ by + +$$ +n^{\prime \prime}=\text { l.c.m. }\left\{q_{i}: Q_{i} \in \mathcal{Q}\right\}=\frac{\text { l.c.m. }\left\{r_{i}: Q_{i} \in \mathcal{Q}\right\}}{d_{1}^{\prime}}=\frac{p_{1}^{\gamma_{1}} \ldots p_{k}^{\gamma_{k}}}{d_{1}^{\prime}} +$$ + +Note that if $h_{j} \in P_{1}^{\prime}$, then the image of $h_{j}$ under the scaling can be covered by $Q_{j}$ only; so, in this case we have $Q_{j} \in \mathcal{Q}$. + +Our aim is to find the desired number of progressions in coverings $\mathcal{P}$ and $\mathcal{Q}$. First, we have $n \geq n^{\prime}$, and the sum of the steps in $\mathcal{P}^{\prime}$ is less than that in $\mathcal{P}$; hence the Claim is valid for $\mathcal{P}^{\prime}$. We apply it to the set of indices $I^{\prime}=\left\{i \in I: \beta_{i}>\sigma_{i}\right\}$ and the exponents $\beta_{i}^{\prime}=\beta_{i}-\sigma_{i}$; hence the set under consideration is + +$$ +T^{\prime}=\left\{j: 1 \leq j \leq s^{\prime}, \text { and } p_{i}^{\left(\alpha_{i}-\sigma_{i}\right)-\beta_{i}^{\prime}+1}=p_{i}^{\alpha_{i}-\beta_{i}+1} \mid d_{j} \text { for some } i \in I^{\prime}\right\} \subseteq T \cap\left[s^{\prime}\right], +$$ + +and we obtain that + +$$ +\left|T \cap\left[s^{\prime}\right]\right| \geq\left|T^{\prime}\right| \geq 1+\sum_{i \in I^{\prime}}\left(\beta_{i}-\sigma_{i}\right)\left(p_{i}-1\right)=1+\sum_{i \in I}\left(\beta_{i}-\sigma_{i}\right)_{+}\left(p_{i}-1\right) +$$ + +where $(x)_{+}=\max \{x, 0\}$; the latter equality holds as for $i \notin I^{\prime}$ we have $\beta_{i} \leq \sigma_{i}$. +Observe that $x=(x-y)_{+}+\min \{x, y\}$ for all $x, y$. So, if we find at least + +$$ +G=\sum_{i \in I} \min \left\{\beta_{i}, \sigma_{i}\right\}\left(p_{i}-1\right) +$$ + +indices in $T \cap\left\{s^{\prime}+1, \ldots, s\right\}$, then we would have + +$$ +|T|=\left|T \cap\left[s^{\prime}\right]\right|+\left|T \cap\left\{s^{\prime}+1, \ldots, s\right\}\right| \geq 1+\sum_{i \in I}\left(\left(\beta_{i}-\sigma_{i}\right)_{+}+\min \left\{\beta_{i}, \sigma_{i}\right\}\right)\left(p_{i}-1\right)=1+\sum_{i \in I} \beta_{i}\left(p_{i}-1\right) +$$ + +thus leading to a contradiction with the choice of $\mathcal{P}$. We will find those indices among the indices of progressions in $\mathcal{Q}$. +3. Now denote $I^{\prime \prime}=\left\{i \in I: \sigma_{i}>0\right\}$ and consider some $i \in I^{\prime \prime}$; then $p_{i}^{\alpha_{i}} \nmid n^{\prime}$. On the other hand, there exists an index $j(i)$ such that $p_{i}^{\alpha_{i}} \mid d_{j(i)}$; this means that $d_{j(i)} \backslash n^{\prime}$ and hence $P_{j(i)}$ cannot appear in $\mathcal{P}^{\prime}$, so $j(i)>s^{\prime}$. Moreover, we have observed before that in this case $h_{j(i)} \in P_{1}^{\prime}$, hence $Q_{j(i)} \in \mathcal{Q}$. This means that $q_{j(i)} \mid n^{\prime \prime}$, therefore $\gamma_{i}=\alpha_{i}$ for each $i \in I^{\prime \prime}$ (recall here that $q_{i}=r_{i} / d_{1}^{\prime}$ and hence $\left.d_{j(i)}\left|r_{j(i)}\right| d_{1}^{\prime} n^{\prime \prime}\right)$. + +Let $d_{1}^{\prime}=p_{1}^{\tau_{1}} \ldots p_{k}^{\tau_{k}}$. Then $n^{\prime \prime}=p_{1}^{\gamma_{1}-\tau_{1}} \ldots p_{k}^{\gamma_{i}-\tau_{i}}$. Now, if $i \in I^{\prime \prime}$, then for every $\beta$ the condition $p_{i}^{\left(\gamma_{i}-\tau_{i}\right)-\beta+1} \mid q_{j}$ is equivalent to $p_{i}^{\alpha_{i}-\beta+1} \mid r_{j}$. + +Note that $n^{\prime \prime} \leq n / d_{1}^{\prime}0$. So, the set under consideration is + +$$ +\begin{aligned} +T^{\prime \prime} & =\left\{j: Q_{j} \in \mathcal{Q}, \text { and } p_{i}^{\left(\gamma_{i}-\tau_{i}\right)-\min \left\{\beta_{i}, \sigma_{i}\right\}+1} \mid q_{j} \text { for some } i \in I^{\prime \prime}\right\} \\ +& =\left\{j: Q_{j} \in \mathcal{Q}, \text { and } p_{i}^{\alpha_{i}-\min \left\{\beta_{i}, \sigma_{i}\right\}+1} \mid r_{j} \text { for some } i \in I^{\prime \prime}\right\}, +\end{aligned} +$$ + +and we obtain $\left|T^{\prime \prime}\right| \geq 1+G$. Finally, we claim that $T^{\prime \prime} \subseteq T \cap\left(\{1\} \cup\left\{s^{\prime}+1, \ldots, s\right\}\right)$; then we will obtain $\left|T \cap\left\{s^{\prime}+1, \ldots, s\right\}\right| \geq G$, which is exactly what we need. + +To prove this, consider any $j \in T^{\prime \prime}$. Observe first that $\alpha_{i}-\min \left\{\beta_{i}, \sigma_{i}\right\}+1>\alpha_{i}-\sigma_{i} \geq \tau_{i}$, hence from $p_{i}^{\alpha_{i}-\min \left\{\beta_{i}, \sigma_{i}\right\}+1} \mid r_{j}=$ l.c.m. $\left(d_{1}^{\prime}, d_{j}\right)$ we have $p_{i}^{\alpha_{i}-\min \left\{\beta_{i}, \sigma_{i}\right\}+1} \mid d_{j}$, which means that $j \in T$. Next, the exponent of $p_{i}$ in $d_{j}$ is greater than that in $n^{\prime}$, which means that $P_{j} \notin \mathcal{P}^{\prime}$. This may appear only if $j=1$ or $j>s^{\prime}$, as desired. This completes the proof. + +Comment 2. A grid analogue of the Claim is also valid. It reads as following. +Claim. Assume that the grid $N$ is covered by subgrids $L_{1}, L_{2}, \ldots, L_{s}$ so that +(ii') each subgrid contains a point which is not covered by other subgrids; +(iii) for each coordinate axis, there exists a subgrid $L_{i}$ orthogonal to this axis. + +Choose some set of indices $I=\left\{i_{1}, \ldots, i_{t}\right\} \subset[k]$, and consider the set of indices + +$$ +T=\left\{j: 1 \leq j \leq s \text {, and } L_{j} \text { is orthogonal to the } i \text { th axis for some } i \in I\right\} +$$ + +Then + +$$ +|T| \geq 1+\sum_{i \in I}\left(n_{i}-1\right) +$$ + +This Claim may be proved almost in the same way as in Solution 1. + +## Geometry + +G1. Let $A B C$ be an acute triangle with $D, E, F$ the feet of the altitudes lying on $B C, C A, A B$ respectively. One of the intersection points of the line $E F$ and the circumcircle is $P$. The lines $B P$ and $D F$ meet at point $Q$. Prove that $A P=A Q$. +(United Kingdom) +Solution 1. The line $E F$ intersects the circumcircle at two points. Depending on the choice of $P$, there are two different cases to consider. + +Case 1: The point $P$ lies on the ray $E F$ (see Fig. 1). +Let $\angle C A B=\alpha, \angle A B C=\beta$ and $\angle B C A=\gamma$. The quadrilaterals $B C E F$ and $C A F D$ are cyclic due to the right angles at $D, E$ and $F$. So, + +$$ +\begin{aligned} +& \angle B D F=180^{\circ}-\angle F D C=\angle C A F=\alpha, \\ +& \angle A F E=180^{\circ}-\angle E F B=\angle B C E=\gamma, \\ +& \angle D F B=180^{\circ}-\angle A F D=\angle D C A=\gamma . +\end{aligned} +$$ + +Since $P$ lies on the arc $A B$ of the circumcircle, $\angle P B A<\angle B C A=\gamma$. Hence, we have + +$$ +\angle P B D+\angle B D F=\angle P B A+\angle A B D+\angle B D F<\gamma+\beta+\alpha=180^{\circ}, +$$ + +and the point $Q$ must lie on the extensions of $B P$ and $D F$ beyond the points $P$ and $F$, respectively. + +From the cyclic quadrilateral $A P B C$ we get + +$$ +\angle Q P A=180^{\circ}-\angle A P B=\angle B C A=\gamma=\angle D F B=\angle Q F A . +$$ + +Hence, the quadrilateral $A Q P F$ is cyclic. Then $\angle A Q P=180^{\circ}-\angle P F A=\angle A F E=\gamma$. +We obtained that $\angle A Q P=\angle Q P A=\gamma$, so the triangle $A Q P$ is isosceles, $A P=A Q$. + + +Fig. 1 + + +Fig. 2 + +Case 2: The point $P$ lies on the ray $F E$ (see Fig. 2). In this case the point $Q$ lies inside the segment $F D$. + +Similarly to the first case, we have + +$$ +\angle Q P A=\angle B C A=\gamma=\angle D F B=180^{\circ}-\angle A F Q +$$ + +Hence, the quadrilateral $A F Q P$ is cyclic. +Then $\angle A Q P=\angle A F P=\angle A F E=\gamma=\angle Q P A$. The triangle $A Q P$ is isosceles again, $\angle A Q P=\angle Q P A$ and thus $A P=A Q$. +Comment. Using signed angles, the two possible configurations can be handled simultaneously, without investigating the possible locations of $P$ and $Q$. + +Solution 2. For arbitrary points $X, Y$ on the circumcircle, denote by $\widehat{X Y}$ the central angle of the arc $X Y$. + +Let $P$ and $P^{\prime}$ be the two points where the line $E F$ meets the circumcircle; let $P$ lie on the $\operatorname{arc} A B$ and let $P^{\prime}$ lie on the $\operatorname{arc} C A$. Let $B P$ and $B P^{\prime}$ meet the line $D F$ and $Q$ and $Q^{\prime}$, respectively (see Fig. 3). We will prove that $A P=A P^{\prime}=A Q=A Q^{\prime}$. + + +Fig. 3 +Like in the first solution, we have $\angle A F E=\angle B F P=\angle D F B=\angle B C A=\gamma$ from the cyclic quadrilaterals $B C E F$ and $C A F D$. + +By $\overparen{P B}+\overparen{P^{\prime} A}=2 \angle A F P^{\prime}=2 \gamma=2 \angle B C A=\overparen{A P}+\overparen{P B}$, we have + +$$ +\overline{A P}=\widetilde{P^{\prime} A}, \quad \angle P B A=\angle A B P^{\prime} \quad \text { and } \quad A P=A P^{\prime} +$$ + +Due to $\overparen{A P}=\widehat{P^{\prime}} A$, the lines $B P$ and $B Q^{\prime}$ are symmetrical about line $A B$. +Similarly, by $\angle B F P=\angle Q^{\prime} F B$, the lines $F P$ and $F Q^{\prime}$ are symmetrical about $A B$. It follows that also the points $P$ and $P^{\prime}$ are symmetrical to $Q^{\prime}$ and $Q$, respectively. Therefore, + +$$ +A P=A Q^{\prime} \quad \text { and } \quad A P^{\prime}=A Q +$$ + +The relations (1) and (2) together prove $A P=A P^{\prime}=A Q=A Q^{\prime}$. + +G2. Point $P$ lies inside triangle $A B C$. Lines $A P, B P, C P$ meet the circumcircle of $A B C$ again at points $K, L, M$, respectively. The tangent to the circumcircle at $C$ meets line $A B$ at $S$. Prove that $S C=S P$ if and only if $M K=M L$. + +Solution 1. We assume that $C A>C B$, so point $S$ lies on the ray $A B$. +From the similar triangles $\triangle P K M \sim \triangle P C A$ and $\triangle P L M \sim \triangle P C B$ we get $\frac{P M}{K M}=\frac{P A}{C A}$ and $\frac{L M}{P M}=\frac{C B}{P B}$. Multiplying these two equalities, we get + +$$ +\frac{L M}{K M}=\frac{C B}{C A} \cdot \frac{P A}{P B} +$$ + +Hence, the relation $M K=M L$ is equivalent to $\frac{C B}{C A}=\frac{P B}{P A}$. +Denote by $E$ the foot of the bisector of angle $B$ in triangle $A B C$. Recall that the locus of points $X$ for which $\frac{X A}{X B}=\frac{C A}{C B}$ is the Apollonius circle $\Omega$ with the center $Q$ on the line $A B$, and this circle passes through $C$ and $E$. Hence, we have $M K=M L$ if and only if $P$ lies on $\Omega$, that is $Q P=Q C$. + + +Fig. 1 + +Now we prove that $S=Q$, thus establishing the problem statement. We have $\angle C E S=$ $\angle C A E+\angle A C E=\angle B C S+\angle E C B=\angle E C S$, so $S C=S E$. Hence, the point $S$ lies on $A B$ as well as on the perpendicular bisector of $C E$ and therefore coincides with $Q$. + +Solution 2. As in the previous solution, we assume that $S$ lies on the ray $A B$. + +1. Let $P$ be an arbitrary point inside both the circumcircle $\omega$ of the triangle $A B C$ and the angle $A S C$, the points $K, L, M$ defined as in the problem. We claim that $S P=S C$ implies $M K=M L$. + +Let $E$ and $F$ be the points of intersection of the line $S P$ with $\omega$, point $E$ lying on the segment $S P$ (see Fig. 2). + + +Fig. 2 + +We have $S P^{2}=S C^{2}=S A \cdot S B$, so $\frac{S P}{S B}=\frac{S A}{S P}$, and hence $\triangle P S A \sim \triangle B S P$. Then $\angle B P S=\angle S A P$. Since $2 \angle B P S=\overparen{B E}+\overparen{L F}$ and $2 \angle S A P=\overparen{B E}+\overparen{E K}$ we have + +$$ +\overparen{L F}=\overparen{E K} +$$ + +On the other hand, from $\angle S P C=\angle S C P$ we have $\widehat{E C}+\widehat{M F}=\widehat{E C}+\widehat{E M}$, or + +$$ +\widetilde{M F}=\overparen{E M} . +$$ + +From (1) and (2) we get $\widehat{M F L}=\widehat{M F}+\widehat{F L}=\widehat{M E}+\widehat{E K}=\widehat{M E K}$ and hence $M K=M L$. The claim is proved. +2. We are left to prove the converse. So, assume that $M K=M L$, and introduce the points $E$ and $F$ as above. We have $S C^{2}=S E \cdot S F$; hence, there exists a point $P^{\prime}$ lying on the segment $E F$ such that $S P^{\prime}=S C$ (see Fig. 3). + + +Fig. 3 + +Assume that $P \neq P^{\prime}$. Let the lines $A P^{\prime}, B P^{\prime}, C P^{\prime}$ meet $\omega$ again at points $K^{\prime}, L^{\prime}, M^{\prime}$ respectively. Now, if $P^{\prime}$ lies on the segment $P F$ then by the first part of the solution we have $\widehat{M^{\prime} F L^{\prime}}=\widehat{M^{\prime} E K^{\prime}}$. On the other hand, we have $\widehat{M F L}>\widehat{M^{\prime} F L^{\prime}}=\widehat{M^{\prime} E K^{\prime}}>\widehat{M E K}$, therefore $\widehat{M F L}>\widehat{M E K}$ which contradicts $M K=M L$. + +Similarly, if point $P^{\prime}$ lies on the segment $E P$ then we get $\widehat{M F L}<\widehat{M E K}$ which is impossible. Therefore, the points $P$ and $P^{\prime}$ coincide and hence $S P=S P^{\prime}=S C$. + +Solution 3. We present a different proof of the converse direction, that is, $M K=M L \Rightarrow$ $S P=S C$. As in the previous solutions we assume that $C A>C B$, and the line $S P$ meets $\omega$ at $E$ and $F$. + +From $M L=M K$ we get $\widehat{M E K}=\widehat{M F L}$. Now we claim that $\widehat{M E}=\widehat{M F}$ and $\widehat{E K}=\widehat{F L}$. +To the contrary, suppose first that $\widehat{M E}>\widehat{M F}$; then $\widehat{E K}=\widehat{M E K}-\widehat{M E}<\widehat{M F L}-\widehat{M F}=$ $\overparen{F L}$. Now, the inequality $\overparen{M E}>\overparen{M F}$ implies $2 \angle S C M=\overparen{E C}+\overparen{M E}>\overparen{E C}+\overparen{M F}=2 \angle S P C$ and hence $S P>S C$. On the other hand, the inequality $\overparen{E K}<\overparen{F L}$ implies $2 \angle S P K=$ $\overparen{E K}+\widetilde{A F}<\overparen{F L}+\widetilde{A F}=2 \angle A B L$, hence + +$$ +\angle S P A=180^{\circ}-\angle S P K>180^{\circ}-\angle A B L=\angle S B P . +$$ + + + +Fig. 4 +Consider the point $A^{\prime}$ on the ray $S A$ for which $\angle S P A^{\prime}=\angle S B P$; in our case, this point lies on the segment $S A$ (see Fig. 4). Then $\triangle S B P \sim \triangle S P A^{\prime}$ and $S P^{2}=S B \cdot S A^{\prime} S C$. + +Similarly, one can prove that the inequality $\widehat{M E}<\widehat{M F}$ is also impossible. So, we get $\widehat{M E}=\widehat{M F}$ and therefore $2 \angle S C M=\widehat{E C}+\widehat{M E}=\widehat{E C}+\widehat{M F}=2 \angle S P C$, which implies $S C=S P$. + +G3. Let $A_{1} A_{2} \ldots A_{n}$ be a convex polygon. Point $P$ inside this polygon is chosen so that its projections $P_{1}, \ldots, P_{n}$ onto lines $A_{1} A_{2}, \ldots, A_{n} A_{1}$ respectively lie on the sides of the polygon. Prove that for arbitrary points $X_{1}, \ldots, X_{n}$ on sides $A_{1} A_{2}, \ldots, A_{n} A_{1}$ respectively, + +$$ +\max \left\{\frac{X_{1} X_{2}}{P_{1} P_{2}}, \ldots, \frac{X_{n} X_{1}}{P_{n} P_{1}}\right\} \geq 1 +$$ + +(Armenia) + +Solution 1. Denote $P_{n+1}=P_{1}, X_{n+1}=X_{1}, A_{n+1}=A_{1}$. +Lemma. Let point $Q$ lies inside $A_{1} A_{2} \ldots A_{n}$. Then it is contained in at least one of the circumcircles of triangles $X_{1} A_{2} X_{2}, \ldots, X_{n} A_{1} X_{1}$. +Proof. If $Q$ lies in one of the triangles $X_{1} A_{2} X_{2}, \ldots, X_{n} A_{1} X_{1}$, the claim is obvious. Otherwise $Q$ lies inside the polygon $X_{1} X_{2} \ldots X_{n}$ (see Fig. 1). Then we have + +$$ +\begin{aligned} +& \left(\angle X_{1} A_{2} X_{2}+\angle X_{1} Q X_{2}\right)+\cdots+\left(\angle X_{n} A_{1} X_{1}+\angle X_{n} Q X_{1}\right) \\ +& \quad=\left(\angle X_{1} A_{1} X_{2}+\cdots+\angle X_{n} A_{1} X_{1}\right)+\left(\angle X_{1} Q X_{2}+\cdots+\angle X_{n} Q X_{1}\right)=(n-2) \pi+2 \pi=n \pi +\end{aligned} +$$ + +hence there exists an index $i$ such that $\angle X_{i} A_{i+1} X_{i+1}+\angle X_{i} Q X_{i+1} \geq \frac{\pi n}{n}=\pi$. Since the quadrilateral $Q X_{i} A_{i+1} X_{i+1}$ is convex, this means exactly that $Q$ is contained the circumcircle of $\triangle X_{i} A_{i+1} X_{i+1}$, as desired. + +Now we turn to the solution. Applying lemma, we get that $P$ lies inside the circumcircle of triangle $X_{i} A_{i+1} X_{i+1}$ for some $i$. Consider the circumcircles $\omega$ and $\Omega$ of triangles $P_{i} A_{i+1} P_{i+1}$ and $X_{i} A_{i+1} X_{i+1}$ respectively (see Fig. 2); let $r$ and $R$ be their radii. Then we get $2 r=A_{i+1} P \leq 2 R$ (since $P$ lies inside $\Omega$ ), hence + +$$ +P_{i} P_{i+1}=2 r \sin \angle P_{i} A_{i+1} P_{i+1} \leq 2 R \sin \angle X_{i} A_{i+1} X_{i+1}=X_{i} X_{i+1} +$$ + +QED. + + +Fig. 1 + + +Fig. 2 + +Solution 2. As in Solution 1, we assume that all indices of points are considered modulo $n$. +We will prove a bit stronger inequality, namely + +$$ +\max \left\{\frac{X_{1} X_{2}}{P_{1} P_{2}} \cos \alpha_{1}, \ldots, \frac{X_{n} X_{1}}{P_{n} P_{1}} \cos \alpha_{n}\right\} \geq 1 +$$ + +where $\alpha_{i}(1 \leq i \leq n)$ is the angle between lines $X_{i} X_{i+1}$ and $P_{i} P_{i+1}$. We denote $\beta_{i}=\angle A_{i} P_{i} P_{i-1}$ and $\gamma_{i}=\angle A_{i+1} P_{i} P_{i+1}$ for all $1 \leq i \leq n$. + +Suppose that for some $1 \leq i \leq n$, point $X_{i}$ lies on the segment $A_{i} P_{i}$, while point $X_{i+1}$ lies on the segment $P_{i+1} A_{i+2}$. Then the projection of the segment $X_{i} X_{i+1}$ onto the line $P_{i} P_{i+1}$ contains segment $P_{i} P_{i+1}$, since $\gamma_{i}$ and $\beta_{i+1}$ are acute angles (see Fig. 3). Therefore, $X_{i} X_{i+1} \cos \alpha_{i} \geq$ $P_{i} P_{i+1}$, and in this case the statement is proved. + +So, the only case left is when point $X_{i}$ lies on segment $P_{i} A_{i+1}$ for all $1 \leq i \leq n$ (the case when each $X_{i}$ lies on segment $A_{i} P_{i}$ is completely analogous). + +Now, assume to the contrary that the inequality + +$$ +X_{i} X_{i+1} \cos \alpha_{i}P_{i+1} Y_{i+1}^{\prime}$ (again since $\gamma_{i}$ and $\beta_{i+1}$ are acute; see Fig. 4). Hence, we have + +$$ +X_{i} P_{i} \cos \gamma_{i}>X_{i+1} P_{i+1} \cos \beta_{i+1}, \quad 1 \leq i \leq n +$$ + +Multiplying these inequalities, we get + +$$ +\cos \gamma_{1} \cos \gamma_{2} \cdots \cos \gamma_{n}>\cos \beta_{1} \cos \beta_{2} \cdots \cos \beta_{n} +$$ + +On the other hand, the sines theorem applied to triangle $P P_{i} P_{i+1}$ provides + +$$ +\frac{P P_{i}}{P P_{i+1}}=\frac{\sin \left(\frac{\pi}{2}-\beta_{i+1}\right)}{\sin \left(\frac{\pi}{2}-\gamma_{i}\right)}=\frac{\cos \beta_{i+1}}{\cos \gamma_{i}} +$$ + +Multiplying these equalities we get + +$$ +1=\frac{\cos \beta_{2}}{\cos \gamma_{1}} \cdot \frac{\cos \beta_{3}}{\cos \gamma_{2}} \cdots \frac{\cos \beta_{1}}{\cos \gamma_{n}} +$$ + +which contradicts (2). + + +Fig. 3 +Fig. 4 + +G4. Let $I$ be the incenter of a triangle $A B C$ and $\Gamma$ be its circumcircle. Let the line $A I$ intersect $\Gamma$ at a point $D \neq A$. Let $F$ and $E$ be points on side $B C$ and $\operatorname{arc} B D C$ respectively such that $\angle B A F=\angle C A E<\frac{1}{2} \angle B A C$. Finally, let $G$ be the midpoint of the segment $I F$. Prove that the lines $D G$ and $E I$ intersect on $\Gamma$. +(Hong Kong) +Solution 1. Let $X$ be the second point of intersection of line $E I$ with $\Gamma$, and $L$ be the foot of the bisector of angle $B A C$. Let $G^{\prime}$ and $T$ be the points of intersection of segment $D X$ with lines $I F$ and $A F$, respectively. We are to prove that $G=G^{\prime}$, or $I G^{\prime}=G^{\prime} F$. By the Menelaus theorem applied to triangle $A I F$ and line $D X$, it means that we need the relation + +$$ +1=\frac{G^{\prime} F}{I G^{\prime}}=\frac{T F}{A T} \cdot \frac{A D}{I D}, \quad \text { or } \quad \frac{T F}{A T}=\frac{I D}{A D} +$$ + +Let the line $A F$ intersect $\Gamma$ at point $K \neq A$ (see Fig. 1); since $\angle B A K=\angle C A E$ we have $\widehat{B K}=\widehat{C E}$, hence $K E \| B C$. Notice that $\angle I A T=\angle D A K=\angle E A D=\angle E X D=\angle I X T$, so the points $I, A, X, T$ are concyclic. Hence we have $\angle I T A=\angle I X A=\angle E X A=\angle E K A$, so $I T\|K E\| B C$. Therefore we obtain $\frac{T F}{A T}=\frac{I L}{A I}$. + +Since $C I$ is the bisector of $\angle A C L$, we get $\frac{I L}{A I}=\frac{C L}{A C}$. Furthermore, $\angle D C L=\angle D C B=$ $\angle D A B=\angle C A D=\frac{1}{2} \angle B A C$, hence the triangles $D C L$ and $D A C$ are similar; therefore we get $\frac{C L}{A C}=\frac{D C}{A D}$. Finally, it is known that the midpoint $D$ of $\operatorname{arc} B C$ is equidistant from points $I$, $B, C$, hence $\frac{D C}{A D}=\frac{I D}{A D}$. + +Summarizing all these equalities, we get + +$$ +\frac{T F}{A T}=\frac{I L}{A I}=\frac{C L}{A C}=\frac{D C}{A D}=\frac{I D}{A D} +$$ + +as desired. + + +Fig. 1 + + +Fig. 2 + +Comment. The equality $\frac{A I}{I L}=\frac{A D}{D I}$ is known and can be obtained in many different ways. For instance, one can consider the inversion with center $D$ and radius $D C=D I$. This inversion takes $\widehat{B A C}$ to the segment $B C$, so point $A$ goes to $L$. Hence $\frac{I L}{D I}=\frac{A I}{A D}$, which is the desired equality. + +Solution 2. As in the previous solution, we introduce the points $X, T$ and $K$ and note that it suffice to prove the equality + +$$ +\frac{T F}{A T}=\frac{D I}{A D} \quad \Longleftrightarrow \quad \frac{T F+A T}{A T}=\frac{D I+A D}{A D} \quad \Longleftrightarrow \quad \frac{A T}{A D}=\frac{A F}{D I+A D} +$$ + +Since $\angle F A D=\angle E A I$ and $\angle T D A=\angle X D A=\angle X E A=\angle I E A$, we get that the triangles $A T D$ and $A I E$ are similar, therefore $\frac{A T}{A D}=\frac{A I}{A E}$. + +Next, we also use the relation $D B=D C=D I$. Let $J$ be the point on the extension of segment $A D$ over point $D$ such that $D J=D I=D C$ (see Fig. 2). Then $\angle D J C=$ $\angle J C D=\frac{1}{2}(\pi-\angle J D C)=\frac{1}{2} \angle A D C=\frac{1}{2} \angle A B C=\angle A B I$. Moreover, $\angle B A I=\angle J A C$, hence triangles $A B I$ and $A J C$ are similar, so $\frac{A B}{A J}=\frac{A I}{A C}$, or $A B \cdot A C=A J \cdot A I=(D I+A D) \cdot A I$. + +On the other hand, we get $\angle A B F=\angle A B C=\angle A E C$ and $\angle B A F=\angle C A E$, so triangles $A B F$ and $A E C$ are also similar, which implies $\frac{A F}{A C}=\frac{A B}{A E}$, or $A B \cdot A C=A F \cdot A E$. + +Summarizing we get + +$$ +(D I+A D) \cdot A I=A B \cdot A C=A F \cdot A E \quad \Rightarrow \quad \frac{A I}{A E}=\frac{A F}{A D+D I} \quad \Rightarrow \quad \frac{A T}{A D}=\frac{A F}{A D+D I} +$$ + +as desired. +Comment. In fact, point $J$ is an excenter of triangle $A B C$. + +G5. Let $A B C D E$ be a convex pentagon such that $B C \| A E, A B=B C+A E$, and $\angle A B C=$ $\angle C D E$. Let $M$ be the midpoint of $C E$, and let $O$ be the circumcenter of triangle $B C D$. Given that $\angle D M O=90^{\circ}$, prove that $2 \angle B D A=\angle C D E$. +(Ukraine) +Solution 1. Choose point $T$ on ray $A E$ such that $A T=A B$; then from $A E \| B C$ we have $\angle C B T=\angle A T B=\angle A B T$, so $B T$ is the bisector of $\angle A B C$. On the other hand, we have $E T=A T-A E=A B-A E=B C$, hence quadrilateral $B C T E$ is a parallelogram, and the midpoint $M$ of its diagonal $C E$ is also the midpoint of the other diagonal $B T$. + +Next, let point $K$ be symmetrical to $D$ with respect to $M$. Then $O M$ is the perpendicular bisector of segment $D K$, and hence $O D=O K$, which means that point $K$ lies on the circumcircle of triangle $B C D$. Hence we have $\angle B D C=\angle B K C$. On the other hand, the angles $B K C$ and $T D E$ are symmetrical with respect to $M$, so $\angle T D E=\angle B K C=\angle B D C$. + +Therefore, $\angle B D T=\angle B D E+\angle E D T=\angle B D E+\angle B D C=\angle C D E=\angle A B C=180^{\circ}-$ $\angle B A T$. This means that the points $A, B, D, T$ are concyclic, and hence $\angle A D B=\angle A T B=$ $\frac{1}{2} \angle A B C=\frac{1}{2} \angle C D E$, as desired. + + +Solution 2. Let $\angle C B D=\alpha, \angle B D C=\beta, \angle A D E=\gamma$, and $\angle A B C=\angle C D E=2 \varphi$. Then we have $\angle A D B=2 \varphi-\beta-\gamma, \angle B C D=180^{\circ}-\alpha-\beta, \angle A E D=360^{\circ}-\angle B C D-\angle C D E=$ $180^{\circ}-2 \varphi+\alpha+\beta$, and finally $\angle D A E=180^{\circ}-\angle A D E-\angle A E D=2 \varphi-\alpha-\beta-\gamma$. + + +Let $N$ be the midpoint of $C D$; then $\angle D N O=90^{\circ}=\angle D M O$, hence points $M, N$ lie on the circle with diameter $O D$. Now, if points $O$ and $M$ lie on the same side of $C D$, we have $\angle D M N=\angle D O N=\frac{1}{2} \angle D O C=\alpha$; in the other case, we have $\angle D M N=180^{\circ}-\angle D O N=\alpha ;$ +so, in both cases $\angle D M N=\alpha$ (see Figures). Next, since $M N$ is a midline in triangle $C D E$, we have $\angle M D E=\angle D M N=\alpha$ and $\angle N D M=2 \varphi-\alpha$. + +Now we apply the sine rule to the triangles $A B D, A D E$ (twice), $B C D$ and $M N D$ obtaining + +$$ +\begin{gathered} +\frac{A B}{A D}=\frac{\sin (2 \varphi-\beta-\gamma)}{\sin (2 \varphi-\alpha)}, \quad \frac{A E}{A D}=\frac{\sin \gamma}{\sin (2 \varphi-\alpha-\beta)}, \quad \frac{D E}{A D}=\frac{\sin (2 \varphi-\alpha-\beta-\gamma)}{\sin (2 \varphi-\alpha-\beta)} \\ +\frac{B C}{C D}=\frac{\sin \beta}{\sin \alpha}, \quad \frac{C D}{D E}=\frac{C D / 2}{D E / 2}=\frac{N D}{N M}=\frac{\sin \alpha}{\sin (2 \varphi-\alpha)} +\end{gathered} +$$ + +which implies + +$$ +\frac{B C}{A D}=\frac{B C}{C D} \cdot \frac{C D}{D E} \cdot \frac{D E}{A D}=\frac{\sin \beta \cdot \sin (2 \varphi-\alpha-\beta-\gamma)}{\sin (2 \varphi-\alpha) \cdot \sin (2 \varphi-\alpha-\beta)} +$$ + +Hence, the condition $A B=A E+B C$, or equivalently $\frac{A B}{A D}=\frac{A E+B C}{A D}$, after multiplying by the common denominator rewrites as + +$$ +\begin{gathered} +\sin (2 \varphi-\alpha-\beta) \cdot \sin (2 \varphi-\beta-\gamma)=\sin \gamma \cdot \sin (2 \varphi-\alpha)+\sin \beta \cdot \sin (2 \varphi-\alpha-\beta-\gamma) \\ +\Longleftrightarrow \cos (\gamma-\alpha)-\cos (4 \varphi-2 \beta-\alpha-\gamma)=\cos (2 \varphi-\alpha-2 \beta-\gamma)-\cos (2 \varphi+\gamma-\alpha) \\ +\Longleftrightarrow \cos (\gamma-\alpha)+\cos (2 \varphi+\gamma-\alpha)=\cos (2 \varphi-\alpha-2 \beta-\gamma)+\cos (4 \varphi-2 \beta-\alpha-\gamma) \\ +\Longleftrightarrow \cos \varphi \cdot \cos (\varphi+\gamma-\alpha)=\cos \varphi \cdot \cos (3 \varphi-2 \beta-\alpha-\gamma) \\ +\Longleftrightarrow \cos \varphi \cdot(\cos (\varphi+\gamma-\alpha)-\cos (3 \varphi-2 \beta-\alpha-\gamma))=0 \\ +\Longleftrightarrow \cos \varphi \cdot \sin (2 \varphi-\beta-\alpha) \cdot \sin (\varphi-\beta-\gamma)=0 +\end{gathered} +$$ + +Since $2 \varphi-\beta-\alpha=180^{\circ}-\angle A E D<180^{\circ}$ and $\varphi=\frac{1}{2} \angle A B C<90^{\circ}$, it follows that $\varphi=\beta+\gamma$, hence $\angle B D A=2 \varphi-\beta-\gamma=\varphi=\frac{1}{2} \angle C D E$, as desired. + +G6. The vertices $X, Y, Z$ of an equilateral triangle $X Y Z$ lie respectively on the sides $B C$, $C A, A B$ of an acute-angled triangle $A B C$. Prove that the incenter of triangle $A B C$ lies inside triangle $X Y Z$. + +G6 ${ }^{\prime}$. The vertices $X, Y, Z$ of an equilateral triangle $X Y Z$ lie respectively on the sides $B C, C A, A B$ of a triangle $A B C$. Prove that if the incenter of triangle $A B C$ lies outside triangle $X Y Z$, then one of the angles of triangle $A B C$ is greater than $120^{\circ}$. +(Bulgaria) +Solution 1 for G6. We will prove a stronger fact; namely, we will show that the incenter $I$ of triangle $A B C$ lies inside the incircle of triangle $X Y Z$ (and hence surely inside triangle $X Y Z$ itself). We denote by $d(U, V W)$ the distance between point $U$ and line $V W$. + +Denote by $O$ the incenter of $\triangle X Y Z$ and by $r, r^{\prime}$ and $R^{\prime}$ the inradii of triangles $A B C, X Y Z$ and the circumradius of $X Y Z$, respectively. Then we have $R^{\prime}=2 r^{\prime}$, and the desired inequality is $O I \leq r^{\prime}$. We assume that $O \neq I$; otherwise the claim is trivial. + +Let the incircle of $\triangle A B C$ touch its sides $B C, A C, A B$ at points $A_{1}, B_{1}, C_{1}$ respectively. The lines $I A_{1}, I B_{1}, I C_{1}$ cut the plane into 6 acute angles, each one containing one of the points $A_{1}, B_{1}, C_{1}$ on its border. We may assume that $O$ lies in an angle defined by lines $I A_{1}$, $I C_{1}$ and containing point $C_{1}$ (see Fig. 1). Let $A^{\prime}$ and $C^{\prime}$ be the projections of $O$ onto lines $I A_{1}$ and $I C_{1}$, respectively. + +Since $O X=R^{\prime}$, we have $d(O, B C) \leq R^{\prime}$. Since $O A^{\prime} \| B C$, it follows that $d\left(A^{\prime}, B C\right)=$ $A^{\prime} I+r \leq R^{\prime}$, or $A^{\prime} I \leq R^{\prime}-r$. On the other hand, the incircle of $\triangle X Y Z$ lies inside $\triangle A B C$, hence $d(O, A B) \geq r^{\prime}$, and analogously we get $d(O, A B)=C^{\prime} C_{1}=r-I C^{\prime} \geq r^{\prime}$, or $I C^{\prime} \leq r-r^{\prime}$. + + +Fig. 1 + + +Fig. 2 + +Finally, the quadrilateral $I A^{\prime} O C^{\prime}$ is circumscribed due to the right angles at $A^{\prime}$ and $C^{\prime}$ (see Fig. 2). On its circumcircle, we have $\widehat{A^{\prime} O C^{\prime}}=2 \angle A^{\prime} I C^{\prime}<180^{\circ}=\widetilde{O C^{\prime} I}$, hence $180^{\circ} \geq$ $\widetilde{I C^{\prime}}>\widetilde{A^{\prime} O}$. This means that $I C^{\prime}>A^{\prime} O$. Finally, we have $O I \leq I A^{\prime}+A^{\prime} O90^{\circ}$ thus leading to a contradiction. + +Note that $\omega$ intersects each of the segments $X Y$ and $Y Z$ at two points; let $U, U^{\prime}$ and $V$, $V^{\prime}$ be the points of intersection of $\omega$ with $X Y$ and $Y Z$, respectively $\left(U Y>U^{\prime} Y, V Y>V^{\prime} Y\right.$; see Figs. 3 and 4). Note that $60^{\circ}=\angle X Y Z=\frac{1}{2}\left(\overparen{U V}-\widetilde{U^{\prime} V^{\prime}}\right) \leq \frac{1}{2} \overparen{U V}$, hence $\overparen{U V} \geq 120^{\circ}$. + +On the other hand, since $I$ lies in $\triangle A Y Z$, we get $\sqrt{U V^{\prime}}<180^{\circ}$, hence $\sqrt{U A_{1} U^{\prime}} \leq \sqrt{U A_{1} V^{\prime}}<$ $180^{\circ}-\widehat{U V} \leq 60^{\circ}$. + +Now, two cases are possible due to the order of points $Y, B_{1}$ on segment $A C$. + + +Fig. 3 + + +Fig. 4 + +Case 1. Let point $Y$ lie on the segment $A B_{1}$ (see Fig. 3). Then we have $\angle Y X C=$ $\frac{1}{2}\left(\widehat{A_{1} U^{\prime}}-\widehat{A_{1} U}\right) \leq \frac{1}{2} \widehat{U A_{1} U^{\prime}}<30^{\circ}$; analogously, we get $\angle X Y C \leq \frac{1}{2} \widehat{U A_{1} U^{\prime}}<30^{\circ}$. Therefore, $\angle Y C X=180^{\circ}-\angle Y X C-\angle X Y C>120^{\circ}$, as desired. + +Case 2. Now let point $Y$ lie on the segment $C B_{1}$ (see Fig. 4). Analogously, we obtain $\angle Y X C<30^{\circ}$. Next, $\angle I Y X>\angle Z Y X=60^{\circ}$, but $\angle I Y X<\angle I Y B_{1}$, since $Y B_{1}$ is a tangent and $Y X$ is a secant line to circle $\omega$ from point $Y$. Hence, we get $120^{\circ}<\angle I Y B_{1}+\angle I Y X=$ $\angle B_{1} Y X=\angle Y X C+\angle Y C X<30^{\circ}+\angle Y C X$, hence $\angle Y C X>120^{\circ}-30^{\circ}=90^{\circ}$, as desired. + +Comment. In the same way, one can prove a more general +Claim. Let the vertices $X, Y, Z$ of a triangle $X Y Z$ lie respectively on the sides $B C, C A, A B$ of a triangle $A B C$. Suppose that the incenter of triangle $A B C$ lies outside triangle $X Y Z$, and $\alpha$ is the least angle of $\triangle X Y Z$. Then one of the angles of triangle $A B C$ is greater than $3 \alpha-90^{\circ}$. + +Solution for G6'. Assume the contrary. As in Solution 2, we assume that the incenter $I$ of $\triangle A B C$ lies in $\triangle A Y Z$, and the tangency point $A_{1}$ of $\omega$ and $B C$ lies on segment $C X$. Surely, $\angle Y Z A \leq 180^{\circ}-\angle Y Z X=120^{\circ}$, hence points $I$ and $Y$ lie on one side of the perpendicular bisector to $X Y$; therefore $I X>I Y$. Moreover, $\omega$ intersects segment $X Y$ at two points, and therefore the projection $M$ of $I$ onto $X Y$ lies on the segment $X Y$. In this case, we will prove that $\angle C>120^{\circ}$. + +Let $Y K, Y L$ be two tangents from point $Y$ to $\omega$ (points $K$ and $A_{1}$ lie on one side of $X Y$; if $Y$ lies on $\omega$, we say $K=L=Y$ ); one of the points $K$ and $L$ is in fact a tangency point $B_{1}$ of $\omega$ and $A C$. From symmetry, we have $\angle Y I K=\angle Y I L$. On the other hand, since $I X>I Y$, we get $X M 120^{\circ}$, as desired. + + +Fig. 5 + + +Fig. 6 + +Comment 1. The estimate claimed in $\mathrm{G}^{\prime}$ is sharp. Actually, if $\angle B A C>120^{\circ}$, one can consider an equilateral triangle $X Y Z$ with $Z=A, Y \in A C, X \in B C$ (such triangle exists since $\angle A C B<60^{\circ}$ ). It intersects with the angle bisector of $\angle B A C$ only at point $A$, hence it does not contain $I$. + +Comment 2. As in the previous solution, there is a generalization for an arbitrary triangle $X Y Z$, but here we need some additional condition. The statement reads as follows. +Claim. Let the vertices $X, Y, Z$ of a triangle $X Y Z$ lie respectively on the sides $B C, C A, A B$ of a triangle $A B C$. Suppose that the incenter of triangle $A B C$ lies outside triangle $X Y Z, \alpha$ is the least angle of $\triangle X Y Z$, and all sides of triangle $X Y Z$ are greater than $2 r \cot \alpha$, where $r$ is the inradius of $\triangle A B C$. Then one of the angles of triangle $A B C$ is greater than $2 \alpha$. + +The additional condition is needed to verify that $X M>Y M$ since it cannot be shown in the original way. Actually, we have $\angle M Y I>\alpha, I M 2 r \cot \alpha$, then surely $X M>Y M$. + +On the other hand, this additional condition follows easily from the conditions of the original problem. Actually, if $I \in \triangle A Y Z$, then the diameter of $\omega$ parallel to $Y Z$ is contained in $\triangle A Y Z$ and is thus shorter than $Y Z$. Hence $Y Z>2 r>2 r \cot 60^{\circ}$. + +G7. Three circular arcs $\gamma_{1}, \gamma_{2}$, and $\gamma_{3}$ connect the points $A$ and $C$. These arcs lie in the same half-plane defined by line $A C$ in such a way that arc $\gamma_{2}$ lies between the arcs $\gamma_{1}$ and $\gamma_{3}$. Point $B$ lies on the segment $A C$. Let $h_{1}, h_{2}$, and $h_{3}$ be three rays starting at $B$, lying in the same half-plane, $h_{2}$ being between $h_{1}$ and $h_{3}$. For $i, j=1,2,3$, denote by $V_{i j}$ the point of intersection of $h_{i}$ and $\gamma_{j}$ (see the Figure below). + +Denote by $\widehat{V_{i j} V_{k j}} \widehat{V_{k \ell} V_{i \ell}}$ the curved quadrilateral, whose sides are the segments $V_{i j} V_{i \ell}, V_{k j} V_{k \ell}$ and $\operatorname{arcs} V_{i j} V_{k j}$ and $V_{i \ell} V_{k \ell}$. We say that this quadrilateral is circumscribed if there exists a circle touching these two segments and two arcs. + +Prove that if the curved quadrilaterals $\sqrt{V_{11} V_{21}} \sqrt{22} V_{12}, \sqrt{V_{12} V_{22}} \sqrt{23} V_{13}, \sqrt{V_{21} V_{31}} \sqrt{V_{32} V_{22}}$ are circumscribed, then the curved quadrilateral $\sqrt{V_{22} V_{32}} \sqrt{33} V_{23}$ is circumscribed, too. + + +Fig. 1 +(Hungary) +Solution. Denote by $O_{i}$ and $R_{i}$ the center and the radius of $\gamma_{i}$, respectively. Denote also by $H$ the half-plane defined by $A C$ which contains the whole configuration. For every point $P$ in the half-plane $H$, denote by $d(P)$ the distance between $P$ and line $A C$. Furthermore, for any $r>0$, denote by $\Omega(P, r)$ the circle with center $P$ and radius $r$. +Lemma 1. For every $1 \leq i R_{i}$ and $O_{j} P 0$; then the + +circle $\Omega(P, r)$ touches $\gamma_{i}$ externally and touches $\gamma_{j}$ internally, so $P$ belongs to the locus under investigation. +(b) Let $\vec{\rho}=\overrightarrow{A P}, \vec{\rho}_{i}=\overrightarrow{A O_{i}}$, and $\vec{\rho}_{j}=\overrightarrow{A O_{j}}$; let $d_{i j}=O_{i} O_{j}$, and let $\vec{v}$ be a unit vector orthogonal to $A C$ and directed toward $H$. Then we have $\left|\vec{\rho}_{i}\right|=R_{i},\left|\vec{\rho}_{j}\right|=R_{j},\left|\overrightarrow{O_{i} P}\right|=$ $\left|\vec{\rho}-\vec{\rho}_{i}\right|=R_{i}+r,\left|\overrightarrow{O_{j} P}\right|=\left|\vec{\rho}-\vec{\rho}_{j}\right|=R_{j}-r$, hence + +$$ +\begin{gathered} +\left(\vec{\rho}-\vec{\rho}_{i}\right)^{2}-\left(\vec{\rho}-\vec{\rho}_{j}\right)^{2}=\left(R_{i}+r\right)^{2}-\left(R_{j}-r\right)^{2}, \\ +\left(\vec{\rho}_{i}^{2}-\vec{\rho}_{j}^{2}\right)+2 \vec{\rho} \cdot\left(\vec{\rho}_{j}-\vec{\rho}_{i}\right)=\left(R_{i}^{2}-R_{j}^{2}\right)+2 r\left(R_{i}+R_{j}\right), \\ +d_{i j} \cdot d(P)=d_{i j} \vec{v} \cdot \vec{\rho}=\left(\vec{\rho}_{j}-\vec{\rho}_{i}\right) \cdot \vec{\rho}=r\left(R_{i}+R_{j}\right) . +\end{gathered} +$$ + +Therefore, + +$$ +r=\frac{d_{i j}}{R_{i}+R_{j}} \cdot d(P) +$$ + +and the value $v_{i j}=\frac{d_{i j}}{R_{i}+R_{j}}$ does not depend on $P$. +Lemma 3. The curved quadrilateral $\mathcal{Q}_{i j}=\sqrt{i, j V_{i+1, j}} V_{i+1, j+1} V_{i, j+1}$ is circumscribed if and only if $u_{i, i+1}=v_{j, j+1}$. +Proof. First suppose that the curved quadrilateral $\mathcal{Q}_{i j}$ is circumscribed and $\Omega(P, r)$ is its inscribed circle. By Lemma 1 and Lemma 2 we have $r=u_{i, i+1} \cdot d(P)$ and $r=v_{j, j+1} \cdot d(P)$ as well. Hence, $u_{i, i+1}=v_{j, j+1}$. + +To prove the opposite direction, suppose $u_{i, i+1}=v_{j, j+1}$. Let $P$ be the intersection of the angle bisector $\beta_{i, i+1}$ and the ellipse arc $\varepsilon_{j, j+1}$. Choose $r=u_{i, i+1} \cdot d(P)=v_{j, j+1} \cdot d(P)$. Then the circle $\Omega(P, r)$ is tangent to the half lines $h_{i}$ and $h_{i+1}$ by Lemma 1 , and it is tangent to the $\operatorname{arcs} \gamma_{j}$ and $\gamma_{j+1}$ by Lemma 2. Hence, the curved quadrilateral $\mathcal{Q}_{i j}$ is circumscribed. + +By Lemma 3, the statement of the problem can be reformulated to an obvious fact: If the equalities $u_{12}=v_{12}, u_{12}=v_{23}$, and $u_{23}=v_{12}$ hold, then $u_{23}=v_{23}$ holds as well. + +Comment 1. Lemma 2(b) (together with the easy Lemma 1(b)) is the key tool in this solution. If one finds this fact, then the solution can be finished in many ways. That is, one can find a circle touching three of $h_{2}, h_{3}, \gamma_{2}$, and $\gamma_{3}$, and then prove that it is tangent to the fourth one in either synthetic or analytical way. Both approaches can be successful. + +Here we present some discussion about this key Lemma. + +1. In the solution above we chose an analytic proof for Lemma 2(b) because we expect that most students will use coordinates or vectors to examine the locus of the centers, and these approaches are less case-sensitive. + +Here we outline a synthetic proof. We consider only the case when $P$ does not lie in the line $O_{i} O_{j}$. The other case can be obtained as a limit case, or computed in a direct way. + +Let $S$ be the internal homothety center between the circles of $\gamma_{i}$ and $\gamma_{j}$, lying on $O_{i} O_{j}$; this point does not depend on $P$. Let $U$ and $V$ be the points of tangency of circle $\sigma=\Omega(P, r)$ with $\gamma_{i}$ and $\gamma_{j}$, respectively (then $r=P U=P V$ ); in other words, points $U$ and $V$ are the intersection points of rays $O_{i} P, O_{j} P$ with arcs $\gamma_{i}, \gamma_{j}$ respectively (see Fig. 4). + +Due to the theorem on three homothety centers (or just to the Menelaus theorem applied to triangle $O_{i} O_{j} P$ ), the points $U, V$ and $S$ are collinear. Let $T$ be the intersection point of line $A C$ and the common tangent to $\sigma$ and $\gamma_{i}$ at $U$; then $T$ is the radical center of $\sigma, \gamma_{i}$ and $\gamma_{j}$, hence $T V$ is the common tangent to $\sigma$ and $\gamma_{j}$. + +Let $Q$ be the projection of $P$ onto the line $A C$. By the right angles, the points $U, V$ and $Q$ lie on the circle with diameter $P T$. From this fact and the equality $P U=P V$ we get $\angle U Q P=\angle U V P=$ $\angle V U P=\angle S U O_{i}$. Since $O_{i} S \| P Q$, we have $\angle S O_{i} U=\angle Q P U$. Hence, the triangles $S O_{i} U$ and $U P Q$ are similar and thus $\frac{r}{d(P)}=\frac{P U}{P Q}=\frac{O_{i} S}{O_{i} U}=\frac{O_{i} S}{R_{i}}$; the last expression is constant since $S$ is a constant point. + + +Fig. 4 + + +Fig. 5 +2. Using some known facts about conics, the same statement can be proved in a very short way. Denote by $\ell$ the directrix of ellipse of $\varepsilon_{i j}$ related to the focus $O_{j}$; since $\varepsilon_{i j}$ is symmetrical about $O_{i} O_{j}$, we have $\ell \| A C$. Recall that for each point $P \in \varepsilon_{i j}$, we have $P O_{j}=\epsilon \cdot d_{\ell}(P)$, where $d_{\ell}(P)$ is the distance from $P$ to $\ell$, and $\epsilon$ is the eccentricity of $\varepsilon_{i j}$ (see Fig. 5). + +Now we have + +$$ +r=R_{j}-\left(R_{j}-r\right)=A O_{j}-P O_{j}=\epsilon\left(d_{\ell}(A)-d_{\ell}(P)\right)=\epsilon(d(P)-d(A))=\epsilon \cdot d(P), +$$ + +and $\epsilon$ does not depend on $P$. + +Comment 2. One can find a spatial interpretations of the problem and the solution. +For every point $(x, y)$ and radius $r>0$, represent the circle $\Omega((x, y), r)$ by the point $(x, y, r)$ in space. This point is the apex of the cone with base circle $\Omega((x, y), r)$ and height $r$. According to Lemma 1 , the circles which are tangent to $h_{i}$ and $h_{j}$ correspond to the points of a half line $\beta_{i j}^{\prime}$, starting at $B$. + +Now we translate Lemma 2. Take some $1 \leq i 1$ since otherwise $1-\frac{1}{s_{1}}=0$. So we have $2 \leq s_{1} \leq s_{2}-1 \leq \cdots \leq s_{n}-(n-1)$, hence $s_{i} \geq i+1$ for each $i=1, \ldots, n$. Therefore + +$$ +\begin{aligned} +\frac{51}{2010} & =\left(1-\frac{1}{s_{1}}\right)\left(1-\frac{1}{s_{2}}\right) \ldots\left(1-\frac{1}{s_{n}}\right) \\ +& \geq\left(1-\frac{1}{2}\right)\left(1-\frac{1}{3}\right) \ldots\left(1-\frac{1}{n+1}\right)=\frac{1}{2} \cdot \frac{2}{3} \cdots \frac{n}{n+1}=\frac{1}{n+1} +\end{aligned} +$$ + +which implies + +$$ +n+1 \geq \frac{2010}{51}=\frac{670}{17}>39 +$$ + +so $n \geq 39$. +Now we are left to show that $n=39$ fits. Consider the set $\{2,3, \ldots, 33,35,36, \ldots, 40,67\}$ which contains exactly 39 numbers. We have + +$$ +\frac{1}{2} \cdot \frac{2}{3} \cdots \frac{32}{33} \cdot \frac{34}{35} \cdots \frac{39}{40} \cdot \frac{66}{67}=\frac{1}{33} \cdot \frac{34}{40} \cdot \frac{66}{67}=\frac{17}{670}=\frac{51}{2010} +$$ + +hence for $n=39$ there exists a desired example. +Comment. One can show that the example (1) is unique. +Answer for Problem N1' ${ }^{\prime} n=48$. +Solution for Problem N1'. Suppose that for some $n$ there exist the desired numbers. In the same way we obtain that $s_{i} \geq i+1$. Moreover, since the denominator of the fraction $\frac{42}{2010}=\frac{7}{335}$ is divisible by 67 , some of $s_{i}$ 's should be divisible by 67 , so $s_{n} \geq s_{i} \geq 67$. This means that + +$$ +\frac{42}{2010} \geq \frac{1}{2} \cdot \frac{2}{3} \cdots \frac{n-1}{n} \cdot\left(1-\frac{1}{67}\right)=\frac{66}{67 n} +$$ + +which implies + +$$ +n \geq \frac{2010 \cdot 66}{42 \cdot 67}=\frac{330}{7}>47 +$$ + +so $n \geq 48$. +Now we are left to show that $n=48$ fits. Consider the set $\{2,3, \ldots, 33,36,37, \ldots, 50,67\}$ which contains exactly 48 numbers. We have + +$$ +\frac{1}{2} \cdot \frac{2}{3} \cdots \frac{32}{33} \cdot \frac{35}{36} \cdots \frac{49}{50} \cdot \frac{66}{67}=\frac{1}{33} \cdot \frac{35}{50} \cdot \frac{66}{67}=\frac{7}{335}=\frac{42}{2010} +$$ + +hence for $n=48$ there exists a desired example. +Comment 1. In this version of the problem, the estimate needs one more step, hence it is a bit harder. On the other hand, the example in this version is not unique. Another example is + +$$ +\frac{1}{2} \cdot \frac{2}{3} \cdots \frac{46}{47} \cdot \frac{66}{67} \cdot \frac{329}{330}=\frac{1}{67} \cdot \frac{66}{330} \cdot \frac{329}{47}=\frac{7}{67 \cdot 5}=\frac{42}{2010} . +$$ + +Comment 2. N1' was the Proposer's formulation of the problem. We propose N1 according to the number of current IMO. + +N2. Find all pairs $(m, n)$ of nonnegative integers for which + +$$ +m^{2}+2 \cdot 3^{n}=m\left(2^{n+1}-1\right) +$$ + +(Australia) +Answer. $(6,3),(9,3),(9,5),(54,5)$. +Solution. For fixed values of $n$, the equation (1) is a simple quadratic equation in $m$. For $n \leq 5$ the solutions are listed in the following table. + +| case | equation | discriminant | integer roots | +| :--- | :--- | :--- | :--- | +| $n=0$ | $m^{2}-m+2=0$ | -7 | none | +| $n=1$ | $m^{2}-3 m+6=0$ | -15 | none | +| $n=2$ | $m^{2}-7 m+18=0$ | -23 | none | +| $n=3$ | $m^{2}-15 m+54=0$ | 9 | $m=6$ and $m=9$ | +| $n=4$ | $m^{2}-31 m+162=0$ | 313 | none | +| $n=5$ | $m^{2}-63 m+486=0$ | $2025=45^{2}$ | $m=9$ and $m=54$ | + +We prove that there is no solution for $n \geq 6$. +Suppose that $(m, n)$ satisfies (1) and $n \geq 6$. Since $m \mid 2 \cdot 3^{n}=m\left(2^{n+1}-1\right)-m^{2}$, we have $m=3^{p}$ with some $0 \leq p \leq n$ or $m=2 \cdot 3^{q}$ with some $0 \leq q \leq n$. + +In the first case, let $q=n-p$; then + +$$ +2^{n+1}-1=m+\frac{2 \cdot 3^{n}}{m}=3^{p}+2 \cdot 3^{q} +$$ + +In the second case let $p=n-q$. Then + +$$ +2^{n+1}-1=m+\frac{2 \cdot 3^{n}}{m}=2 \cdot 3^{q}+3^{p} +$$ + +Hence, in both cases we need to find the nonnegative integer solutions of + +$$ +3^{p}+2 \cdot 3^{q}=2^{n+1}-1, \quad p+q=n +$$ + +Next, we prove bounds for $p, q$. From (2) we get + +$$ +3^{p}<2^{n+1}=8^{\frac{n+1}{3}}<9^{\frac{n+1}{3}}=3^{\frac{2(n+1)}{3}} +$$ + +and + +$$ +2 \cdot 3^{q}<2^{n+1}=2 \cdot 8^{\frac{n}{3}}<2 \cdot 9^{\frac{n}{3}}=2 \cdot 3^{\frac{2 n}{3}}<2 \cdot 3^{\frac{2(n+1)}{3}} +$$ + +so $p, q<\frac{2(n+1)}{3}$. Combining these inequalities with $p+q=n$, we obtain + +$$ +\frac{n-2}{3} \frac{n-2}{3}$; in particular, we have $h>1$. On the left-hand side of (2), both terms are divisible by $3^{h}$, therefore $9\left|3^{h}\right| 2^{n+1}-1$. It is easy check that $\operatorname{ord}_{9}(2)=6$, so $9 \mid 2^{n+1}-1$ if and only if $6 \mid n+1$. Therefore, $n+1=6 r$ for some positive integer $r$, and we can write + +$$ +2^{n+1}-1=4^{3 r}-1=\left(4^{2 r}+4^{r}+1\right)\left(2^{r}-1\right)\left(2^{r}+1\right) +$$ + +Notice that the factor $4^{2 r}+4^{r}+1=\left(4^{r}-1\right)^{2}+3 \cdot 4^{r}$ is divisible by 3 , but it is never divisible by 9 . The other two factors in (4), $2^{r}-1$ and $2^{r}+1$ are coprime: both are odd and their difference is 2 . Since the whole product is divisible by $3^{h}$, we have either $3^{h-1} \mid 2^{r}-1$ or $3^{h-1} \mid 2^{r}+1$. In any case, we have $3^{h-1} \leq 2^{r}+1$. Then + +$$ +\begin{gathered} +3^{h-1} \leq 2^{r}+1 \leq 3^{r}=3^{\frac{n+1}{6}} \\ +\frac{n-2}{3}-1
0$ of the system of equations +(i) $\sum_{i=1}^{4} x_{i}^{2}=8 m^{2}$, +(ii) $\sum_{i=1}^{4} y_{i}^{2}=8 m^{2}$, +(iii) $\sum_{i=1}^{4} x_{i} y_{i}=-6 m^{2}$. + +We will show that such a solution does not exist. +Assume the contrary and consider a solution with minimal $m$. Note that if an integer $x$ is odd then $x^{2} \equiv 1(\bmod 8)$. Otherwise (i.e., if $x$ is even) we have $x^{2} \equiv 0(\bmod 8)$ or $x^{2} \equiv 4$ $(\bmod 8)$. Hence, by (i), we get that $x_{1}, x_{2}, x_{3}$ and $x_{4}$ are even. Similarly, by (ii), we get that $y_{1}, y_{2}, y_{3}$ and $y_{4}$ are even. Thus the LHS of (iii) is divisible by 4 and $m$ is also even. It follows that $\left(\frac{x_{1}}{2}, \frac{y_{1}}{2}, \frac{x_{2}}{2}, \frac{y_{2}}{2}, \frac{x_{3}}{2}, \frac{y_{3}}{2}, \frac{x_{4}}{2}, \frac{y_{4}}{2}, \frac{m}{2}\right)$ is a solution of the system of equations (i), (ii) and (iii), which contradicts the minimality of $m$. + +Solution 2. We prove that $n \leq 4$ is impossible. Define the numbers $a_{i}, b_{i}$ for $i=1,2,3,4$ as in the previous solution. + +By Euler's identity we have + +$$ +\begin{aligned} +\left(a_{1}^{2}+a_{2}^{2}+a_{3}^{2}+a_{4}^{2}\right)\left(b_{1}^{2}+b_{2}^{2}+b_{3}^{2}+b_{4}^{2}\right) & =\left(a_{1} b_{1}+a_{2} b_{2}+a_{3} b_{3}+a_{4} b_{4}\right)^{2}+\left(a_{1} b_{2}-a_{2} b_{1}+a_{3} b_{4}-a_{4} b_{3}\right)^{2} \\ +& +\left(a_{1} b_{3}-a_{3} b_{1}+a_{4} b_{2}-a_{2} b_{4}\right)^{2}+\left(a_{1} b_{4}-a_{4} b_{1}+a_{2} b_{3}-a_{3} b_{2}\right)^{2} . +\end{aligned} +$$ + +So, using the relations (1) from the Solution 1 we get that + +$$ +7=\left(\frac{m_{1}}{m}\right)^{2}+\left(\frac{m_{2}}{m}\right)^{2}+\left(\frac{m_{3}}{m}\right)^{2} +$$ + +where + +$$ +\begin{aligned} +& \frac{m_{1}}{m}=a_{1} b_{2}-a_{2} b_{1}+a_{3} b_{4}-a_{4} b_{3} \\ +& \frac{m_{2}}{m}=a_{1} b_{3}-a_{3} b_{1}+a_{4} b_{2}-a_{2} b_{4} \\ +& \frac{m_{3}}{m}=a_{1} b_{4}-a_{4} b_{1}+a_{2} b_{3}-a_{3} b_{2} +\end{aligned} +$$ + +and $m_{1}, m_{2}, m_{3} \in \mathbb{Z}, m \in \mathbb{N}$. +Let $m$ be a minimum positive integer number for which (2) holds. Then + +$$ +8 m^{2}=m_{1}^{2}+m_{2}^{2}+m_{3}^{2}+m^{2} +$$ + +As in the previous solution, we get that $m_{1}, m_{2}, m_{3}, m$ are all even numbers. Then $\left(\frac{m_{1}}{2}, \frac{m_{2}}{2}, \frac{m_{3}}{2}, \frac{m}{2}\right)$ is also a solution of ( 2 ) which contradicts the minimality of $m$. So, we have $n \geq 5$. The example with $n=5$ is already shown in Solution 1 . + +N4. Let $a, b$ be integers, and let $P(x)=a x^{3}+b x$. For any positive integer $n$ we say that the pair $(a, b)$ is $n$-good if $n \mid P(m)-P(k)$ implies $n \mid m-k$ for all integers $m, k$. We say that $(a, b)$ is very good if $(a, b)$ is $n$-good for infinitely many positive integers $n$. +(a) Find a pair $(a, b)$ which is 51 -good, but not very good. +(b) Show that all 2010-good pairs are very good. +(Turkey) +Solution. (a) We show that the pair $\left(1,-51^{2}\right)$ is good but not very good. Let $P(x)=x^{3}-51^{2} x$. Since $P(51)=P(0)$, the pair $\left(1,-51^{2}\right)$ is not $n$-good for any positive integer that does not divide 51 . Therefore, $\left(1,-51^{2}\right)$ is not very good. + +On the other hand, if $P(m) \equiv P(k)(\bmod 51)$, then $m^{3} \equiv k^{3}(\bmod 51)$. By Fermat's theorem, from this we obtain + +$$ +m \equiv m^{3} \equiv k^{3} \equiv k \quad(\bmod 3) \quad \text { and } \quad m \equiv m^{33} \equiv k^{33} \equiv k \quad(\bmod 17) . +$$ + +Hence we have $m \equiv k(\bmod 51)$. Therefore $\left(1,-51^{2}\right)$ is 51 -good. +(b) We will show that if a pair $(a, b)$ is 2010-good then $(a, b)$ is $67^{i}$-good for all positive integer $i$. +Claim 1. If $(a, b)$ is 2010 -good then $(a, b)$ is 67 -good. +Proof. Assume that $P(m)=P(k)(\bmod 67)$. Since 67 and 30 are coprime, there exist integers $m^{\prime}$ and $k^{\prime}$ such that $k^{\prime} \equiv k(\bmod 67), k^{\prime} \equiv 0(\bmod 30)$, and $m^{\prime} \equiv m(\bmod 67), m^{\prime} \equiv 0$ $(\bmod 30)$. Then we have $P\left(m^{\prime}\right) \equiv P(0) \equiv P\left(k^{\prime}\right)(\bmod 30)$ and $P\left(m^{\prime}\right) \equiv P(m) \equiv P(k) \equiv P\left(k^{\prime}\right)$ $(\bmod 67)$, hence $P\left(m^{\prime}\right) \equiv P\left(k^{\prime}\right)(\bmod 2010)$. This implies $m^{\prime} \equiv k^{\prime}(\bmod 2010)$ as $(a, b)$ is 2010 -good. It follows that $m \equiv m^{\prime} \equiv k^{\prime} \equiv k(\bmod 67)$. Therefore, $(a, b)$ is 67 -good. +Claim 2. If $(a, b)$ is 67 -good then $67 \mid a$. +Proof. Suppose that $67 \nmid a$. Consider the sets $\left\{a t^{2}(\bmod 67): 0 \leq t \leq 33\right\}$ and $\left\{-3 a s^{2}-b\right.$ $\bmod 67: 0 \leq s \leq 33\}$. Since $a \not \equiv 0(\bmod 67)$, each of these sets has 34 elements. Hence they have at least one element in common. If $a t^{2} \equiv-3 a s^{2}-b(\bmod 67)$ then for $m=t \pm s, k=\mp 2 s$ we have + +$$ +\begin{aligned} +P(m)-P(k)=a\left(m^{3}-k^{3}\right)+b(m-k) & =(m-k)\left(a\left(m^{2}+m k+k^{2}\right)+b\right) \\ +& =(t \pm 3 s)\left(a t^{2}+3 a s^{2}+b\right) \equiv 0 \quad(\bmod 67) +\end{aligned} +$$ + +Since $(a, b)$ is 67 -good, we must have $m \equiv k(\bmod 67)$ in both cases, that is, $t \equiv 3 s(\bmod 67)$ and $t \equiv-3 s(\bmod 67)$. This means $t \equiv s \equiv 0(\bmod 67)$ and $b \equiv-3 a s^{2}-a t^{2} \equiv 0(\bmod 67)$. But then $67 \mid P(7)-P(2)=67 \cdot 5 a+5 b$ and $67 \not 7-2$, contradicting that $(a, b)$ is 67 -good. +Claim 3. If $(a, b)$ is 2010 -good then $(a, b)$ is $67^{i}$-good all $i \geq 1$. +Proof. By Claim 2, we have $67 \mid a$. If $67 \mid b$, then $P(x) \equiv P(0)(\bmod 67)$ for all $x$, contradicting that $(a, b)$ is 67 -good. Hence, $67 \nmid b$. + +Suppose that $67^{i} \mid P(m)-P(k)=(m-k)\left(a\left(m^{2}+m k+k^{2}\right)+b\right)$. Since $67 \mid a$ and $67 \nmid b$, the second factor $a\left(m^{2}+m k+k^{2}\right)+b$ is coprime to 67 and hence $67^{i} \mid m-k$. Therefore, $(a, b)$ is $67^{i}$-good. +Comment 1. In the proof of Claim 2, the following reasoning can also be used. Since 3 is not a quadratic residue modulo 67 , either $a u^{2} \equiv-b(\bmod 67)$ or $3 a v^{2} \equiv-b(\bmod 67)$ has a solution. The settings $(m, k)=(u, 0)$ in the first case and $(m, k)=(v,-2 v)$ in the second case lead to $b \equiv 0$ $(\bmod 67)$. +Comment 2. The pair $(67,30)$ is $n$-good if and only if $n=d \cdot 67^{i}$, where $d \mid 30$ and $i \geq 0$. It shows that in part (b), one should deal with the large powers of 67 to reach the solution. The key property of number 67 is that it has the form $3 k+1$, so there exists a nontrivial cubic root of unity modulo 67 . + +N5. Let $\mathbb{N}$ be the set of all positive integers. Find all functions $f: \mathbb{N} \rightarrow \mathbb{N}$ such that the number $(f(m)+n)(m+f(n))$ is a square for all $m, n \in \mathbb{N}$. + +Answer. All functions of the form $f(n)=n+c$, where $c \in \mathbb{N} \cup\{0\}$. +Solution. First, it is clear that all functions of the form $f(n)=n+c$ with a constant nonnegative integer $c$ satisfy the problem conditions since $(f(m)+n)(f(n)+m)=(n+m+c)^{2}$ is a square. + +We are left to prove that there are no other functions. We start with the following Lemma. Suppose that $p \mid f(k)-f(\ell)$ for some prime $p$ and positive integers $k, \ell$. Then $p \mid k-\ell$. Proof. Suppose first that $p^{2} \mid f(k)-f(\ell)$, so $f(\ell)=f(k)+p^{2} a$ for some integer $a$. Take some positive integer $D>\max \{f(k), f(\ell)\}$ which is not divisible by $p$ and set $n=p D-f(k)$. Then the positive numbers $n+f(k)=p D$ and $n+f(\ell)=p D+(f(\ell)-f(k))=p(D+p a)$ are both divisible by $p$ but not by $p^{2}$. Now, applying the problem conditions, we get that both the numbers $(f(k)+n)(f(n)+k)$ and $(f(\ell)+n)(f(n)+\ell)$ are squares divisible by $p$ (and thus by $p^{2}$ ); this means that the multipliers $f(n)+k$ and $f(n)+\ell$ are also divisible by $p$, therefore $p \mid(f(n)+k)-(f(n)+\ell)=k-\ell$ as well. + +On the other hand, if $f(k)-f(\ell)$ is divisible by $p$ but not by $p^{2}$, then choose the same number $D$ and set $n=p^{3} D-f(k)$. Then the positive numbers $f(k)+n=p^{3} D$ and $f(\ell)+n=$ $p^{3} D+(f(\ell)-f(k))$ are respectively divisible by $p^{3}$ (but not by $p^{4}$ ) and by $p$ (but not by $p^{2}$ ). Hence in analogous way we obtain that the numbers $f(n)+k$ and $f(n)+\ell$ are divisible by $p$, therefore $p \mid(f(n)+k)-(f(n)+\ell)=k-\ell$. + +We turn to the problem. First, suppose that $f(k)=f(\ell)$ for some $k, \ell \in \mathbb{N}$. Then by Lemma we have that $k-\ell$ is divisible by every prime number, so $k-\ell=0$, or $k=\ell$. Therefore, the function $f$ is injective. + +Next, consider the numbers $f(k)$ and $f(k+1)$. Since the number $(k+1)-k=1$ has no prime divisors, by Lemma the same holds for $f(k+1)-f(k)$; thus $|f(k+1)-f(k)|=1$. + +Now, let $f(2)-f(1)=q,|q|=1$. Then we prove by induction that $f(n)=f(1)+q(n-1)$. The base for $n=1,2$ holds by the definition of $q$. For the step, if $n>1$ we have $f(n+1)=$ $f(n) \pm q=f(1)+q(n-1) \pm q$. Since $f(n) \neq f(n-2)=f(1)+q(n-2)$, we get $f(n)=f(1)+q n$, as desired. + +Finally, we have $f(n)=f(1)+q(n-1)$. Then $q$ cannot be -1 since otherwise for $n \geq f(1)+1$ we have $f(n) \leq 0$ which is impossible. Hence $q=1$ and $f(n)=(f(1)-1)+n$ for each $n \in \mathbb{N}$, and $f(1)-1 \geq 0$, as desired. + +N6. The rows and columns of a $2^{n} \times 2^{n}$ table are numbered from 0 to $2^{n}-1$. The cells of the table have been colored with the following property being satisfied: for each $0 \leq i, j \leq 2^{n}-1$, the $j$ th cell in the $i$ th row and the $(i+j)$ th cell in the $j$ th row have the same color. (The indices of the cells in a row are considered modulo $2^{n}$.) + +Prove that the maximal possible number of colors is $2^{n}$. + +Solution. Throughout the solution we denote the cells of the table by coordinate pairs; $(i, j)$ refers to the $j$ th cell in the $i$ th row. + +Consider the directed graph, whose vertices are the cells of the board, and the edges are the arrows $(i, j) \rightarrow(j, i+j)$ for all $0 \leq i, j \leq 2^{n}-1$. From each vertex $(i, j)$, exactly one edge passes $\left(\right.$ to $\left(j, i+j \bmod 2^{n}\right)$ ); conversely, to each cell $(j, k)$ exactly one edge is directed (from the cell $\left.\left(k-j \bmod 2^{n}, j\right)\right)$. Hence, the graph splits into cycles. + +Now, in any coloring considered, the vertices of each cycle should have the same color by the problem condition. On the other hand, if each cycle has its own color, the obtained coloring obviously satisfies the problem conditions. Thus, the maximal possible number of colors is the same as the number of cycles, and we have to prove that this number is $2^{n}$. + +Next, consider any cycle $\left(i_{1}, j_{1}\right),\left(i_{2}, j_{2}\right), \ldots$; we will describe it in other terms. Define a sequence $\left(a_{0}, a_{1}, \ldots\right)$ by the relations $a_{0}=i_{1}, a_{1}=j_{1}, a_{n+1}=a_{n}+a_{n-1}$ for all $n \geq 1$ (we say that such a sequence is a Fibonacci-type sequence). Then an obvious induction shows that $i_{k} \equiv a_{k-1}\left(\bmod 2^{n}\right), j_{k} \equiv a_{k}\left(\bmod 2^{n}\right)$. Hence we need to investigate the behavior of Fibonacci-type sequences modulo $2^{n}$. + +Denote by $F_{0}, F_{1}, \ldots$ the Fibonacci numbers defined by $F_{0}=0, F_{1}=1$, and $F_{n+2}=$ $F_{n+1}+F_{n}$ for $n \geq 0$. We also set $F_{-1}=1$ according to the recurrence relation. + +For every positive integer $m$, denote by $\nu(m)$ the exponent of 2 in the prime factorization of $m$, i.e. for which $2^{\nu(m)} \mid m$ but $2^{\nu(m)+1} \backslash m$. +Lemma 1. For every Fibonacci-type sequence $a_{0}, a_{1}, a_{2}, \ldots$, and every $k \geq 0$, we have $a_{k}=$ $F_{k-1} a_{0}+F_{k} a_{1}$. +Proof. Apply induction on $k$. The base cases $k=0,1$ are trivial. For the step, from the induction hypothesis we get + +$$ +a_{k+1}=a_{k}+a_{k-1}=\left(F_{k-1} a_{0}+F_{k} a_{1}\right)+\left(F_{k-2} a_{0}+F_{k-1} a_{1}\right)=F_{k} a_{0}+F_{k+1} a_{1} +$$ + +Lemma 2. For every $m \geq 3$, +(a) we have $\nu\left(F_{3 \cdot 2^{m-2}}\right)=m$; +(b) $d=3 \cdot 2^{m-2}$ is the least positive index for which $2^{m} \mid F_{d}$; +(c) $F_{3 \cdot 2^{m-2}+1} \equiv 1+2^{m-1}\left(\bmod 2^{m}\right)$. + +Proof. Apply induction on $m$. In the base case $m=3$ we have $\nu\left(F_{3 \cdot 2^{m-2}}\right)=F_{6}=8$, so $\nu\left(F_{3 \cdot 2^{m-2}}\right)=\nu(8)=3$, the preceding Fibonacci-numbers are not divisible by 8 , and indeed $F_{3 \cdot 2^{m-2}+1}=F_{7}=13 \equiv 1+4(\bmod 8)$. + +Now suppose that $m>3$ and let $k=3 \cdot 2^{m-3}$. By applying Lemma 1 to the Fibonacci-type sequence $F_{k}, F_{k+1}, \ldots$ we get + +$$ +\begin{gathered} +F_{2 k}=F_{k-1} F_{k}+F_{k} F_{k+1}=\left(F_{k+1}-F_{k}\right) F_{k}+F_{k+1} F_{k}=2 F_{k+1} F_{k}-F_{k}^{2} \\ +F_{2 k+1}=F_{k} \cdot F_{k}+F_{k+1} \cdot F_{k+1}=F_{k}^{2}+F_{k+1}^{2} +\end{gathered} +$$ + +By the induction hypothesis, $\nu\left(F_{k}\right)=m-1$, and $F_{k+1}$ is odd. Therefore we get $\nu\left(F_{k}^{2}\right)=$ $2(m-1)>(m-1)+1=\nu\left(2 F_{k} F_{k+1}\right)$, which implies $\nu\left(F_{2 k}\right)=m$, establishing statement (a). + +Moreover, since $F_{k+1}=1+2^{m-2}+a 2^{m-1}$ for some integer $a$, we get + +$$ +F_{2 k+1}=F_{k}^{2}+F_{k+1}^{2} \equiv 0+\left(1+2^{m-2}+a 2^{m-1}\right)^{2} \equiv 1+2^{m-1} \quad\left(\bmod 2^{m}\right) +$$ + +as desired in statement (c). +We are left to prove that $2^{m} \backslash F_{\ell}$ for $\ell<2 k$. Assume the contrary. Since $2^{m-1} \mid F_{\ell}$, from the induction hypothesis it follows that $\ell>k$. But then we have $F_{\ell}=F_{k-1} F_{\ell-k}+F_{k} F_{\ell-k+1}$, where the second summand is divisible by $2^{m-1}$ but the first one is not (since $F_{k-1}$ is odd and $\ell-k 0$ such that $a_{k+p} \equiv a_{k}\left(\bmod 2^{n}\right)$ for all $k \geq 0$. +Lemma 3. Let $A=\left(a_{0}, a_{1}, \ldots\right)$ be a Fibonacci-type sequence such that $\mu(A)=k Mathematical Olympiad
12-24 July 2011
Amsterdam
The Netherlands + +Problem shortlist with solutions + +## IMO regulation:
these shortlist problems have to be kept strictly confidential until IMO 2012. + +The problem selection committee + +Bart de Smit (chairman), Ilya Bogdanov, Johan Bosman, + +Andries Brouwer, Gabriele Dalla Torre, Géza Kós, + +Hendrik Lenstra, Charles Leytem, Ronald van Luijk, + +Christian Reiher, Eckard Specht, Hans Sterk, Lenny Taelman + +The committee gratefully acknowledges the receipt of 142 problem proposals by the following 46 countries: + +Armenia, Australia, Austria, Belarus, Belgium, Bosnia and Herzegovina, Brazil, Bulgaria, Canada, Colombia, Cyprus, Denmark, Estonia, Finland, France, Germany, Greece, Hong Kong, Hungary, India, Islamic Republic of Iran, Ireland, Israel, Japan, Kazakhstan, Republic of Korea, Luxembourg, Malaysia, Mexico, Mongolia, Montenegro, Pakistan, Poland, Romania, Russian Federation, Saudi Arabia, Serbia, Slovakia, Slovenia, Sweden, Taiwan, Thailand, Turkey, Ukraine, United Kingdom, United States of America + +## Algebra + +## A1 + +For any set $A=\left\{a_{1}, a_{2}, a_{3}, a_{4}\right\}$ of four distinct positive integers with sum $s_{A}=a_{1}+a_{2}+a_{3}+a_{4}$, let $p_{A}$ denote the number of pairs $(i, j)$ with $1 \leq i\sqrt{2}$ and $a^{2}+b^{2}+c^{2}=3$. Prove that + +$$ +\frac{a}{(b+c-a)^{2}}+\frac{b}{(c+a-b)^{2}}+\frac{c}{(a+b-c)^{2}} \geq \frac{3}{(a b c)^{2}} +$$ + +## Combinatorics + +## C1 + +Let $n>0$ be an integer. We are given a balance and $n$ weights of weight $2^{0}, 2^{1}, \ldots, 2^{n-1}$. In a sequence of $n$ moves we place all weights on the balance. In the first move we choose a weight and put it on the left pan. In each of the following moves we choose one of the remaining weights and we add it either to the left or to the right pan. Compute the number of ways in which we can perform these $n$ moves in such a way that the right pan is never heavier than the left pan. + +## $\mathrm{C} 2$ + +Suppose that 1000 students are standing in a circle. Prove that there exists an integer $k$ with $100 \leq k \leq 300$ such that in this circle there exists a contiguous group of $2 k$ students, for which the first half contains the same number of girls as the second half. + +## C3 + +Let $\mathcal{S}$ be a finite set of at least two points in the plane. Assume that no three points of $\mathcal{S}$ are collinear. By a windmill we mean a process as follows. Start with a line $\ell$ going through a point $P \in \mathcal{S}$. Rotate $\ell$ clockwise around the pivot $P$ until the line contains another point $Q$ of $\mathcal{S}$. The point $Q$ now takes over as the new pivot. This process continues indefinitely, with the pivot always being a point from $\mathcal{S}$. + +Show that for a suitable $P \in \mathcal{S}$ and a suitable starting line $\ell$ containing $P$, the resulting windmill will visit each point of $\mathcal{S}$ as a pivot infinitely often. + +## $\mathrm{C} 4$ + +Determine the greatest positive integer $k$ that satisfies the following property: The set of positive integers can be partitioned into $k$ subsets $A_{1}, A_{2}, \ldots, A_{k}$ such that for all integers $n \geq 15$ and all $i \in\{1,2, \ldots, k\}$ there exist two distinct elements of $A_{i}$ whose sum is $n$. + +## C5 + +Let $m$ be a positive integer and consider a checkerboard consisting of $m$ by $m$ unit squares. At the midpoints of some of these unit squares there is an ant. At time 0 , each ant starts moving with speed 1 parallel to some edge of the checkerboard. When two ants moving in opposite directions meet, they both turn $90^{\circ}$ clockwise and continue moving with speed 1 . When more than two ants meet, or when two ants moving in perpendicular directions meet, the ants continue moving in the same direction as before they met. When an ant reaches one of the edges of the checkerboard, it falls off and will not re-appear. + +Considering all possible starting positions, determine the latest possible moment at which the last ant falls off the checkerboard or prove that such a moment does not necessarily exist. + +## C6 + +Let $n$ be a positive integer and let $W=\ldots x_{-1} x_{0} x_{1} x_{2} \ldots$ be an infinite periodic word consisting of the letters $a$ and $b$. Suppose that the minimal period $N$ of $W$ is greater than $2^{n}$. + +A finite nonempty word $U$ is said to appear in $W$ if there exist indices $k \leq \ell$ such that $U=x_{k} x_{k+1} \ldots x_{\ell}$. A finite word $U$ is called ubiquitous if the four words $U a, U b, a U$, and $b U$ all appear in $W$. Prove that there are at least $n$ ubiquitous finite nonempty words. + +## C7 + +On a square table of 2011 by 2011 cells we place a finite number of napkins that each cover a square of 52 by 52 cells. In each cell we write the number of napkins covering it, and we record the maximal number $k$ of cells that all contain the same nonzero number. Considering all possible napkin configurations, what is the largest value of $k$ ? + +## Geometry + +## G1 + +Let $A B C$ be an acute triangle. Let $\omega$ be a circle whose center $L$ lies on the side $B C$. Suppose that $\omega$ is tangent to $A B$ at $B^{\prime}$ and to $A C$ at $C^{\prime}$. Suppose also that the circumcenter $O$ of the triangle $A B C$ lies on the shorter $\operatorname{arc} B^{\prime} C^{\prime}$ of $\omega$. Prove that the circumcircle of $A B C$ and $\omega$ meet at two points. + +## G2 + +Let $A_{1} A_{2} A_{3} A_{4}$ be a non-cyclic quadrilateral. Let $O_{1}$ and $r_{1}$ be the circumcenter and the circumradius of the triangle $A_{2} A_{3} A_{4}$. Define $O_{2}, O_{3}, O_{4}$ and $r_{2}, r_{3}, r_{4}$ in a similar way. Prove that + +$$ +\frac{1}{O_{1} A_{1}^{2}-r_{1}^{2}}+\frac{1}{O_{2} A_{2}^{2}-r_{2}^{2}}+\frac{1}{O_{3} A_{3}^{2}-r_{3}^{2}}+\frac{1}{O_{4} A_{4}^{2}-r_{4}^{2}}=0 +$$ + +## G3 + +Let $A B C D$ be a convex quadrilateral whose sides $A D$ and $B C$ are not parallel. Suppose that the circles with diameters $A B$ and $C D$ meet at points $E$ and $F$ inside the quadrilateral. Let $\omega_{E}$ be the circle through the feet of the perpendiculars from $E$ to the lines $A B, B C$, and $C D$. Let $\omega_{F}$ be the circle through the feet of the perpendiculars from $F$ to the lines $C D, D A$, and $A B$. Prove that the midpoint of the segment $E F$ lies on the line through the two intersection points of $\omega_{E}$ and $\omega_{F}$. + +## G4 + +Let $A B C$ be an acute triangle with circumcircle $\Omega$. Let $B_{0}$ be the midpoint of $A C$ and let $C_{0}$ be the midpoint of $A B$. Let $D$ be the foot of the altitude from $A$, and let $G$ be the centroid of the triangle $A B C$. Let $\omega$ be a circle through $B_{0}$ and $C_{0}$ that is tangent to the circle $\Omega$ at a point $X \neq A$. Prove that the points $D, G$, and $X$ are collinear. + +## G5 + +Let $A B C$ be a triangle with incenter $I$ and circumcircle $\omega$. Let $D$ and $E$ be the second intersection points of $\omega$ with the lines $A I$ and $B I$, respectively. The chord $D E$ meets $A C$ at a point $F$, and $B C$ at a point $G$. Let $P$ be the intersection point of the line through $F$ parallel to $A D$ and the line through $G$ parallel to $B E$. Suppose that the tangents to $\omega$ at $A$ and at $B$ meet at a point $K$. Prove that the three lines $A E, B D$, and $K P$ are either parallel or concurrent. + +## G6 + +Let $A B C$ be a triangle with $A B=A C$, and let $D$ be the midpoint of $A C$. The angle bisector of $\angle B A C$ intersects the circle through $D, B$, and $C$ in a point $E$ inside the triangle $A B C$. The line $B D$ intersects the circle through $A, E$, and $B$ in two points $B$ and $F$. The lines $A F$ and $B E$ meet at a point $I$, and the lines $C I$ and $B D$ meet at a point $K$. Show that $I$ is the incenter of triangle $K A B$. + +## G7 + +Let $A B C D E F$ be a convex hexagon all of whose sides are tangent to a circle $\omega$ with center $O$. Suppose that the circumcircle of triangle $A C E$ is concentric with $\omega$. Let $J$ be the foot of the perpendicular from $B$ to $C D$. Suppose that the perpendicular from $B$ to $D F$ intersects the line $E O$ at a point $K$. Let $L$ be the foot of the perpendicular from $K$ to $D E$. Prove that $D J=D L$. + +## G8 + +Let $A B C$ be an acute triangle with circumcircle $\omega$. Let $t$ be a tangent line to $\omega$. Let $t_{a}, t_{b}$, and $t_{c}$ be the lines obtained by reflecting $t$ in the lines $B C, C A$, and $A B$, respectively. Show that the circumcircle of the triangle determined by the lines $t_{a}, t_{b}$, and $t_{c}$ is tangent to the circle $\omega$. + +## Number Theory + +## N1 + +For any integer $d>0$, let $f(d)$ be the smallest positive integer that has exactly $d$ positive divisors (so for example we have $f(1)=1, f(5)=16$, and $f(6)=12$ ). Prove that for every integer $k \geq 0$ the number $f\left(2^{k}\right)$ divides $f\left(2^{k+1}\right)$. + +## N2 + +Consider a polynomial $P(x)=\left(x+d_{1}\right)\left(x+d_{2}\right) \cdot \ldots \cdot\left(x+d_{9}\right)$, where $d_{1}, d_{2}, \ldots, d_{9}$ are nine distinct integers. Prove that there exists an integer $N$ such that for all integers $x \geq N$ the number $P(x)$ is divisible by a prime number greater than 20 . + +## N3 + +Let $n \geq 1$ be an odd integer. Determine all functions $f$ from the set of integers to itself such that for all integers $x$ and $y$ the difference $f(x)-f(y)$ divides $x^{n}-y^{n}$. + +## N4 + +For each positive integer $k$, let $t(k)$ be the largest odd divisor of $k$. Determine all positive integers $a$ for which there exists a positive integer $n$ such that all the differences + +$$ +t(n+a)-t(n), \quad t(n+a+1)-t(n+1), \quad \ldots, \quad t(n+2 a-1)-t(n+a-1) +$$ + +are divisible by 4 . + +## N5 + +Let $f$ be a function from the set of integers to the set of positive integers. Suppose that for any two integers $m$ and $n$, the difference $f(m)-f(n)$ is divisible by $f(m-n)$. Prove that for all integers $m, n$ with $f(m) \leq f(n)$ the number $f(n)$ is divisible by $f(m)$. + +## N6 + +Let $P(x)$ and $Q(x)$ be two polynomials with integer coefficients such that no nonconstant polynomial with rational coefficients divides both $P(x)$ and $Q(x)$. Suppose that for every positive integer $n$ the integers $P(n)$ and $Q(n)$ are positive, and $2^{Q(n)}-1$ divides $3^{P(n)}-1$. Prove that $Q(x)$ is a constant polynomial. + +## N7 + +Let $p$ be an odd prime number. For every integer $a$, define the number + +$$ +S_{a}=\frac{a}{1}+\frac{a^{2}}{2}+\cdots+\frac{a^{p-1}}{p-1} +$$ + +Let $m$ and $n$ be integers such that + +$$ +S_{3}+S_{4}-3 S_{2}=\frac{m}{n} +$$ + +Prove that $p$ divides $m$. + +## N8 + +Let $k$ be a positive integer and set $n=2^{k}+1$. Prove that $n$ is a prime number if and only if the following holds: there is a permutation $a_{1}, \ldots, a_{n-1}$ of the numbers $1,2, \ldots, n-1$ and a sequence of integers $g_{1}, g_{2}, \ldots, g_{n-1}$ such that $n$ divides $g_{i}^{a_{i}}-a_{i+1}$ for every $i \in\{1,2, \ldots, n-1\}$, where we set $a_{n}=a_{1}$. + +## A1 + +For any set $A=\left\{a_{1}, a_{2}, a_{3}, a_{4}\right\}$ of four distinct positive integers with sum $s_{A}=a_{1}+a_{2}+a_{3}+a_{4}$, let $p_{A}$ denote the number of pairs $(i, j)$ with $1 \leq i a_{1}+a_{3}$ and $a_{3}+a_{4}>a_{1}+a_{2}$. Hence $a_{2}+a_{4}$ and $a_{3}+a_{4}$ do not divide $s_{A}$. This proves $p_{A} \leq 4$. + +Now suppose $p_{A}=4$. By the previous argument we have + +$$ +\begin{array}{lll} +a_{1}+a_{4} \mid a_{2}+a_{3} & \text { and } & a_{2}+a_{3} \mid a_{1}+a_{4}, \\ +a_{1}+a_{2} \mid a_{3}+a_{4} & \text { and } & a_{3}+a_{4} \not a_{1}+a_{2}, \\ +a_{1}+a_{3} \mid a_{2}+a_{4} & \text { and } & a_{2}+a_{4} \not a_{1}+a_{3} . +\end{array} +$$ + +Hence, there exist positive integers $m$ and $n$ with $m>n \geq 2$ such that + +$$ +\left\{\begin{array}{l} +a_{1}+a_{4}=a_{2}+a_{3} \\ +m\left(a_{1}+a_{2}\right)=a_{3}+a_{4} \\ +n\left(a_{1}+a_{3}\right)=a_{2}+a_{4} +\end{array}\right. +$$ + +Adding up the first equation and the third one, we get $n\left(a_{1}+a_{3}\right)=2 a_{2}+a_{3}-a_{1}$. If $n \geq 3$, then $n\left(a_{1}+a_{3}\right)>3 a_{3}>2 a_{2}+a_{3}>2 a_{2}+a_{3}-a_{1}$. This is a contradiction. Therefore $n=2$. If we multiply by 2 the sum of the first equation and the third one, we obtain + +$$ +6 a_{1}+2 a_{3}=4 a_{2} +$$ + +while the sum of the first one and the second one is + +$$ +(m+1) a_{1}+(m-1) a_{2}=2 a_{3} . +$$ + +Adding up the last two equations we get + +$$ +(m+7) a_{1}=(5-m) a_{2} . +$$ + +It follows that $5-m \geq 1$, because the left-hand side of the last equation and $a_{2}$ are positive. Since we have $m>n=2$, the integer $m$ can be equal only to either 3 or 4 . Substituting $(3,2)$ and $(4,2)$ for $(m, n)$ and solving the previous system of equations, we find the families of solutions $\{d, 5 d, 7 d, 11 d\}$ and $\{d, 11 d, 19 d, 29 d\}$, where $d$ is any positive integer. + +## A 2 + +Determine all sequences $\left(x_{1}, x_{2}, \ldots, x_{2011}\right)$ of positive integers such that for every positive integer $n$ there is an integer $a$ with + +$$ +x_{1}^{n}+2 x_{2}^{n}+\cdots+2011 x_{2011}^{n}=a^{n+1}+1 . +$$ + +Answer. The only sequence that satisfies the condition is + +$$ +\left(x_{1}, \ldots, x_{2011}\right)=(1, k, \ldots, k) \quad \text { with } k=2+3+\cdots+2011=2023065 +$$ + +Solution. Throughout this solution, the set of positive integers will be denoted by $\mathbb{Z}_{+}$. + +Put $k=2+3+\cdots+2011=2023065$. We have + +$$ +1^{n}+2 k^{n}+\cdots 2011 k^{n}=1+k \cdot k^{n}=k^{n+1}+1 +$$ + +for all $n$, so $(1, k, \ldots, k)$ is a valid sequence. We shall prove that it is the only one. + +Let a valid sequence $\left(x_{1}, \ldots, x_{2011}\right)$ be given. For each $n \in \mathbb{Z}_{+}$we have some $y_{n} \in \mathbb{Z}_{+}$with + +$$ +x_{1}^{n}+2 x_{2}^{n}+\cdots+2011 x_{2011}^{n}=y_{n}^{n+1}+1 . +$$ + +Note that $x_{1}^{n}+2 x_{2}^{n}+\cdots+2011 x_{2011}^{n}<\left(x_{1}+2 x_{2}+\cdots+2011 x_{2011}\right)^{n+1}$, which implies that the sequence $\left(y_{n}\right)$ is bounded. In particular, there is some $y \in \mathbb{Z}_{+}$with $y_{n}=y$ for infinitely many $n$. + +Let $m$ be the maximum of all the $x_{i}$. Grouping terms with equal $x_{i}$ together, the sum $x_{1}^{n}+$ $2 x_{2}^{n}+\cdots+2011 x_{2011}^{n}$ can be written as + +$$ +x_{1}^{n}+2 x_{2}^{n}+\cdots+x_{2011}^{n}=a_{m} m^{n}+a_{m-1}(m-1)^{n}+\cdots+a_{1} +$$ + +with $a_{i} \geq 0$ for all $i$ and $a_{1}+\cdots+a_{m}=1+2+\cdots+2011$. So there exist arbitrarily large values of $n$, for which + +$$ +a_{m} m^{n}+\cdots+a_{1}-1-y \cdot y^{n}=0 \text {. } +$$ + +The following lemma will help us to determine the $a_{i}$ and $y$ : + +Lemma. Let integers $b_{1}, \ldots, b_{N}$ be given and assume that there are arbitrarily large positive integers $n$ with $b_{1}+b_{2} 2^{n}+\cdots+b_{N} N^{n}=0$. Then $b_{i}=0$ for all $i$. + +Proof. Suppose that not all $b_{i}$ are zero. We may assume without loss of generality that $b_{N} \neq 0$. + +Dividing through by $N^{n}$ gives + +$$ +\left|b_{N}\right|=\left|b_{N-1}\left(\frac{N-1}{N}\right)^{n}+\cdots+b_{1}\left(\frac{1}{N}\right)^{n}\right| \leq\left(\left|b_{N-1}\right|+\cdots+\left|b_{1}\right|\right)\left(\frac{N-1}{N}\right)^{n} . +$$ + +The expression $\left(\frac{N-1}{N}\right)^{n}$ can be made arbitrarily small for $n$ large enough, contradicting the assumption that $b_{N}$ be non-zero. + +We obviously have $y>1$. Applying the lemma to (1) we see that $a_{m}=y=m, a_{1}=1$, and all the other $a_{i}$ are zero. This implies $\left(x_{1}, \ldots, x_{2011}\right)=(1, m, \ldots, m)$. But we also have $1+m=a_{1}+\cdots+a_{m}=1+\cdots+2011=1+k$ so $m=k$, which is what we wanted to show. + +## A3 + +Determine all pairs $(f, g)$ of functions from the set of real numbers to itself that satisfy + +$$ +g(f(x+y))=f(x)+(2 x+y) g(y) +$$ + +for all real numbers $x$ and $y$. + +Answer. Either both $f$ and $g$ vanish identically, or there exists a real number $C$ such that $f(x)=x^{2}+C$ and $g(x)=x$ for all real numbers $x$. + +Solution. Clearly all these pairs of functions satisfy the functional equation in question, so it suffices to verify that there cannot be any further ones. Substituting $-2 x$ for $y$ in the given functional equation we obtain + +$$ +g(f(-x))=f(x) . +$$ + +Using this equation for $-x-y$ in place of $x$ we obtain + +$$ +f(-x-y)=g(f(x+y))=f(x)+(2 x+y) g(y) . +$$ + +Now for any two real numbers $a$ and $b$, setting $x=-b$ and $y=a+b$ we get + +$$ +f(-a)=f(-b)+(a-b) g(a+b) . +$$ + +If $c$ denotes another arbitrary real number we have similarly + +$$ +f(-b)=f(-c)+(b-c) g(b+c) +$$ + +as well as + +$$ +f(-c)=f(-a)+(c-a) g(c+a) . +$$ + +Adding all these equations up, we obtain + +$$ +((a+c)-(b+c)) g(a+b)+((a+b)-(a+c)) g(b+c)+((b+c)-(a+b)) g(a+c)=0 \text {. } +$$ + +Now given any three real numbers $x, y$, and $z$ one may determine three reals $a, b$, and $c$ such that $x=b+c, y=c+a$, and $z=a+b$, so that we get + +$$ +(y-x) g(z)+(z-y) g(x)+(x-z) g(y)=0 . +$$ + +This implies that the three points $(x, g(x)),(y, g(y))$, and $(z, g(z))$ from the graph of $g$ are collinear. Hence that graph is a line, i.e., $g$ is either a constant or a linear function. + +Let us write $g(x)=A x+B$, where $A$ and $B$ are two real numbers. Substituting $(0,-y)$ for $(x, y)$ in (2) and denoting $C=f(0)$, we have $f(y)=A y^{2}-B y+C$. Now, comparing the coefficients of $x^{2}$ in (1I) we see that $A^{2}=A$, so $A=0$ or $A=1$. + +If $A=0$, then (1) becomes $B=-B x+C$ and thus $B=C=0$, which provides the first of the two solutions mentioned above. + +Now suppose $A=1$. Then (1) becomes $x^{2}-B x+C+B=x^{2}-B x+C$, so $B=0$. Thus, $g(x)=x$ and $f(x)=x^{2}+C$, which is the second solution from above. + +Comment. Another way to show that $g(x)$ is either a constant or a linear function is the following. If we interchange $x$ and $y$ in the given functional equation and subtract this new equation from the given one, we obtain + +$$ +f(x)-f(y)=(2 y+x) g(x)-(2 x+y) g(y) . +$$ + +Substituting $(x, 0),(1, x)$, and $(0,1)$ for $(x, y)$, we get + +$$ +\begin{aligned} +& f(x)-f(0)=x g(x)-2 x g(0), \\ +& f(1)-f(x)=(2 x+1) g(1)-(x+2) g(x), \\ +& f(0)-f(1)=2 g(0)-g(1) . +\end{aligned} +$$ + +Taking the sum of these three equations and dividing by 2 , we obtain + +$$ +g(x)=x(g(1)-g(0))+g(0) . +$$ + +This proves that $g(x)$ is either a constant of a linear function. + +## A4 + +Determine all pairs $(f, g)$ of functions from the set of positive integers to itself that satisfy + +$$ +f^{g(n)+1}(n)+g^{f(n)}(n)=f(n+1)-g(n+1)+1 +$$ + +for every positive integer $n$. Here, $f^{k}(n)$ means $\underbrace{f(f(\ldots f}_{k}(n) \ldots))$. + +Answer. The only pair $(f, g)$ of functions that satisfies the equation is given by $f(n)=n$ and $g(n)=1$ for all $n$. + +Solution. The given relation implies + +$$ +f\left(f^{g(n)}(n)\right) 1$, then (1) reads $f\left(f^{g(x-1)}(x-1)\right) n$. Substituting $x-1$ into (1) we have $f\left(f^{g(x-1)}(x-1)\right) n$. So $b=n$, and hence $y_{n}=n$, which proves (ii) ${ }_{n}$. Next, from (i) ${ }_{n}$ we now get $f(k)=n \Longleftrightarrow k=n$, so removing all the iterations of $f$ in (3) we obtain $x-1=b=n$, which proves (i) ${ }_{n+1}$. + +So, all the statements in (2) are valid and hence $f(n)=n$ for all $n$. The given relation between $f$ and $g$ now reads $n+g^{n}(n)=n+1-g(n+1)+1$ or $g^{n}(n)+g(n+1)=2$, from which it +immediately follows that we have $g(n)=1$ for all $n$. + +Comment. Several variations of the above solution are possible. For instance, one may first prove by induction that the smallest $n$ values of $f$ are exactly $f(1)<\cdots n$, then $f(x)>x$ for all $x \geq n$. From this we conclude $f^{g(n)+1}(n)>f^{g(n)}(n)>\cdots>f(n)$. But we also have $f^{g(n)+1} (c-b)(c+b)>a^{2}$. + +Now we turn to the induction step. Let $n>1$ and put $t=\lfloor n / 2\rfloor \frac{n}{2} \cdot \frac{9 n}{2} \geq(n+1)^{2} \geq i^{2}$, + +so this triangle is obtuse. The proof is completed. + +## A6 + +Let $f$ be a function from the set of real numbers to itself that satisfies + +$$ +f(x+y) \leq y f(x)+f(f(x)) +$$ + +for all real numbers $x$ and $y$. Prove that $f(x)=0$ for all $x \leq 0$. + +Solution 1. Substituting $y=t-x$, we rewrite (II) as + +$$ +f(t) \leq t f(x)-x f(x)+f(f(x)) . +$$ + +Consider now some real numbers $a, b$ and use (2) with $t=f(a), x=b$ as well as with $t=f(b)$, $x=a$. We get + +$$ +\begin{aligned} +& f(f(a))-f(f(b)) \leq f(a) f(b)-b f(b), \\ +& f(f(b))-f(f(a)) \leq f(a) f(b)-a f(a) . +\end{aligned} +$$ + +Adding these two inequalities yields + +$$ +2 f(a) f(b) \geq a f(a)+b f(b) . +$$ + +Now, substitute $b=2 f(a)$ to obtain $2 f(a) f(b) \geq a f(a)+2 f(a) f(b)$, or $a f(a) \leq 0$. So, we get + +$$ +f(a) \geq 0 \text { for all } a<0 \text {. } +$$ + +Now suppose $f(x)>0$ for some real number $x$. From (21) we immediately get that for every $t<\frac{x f(x)-f(f(x))}{f(x)}$ we have $f(t)<0$. This contradicts (3); therefore + +$$ +f(x) \leq 0 \quad \text { for all real } x +$$ + +and by (3) again we get $f(x)=0$ for all $x<0$. + +We are left to find $f(0)$. Setting $t=x<0$ in (2) we get + +$$ +0 \leq 0-0+f(0), +$$ + +so $f(0) \geq 0$. Combining this with (4) we obtain $f(0)=0$. + +Solution 2. We will also use the condition of the problem in form (2)). For clarity we divide the argument into four steps. + +Step 1. We begin by proving that $f$ attains nonpositive values only. Assume that there exist some real number $z$ with $f(z)>0$. Substituting $x=z$ into (2) and setting $A=f(z)$, $B=-z f(z)-f(f(z))$ we get $f(t) \leq A t+B$ for all real $t$. Hence, if for any positive real number $t$ we substitute $x=-t, y=t$ into (11), we get + +$$ +\begin{aligned} +f(0) & \leq t f(-t)+f(f(-t)) \leq t(-A t+B)+A f(-t)+B \\ +& \leq-t(A t-B)+A(-A t+B)+B=-A t^{2}-\left(A^{2}-B\right) t+(A+1) B . +\end{aligned} +$$ + +But surely this cannot be true if we take $t$ to be large enough. This contradiction proves that we have indeed $f(x) \leq 0$ for all real numbers $x$. Note that for this reason (11) entails + +$$ +f(x+y) \leq y f(x) +$$ + +for all real numbers $x$ and $y$. + +Step 2. We proceed by proving that $f$ has at least one zero. If $f(0)=0$, we are done. Otherwise, in view of Step 1 we get $f(0)<0$. Observe that (5) tells us now $f(y) \leq y f(0)$ for all real numbers $y$. Thus we can specify a positive real number $a$ that is so large that $f(a)^{2}>-f(0)$. Put $b=f(a)$ and substitute $x=b$ and $y=-b$ into (5); we learn $-b^{2} 0 \\ 0 & \text { if } x \leq 0\end{cases} +$$ + +automatically satisfies (11). Indeed, we have $f(x) \leq 0$ and hence also $f(f(x))=0$ for all real numbers $x$. So (11) reduces to (5); moreover, this inequality is nontrivial only if $x$ and $y$ are positive. In this last case it is provided by (6). + +Now it is not hard to come up with a nonzero function $g$ obeying (6). E.g. $g(z)=C e^{z}$ (where $C$ is a positive constant) fits since the inequality $e^{y}>y$ holds for all (positive) real numbers $y$. One may also consider the function $g(z)=e^{z}-1$; in this case, we even have that $f$ is continuous. + +## A7 + +Let $a, b$, and $c$ be positive real numbers satisfying $\min (a+b, b+c, c+a)>\sqrt{2}$ and $a^{2}+b^{2}+c^{2}=3$. Prove that + +$$ +\frac{a}{(b+c-a)^{2}}+\frac{b}{(c+a-b)^{2}}+\frac{c}{(a+b-c)^{2}} \geq \frac{3}{(a b c)^{2}} +$$ + +Throughout both solutions, we denote the sums of the form $f(a, b, c)+f(b, c, a)+f(c, a, b)$ by $\sum f(a, b, c)$. + +Solution 1. The condition $b+c>\sqrt{2}$ implies $b^{2}+c^{2}>1$, so $a^{2}=3-\left(b^{2}+c^{2}\right)<2$, i.e. $a<\sqrt{2}0$, and also $c+a-b>0$ and $a+b-c>0$ for similar reasons. + +We will use the variant of HÖLDER's inequality + +$$ +\frac{x_{1}^{p+1}}{y_{1}^{p}}+\frac{x_{1}^{p+1}}{y_{1}^{p}}+\ldots+\frac{x_{n}^{p+1}}{y_{n}^{p}} \geq \frac{\left(x_{1}+x_{2}+\ldots+x_{n}\right)^{p+1}}{\left(y_{1}+y_{2}+\ldots+y_{n}\right)^{p}} +$$ + +which holds for all positive real numbers $p, x_{1}, x_{2}, \ldots, x_{n}, y_{1}, y_{2}, \ldots, y_{n}$. Applying it to the left-hand side of (11) with $p=2$ and $n=3$, we get + +$$ +\sum \frac{a}{(b+c-a)^{2}}=\sum \frac{\left(a^{2}\right)^{3}}{a^{5}(b+c-a)^{2}} \geq \frac{\left(a^{2}+b^{2}+c^{2}\right)^{3}}{\left(\sum a^{5 / 2}(b+c-a)\right)^{2}}=\frac{27}{\left(\sum a^{5 / 2}(b+c-a)\right)^{2}} . +$$ + +To estimate the denominator of the right-hand part, we use an instance of SCHUR's inequality, namely + +$$ +\sum a^{3 / 2}(a-b)(a-c) \geq 0 +$$ + +which can be rewritten as + +$$ +\sum a^{5 / 2}(b+c-a) \leq a b c(\sqrt{a}+\sqrt{b}+\sqrt{c}) . +$$ + +Moreover, by the inequality between the arithmetic mean and the fourth power mean we also have + +$$ +\left(\frac{\sqrt{a}+\sqrt{b}+\sqrt{c}}{3}\right)^{4} \leq \frac{a^{2}+b^{2}+c^{2}}{3}=1 +$$ + +i.e., $\sqrt{a}+\sqrt{b}+\sqrt{c} \leq 3$. Hence, (2) yields + +$$ +\sum \frac{a}{(b+c-a)^{2}} \geq \frac{27}{(a b c(\sqrt{a}+\sqrt{b}+\sqrt{c}))^{2}} \geq \frac{3}{a^{2} b^{2} c^{2}} +$$ + +thus solving the problem. + +Comment. In this solution, one may also start from the following version of HÖLDER's inequality + +$$ +\left(\sum_{i=1}^{n} a_{i}^{3}\right)\left(\sum_{i=1}^{n} b_{i}^{3}\right)\left(\sum_{i=1}^{n} c_{i}^{3}\right) \geq\left(\sum_{i=1}^{n} a_{i} b_{i} c_{i}\right)^{3} +$$ + +applied as + +$$ +\sum \frac{a}{(b+c-a)^{2}} \cdot \sum a^{3}(b+c-a) \cdot \sum a^{2}(b+c-a) \geq 27 +$$ + +After doing that, one only needs the slightly better known instances + +$$ +\sum a^{3}(b+c-a) \leq(a+b+c) a b c \quad \text { and } \quad \sum a^{2}(b+c-a) \leq 3 a b c +$$ + +of Schur's Inequality. + +Solution 2. As in Solution 1, we mention that all the numbers $b+c-a, a+c-b, a+b-c$ are positive. We will use only this restriction and the condition + +$$ +a^{5}+b^{5}+c^{5} \geq 3 +$$ + +which is weaker than the given one. Due to the symmetry we may assume that $a \geq b \geq c$. + +In view of (3)), it suffices to prove the inequality + +$$ +\sum \frac{a^{3} b^{2} c^{2}}{(b+c-a)^{2}} \geq \sum a^{5} +$$ + +or, moving all the terms into the left-hand part, + +$$ +\sum \frac{a^{3}}{(b+c-a)^{2}}\left((b c)^{2}-(a(b+c-a))^{2}\right) \geq 0 +$$ + +Note that the signs of the expressions $(y z)^{2}-(x(y+z-x))^{2}$ and $y z-x(y+z-x)=(x-y)(x-z)$ are the same for every positive $x, y, z$ satisfying the triangle inequality. So the terms in (4) corresponding to $a$ and $c$ are nonnegative, and hence it is sufficient to prove that the sum of the terms corresponding to $a$ and $b$ is nonnegative. Equivalently, we need the relation + +$$ +\frac{a^{3}}{(b+c-a)^{2}}(a-b)(a-c)(b c+a(b+c-a)) \geq \frac{b^{3}}{(a+c-b)^{2}}(a-b)(b-c)(a c+b(a+c-b)) +$$ + +Obviously, we have + +$$ +a^{3} \geq b^{3} \geq 0, \quad 0(a-b)^{2} +$$ + +which holds since $c>a-b \geq 0$ and $a+b>a-b \geq 0$. + +## C1 + +Let $n>0$ be an integer. We are given a balance and $n$ weights of weight $2^{0}, 2^{1}, \ldots, 2^{n-1}$. In a sequence of $n$ moves we place all weights on the balance. In the first move we choose a weight and put it on the left pan. In each of the following moves we choose one of the remaining weights and we add it either to the left or to the right pan. Compute the number of ways in which we can perform these $n$ moves in such a way that the right pan is never heavier than the left pan. + +Answer. The number $f(n)$ of ways of placing the $n$ weights is equal to the product of all odd positive integers less than or equal to $2 n-1$, i.e. $f(n)=(2 n-1) ! !=1 \cdot 3 \cdot 5 \cdot \ldots \cdot(2 n-1)$. + +Solution 1. Assume $n \geq 2$. We claim + +$$ +f(n)=(2 n-1) f(n-1) . +$$ + +Firstly, note that after the first move the left pan is always at least 1 heavier than the right one. Hence, any valid way of placing the $n$ weights on the scale gives rise, by not considering weight 1 , to a valid way of placing the weights $2,2^{2}, \ldots, 2^{n-1}$. + +If we divide the weight of each weight by 2 , the answer does not change. So these $n-1$ weights can be placed on the scale in $f(n-1)$ valid ways. Now we look at weight 1 . If it is put on the scale in the first move, then it has to be placed on the left side, otherwise it can be placed either on the left or on the right side, because after the first move the difference between the weights on the left pan and the weights on the right pan is at least 2 . Hence, there are exactly $2 n-1$ different ways of inserting weight 1 in each of the $f(n-1)$ valid sequences for the $n-1$ weights in order to get a valid sequence for the $n$ weights. This proves the claim. + +Since $f(1)=1$, by induction we obtain for all positive integers $n$ + +$$ +f(n)=(2 n-1) ! !=1 \cdot 3 \cdot 5 \cdot \ldots \cdot(2 n-1) +$$ + +Comment 1. The word "compute" in the statement of the problem is probably too vague. An alternative but more artificial question might ask for the smallest $n$ for which the number of valid ways is divisible by 2011. In this case the answer would be 1006 . + +Comment 2. It is useful to remark that the answer is the same for any set of weights where each weight is heavier than the sum of the lighter ones. Indeed, in such cases the given condition is equivalent to asking that during the process the heaviest weight on the balance is always on the left pan. + +Comment 3. Instead of considering the lightest weight, one may also consider the last weight put on the balance. If this weight is $2^{n-1}$ then it should be put on the left pan. Otherwise it may be put on +any pan; the inequality would not be violated since at this moment the heaviest weight is already put onto the left pan. In view of the previous comment, in each of these $2 n-1$ cases the number of ways to place the previous weights is exactly $f(n-1)$, which yields (1). + +Solution 2. We present a different way of obtaining (1). Set $f(0)=1$. Firstly, we find a recurrent formula for $f(n)$. + +Assume $n \geq 1$. Suppose that weight $2^{n-1}$ is placed on the balance in the $i$-th move with $1 \leq i \leq n$. This weight has to be put on the left pan. For the previous moves we have $\left(\begin{array}{c}n-1 \\ i-1\end{array}\right)$ choices of the weights and from Comment 2 there are $f(i-1)$ valid ways of placing them on the balance. For later moves there is no restriction on the way in which the weights are to be put on the pans. Therefore, all $(n-i) ! 2^{n-i}$ ways are possible. This gives + +$$ +f(n)=\sum_{i=1}^{n}\left(\begin{array}{c} +n-1 \\ +i-1 +\end{array}\right) f(i-1)(n-i) ! 2^{n-i}=\sum_{i=1}^{n} \frac{(n-1) ! f(i-1) 2^{n-i}}{(i-1) !} +$$ + +Now we are ready to prove (11). Using $n-1$ instead of $n$ in (2) we get + +$$ +f(n-1)=\sum_{i=1}^{n-1} \frac{(n-2) ! f(i-1) 2^{n-1-i}}{(i-1) !} . +$$ + +Hence, again from (2) we get + +$$ +\begin{aligned} +f(n)=2(n-1) \sum_{i=1}^{n-1} & \frac{(n-2) ! f(i-1) 2^{n-1-i}}{(i-1) !}+f(n-1) \\ +& =(2 n-2) f(n-1)+f(n-1)=(2 n-1) f(n-1), +\end{aligned} +$$ + +QED. + +Comment. There exist different ways of obtaining the formula (2). Here we show one of them. + +Suppose that in the first move we use weight $2^{n-i+1}$. Then the lighter $n-i$ weights may be put on the balance at any moment and on either pan. This gives $2^{n-i} \cdot(n-1) ! /(i-1)$ ! choices for the moves (moments and choices of pan) with the lighter weights. The remaining $i-1$ moves give a valid sequence for the $i-1$ heavier weights and this is the only requirement for these moves, so there are $f(i-1)$ such sequences. Summing over all $i=1,2, \ldots, n$ we again come to (2). + +## C2 + +Suppose that 1000 students are standing in a circle. Prove that there exists an integer $k$ with $100 \leq k \leq 300$ such that in this circle there exists a contiguous group of $2 k$ students, for which the first half contains the same number of girls as the second half. + +Solution. Number the students consecutively from 1 to 1000. Let $a_{i}=1$ if the $i$ th student is a girl, and $a_{i}=0$ otherwise. We expand this notion for all integers $i$ by setting $a_{i+1000}=$ $a_{i-1000}=a_{i}$. Next, let + +$$ +S_{k}(i)=a_{i}+a_{i+1}+\cdots+a_{i+k-1} +$$ + +Now the statement of the problem can be reformulated as follows: + +There exist an integer $k$ with $100 \leq k \leq 300$ and an index $i$ such that $S_{k}(i)=S_{k}(i+k)$. + +Assume now that this statement is false. Choose an index $i$ such that $S_{100}(i)$ attains the maximal possible value. In particular, we have $S_{100}(i-100)-S_{100}(i)<0$ and $S_{100}(i)-S_{100}(i+100)>0$, for if we had an equality, then the statement would hold. This means that the function $S(j)-$ $S(j+100)$ changes sign somewhere on the segment $[i-100, i]$, so there exists some index $j \in$ $[i-100, i-1]$ such that + +$$ +S_{100}(j) \leq S_{100}(j+100)-1, \quad \text { but } \quad S_{100}(j+1) \geq S_{100}(j+101)+1 +$$ + +Subtracting the first inequality from the second one, we get $a_{j+100}-a_{j} \geq a_{j+200}-a_{j+100}+2$, so + +$$ +a_{j}=0, \quad a_{j+100}=1, \quad a_{j+200}=0 +$$ + +Substituting this into the inequalities of (1), we also obtain $S_{99}(j+1) \leq S_{99}(j+101) \leq S_{99}(j+1)$, which implies + +$$ +S_{99}(j+1)=S_{99}(j+101) . +$$ + +Now let $k$ and $\ell$ be the least positive integers such that $a_{j-k}=1$ and $a_{j+200+\ell}=1$. By symmetry, we may assume that $k \geq \ell$. If $k \geq 200$ then we have $a_{j}=a_{j-1}=\cdots=a_{j-199}=0$, so $S_{100}(j-199)=S_{100}(j-99)=0$, which contradicts the initial assumption. Hence $\ell \leq k \leq 199$. + +Finally, we have + +$$ +\begin{gathered} +S_{100+\ell}(j-\ell+1)=\left(a_{j-\ell+1}+\cdots+a_{j}\right)+S_{99}(j+1)+a_{j+100}=S_{99}(j+1)+1, \\ +S_{100+\ell}(j+101)=S_{99}(j+101)+\left(a_{j+200}+\cdots+a_{j+200+\ell-1}\right)+a_{j+200+\ell}=S_{99}(j+101)+1 . +\end{gathered} +$$ + +Comparing with (2) we get $S_{100+\ell}(j-\ell+1)=S_{100+\ell}(j+101)$ and $100+\ell \leq 299$, which again contradicts our assumption. + +Comment. It may be seen from the solution that the number 300 from the problem statement can be +replaced by 299. Here we consider some improvements of this result. Namely, we investigate which interval can be put instead of $[100,300]$ in order to keep the problem statement valid. + +First of all, the two examples + + + +and + +$$ +\underbrace{1,1, \ldots, 1}_{249}, \underbrace{0,0, \ldots, 0}_{251}, \underbrace{1,1, \ldots, 1}_{249}, \underbrace{0,0, \ldots, 0}_{251} +$$ + +show that the interval can be changed neither to $[84,248]$ nor to $[126,374]$. + +On the other hand, we claim that this interval can be changed to $[125,250]$. Note that this statement is invariant under replacing all 1's by 0's and vice versa. Assume, to the contrary, that there is no admissible $k \in[125,250]$. The arguments from the solution easily yield the following lemma. + +Lemma. Under our assumption, suppose that for some indices $i \left(i_{3}^{\prime}-i_{1}\right)+\left(i_{6}^{\prime}-i_{4}\right) \geq 500+500$. This final contradiction shows that our claim holds. + +One may even show that the interval in the statement of the problem may be replaced by $[125,249]$ (both these numbers cannot be improved due to the examples above). But a proof of this fact is a bit messy, and we do not present it here. + +## C3 + +Let $\mathcal{S}$ be a finite set of at least two points in the plane. Assume that no three points of $\mathcal{S}$ are collinear. By a windmill we mean a process as follows. Start with a line $\ell$ going through a point $P \in \mathcal{S}$. Rotate $\ell$ clockwise around the pivot $P$ until the line contains another point $Q$ of $\mathcal{S}$. The point $Q$ now takes over as the new pivot. This process continues indefinitely, with the pivot always being a point from $\mathcal{S}$. + +Show that for a suitable $P \in \mathcal{S}$ and a suitable starting line $\ell$ containing $P$, the resulting windmill will visit each point of $\mathcal{S}$ as a pivot infinitely often. + +Solution. Give the rotating line an orientation and distinguish its sides as the oranje side and the blue side. Notice that whenever the pivot changes from some point $T$ to another point $U$, after the change, $T$ is on the same side as $U$ was before. Therefore, the number of elements of $\mathcal{S}$ on the oranje side and the number of those on the blue side remain the same throughout the whole process (except for those moments when the line contains two points). + + +First consider the case that $|\mathcal{S}|=2 n+1$ is odd. We claim that through any point $T \in \mathcal{S}$, there is a line that has $n$ points on each side. To see this, choose an oriented line through $T$ containing no other point of $\mathcal{S}$ and suppose that it has $n+r$ points on its oranje side. If $r=0$ then we have established the claim, so we may assume that $r \neq 0$. As the line rotates through $180^{\circ}$ around $T$, the number of points of $\mathcal{S}$ on its oranje side changes by 1 whenever the line passes through a point; after $180^{\circ}$, the number of points on the oranje side is $n-r$. Therefore there is an intermediate stage at which the oranje side, and thus also the blue side, contains $n$ points. + +Now select the point $P$ arbitrarily, and choose a line through $P$ that has $n$ points of $\mathcal{S}$ on each side to be the initial state of the windmill. We will show that during a rotation over $180^{\circ}$, the line of the windmill visits each point of $\mathcal{S}$ as a pivot. To see this, select any point $T$ of $\mathcal{S}$ and select a line $\ell$ through $T$ that separates $\mathcal{S}$ into equal halves. The point $T$ is the unique point of $\mathcal{S}$ through which a line in this direction can separate the points of $\mathcal{S}$ into equal halves (parallel translation would disturb the balance). Therefore, when the windmill line is parallel to $\ell$, it must be $\ell$ itself, and so pass through $T$. + +Next suppose that $|\mathcal{S}|=2 n$. Similarly to the odd case, for every $T \in \mathcal{S}$ there is an oriented +line through $T$ with $n-1$ points on its oranje side and $n$ points on its blue side. Select such an oriented line through an arbitrary $P$ to be the initial state of the windmill. + +We will now show that during a rotation over $360^{\circ}$, the line of the windmill visits each point of $\mathcal{S}$ as a pivot. To see this, select any point $T$ of $\mathcal{S}$ and an oriented line $\ell$ through $T$ that separates $\mathcal{S}$ into two subsets with $n-1$ points on its oranje and $n$ points on its blue side. Again, parallel translation would change the numbers of points on the two sides, so when the windmill line is parallel to $\ell$ with the same orientation, the windmill line must pass through $T$. + +Comment. One may shorten this solution in the following way. + +Suppose that $|\mathcal{S}|=2 n+1$. Consider any line $\ell$ that separates $\mathcal{S}$ into equal halves; this line is unique given its direction and contains some point $T \in \mathcal{S}$. Consider the windmill starting from this line. When the line has made a rotation of $180^{\circ}$, it returns to the same location but the oranje side becomes blue and vice versa. So, for each point there should have been a moment when it appeared as pivot, as this is the only way for a point to pass from on side to the other. + +Now suppose that $|\mathcal{S}|=2 n$. Consider a line having $n-1$ and $n$ points on the two sides; it contains some point $T$. Consider the windmill starting from this line. After having made a rotation of $180^{\circ}$, the windmill line contains some different point $R$, and each point different from $T$ and $R$ has changed the color of its side. So, the windmill should have passed through all the points. + +## $\mathrm{C} 4$ + +Determine the greatest positive integer $k$ that satisfies the following property: The set of positive integers can be partitioned into $k$ subsets $A_{1}, A_{2}, \ldots, A_{k}$ such that for all integers $n \geq 15$ and all $i \in\{1,2, \ldots, k\}$ there exist two distinct elements of $A_{i}$ whose sum is $n$. + +Answer. The greatest such number $k$ is 3 . + +Solution 1. There are various examples showing that $k=3$ does indeed have the property under consideration. E.g. one can take + +$$ +\begin{gathered} +A_{1}=\{1,2,3\} \cup\{3 m \mid m \geq 4\}, \\ +A_{2}=\{4,5,6\} \cup\{3 m-1 \mid m \geq 4\}, \\ +A_{3}=\{7,8,9\} \cup\{3 m-2 \mid m \geq 4\} +\end{gathered} +$$ + +To check that this partition fits, we notice first that the sums of two distinct elements of $A_{i}$ obviously represent all numbers $n \geq 1+12=13$ for $i=1$, all numbers $n \geq 4+11=15$ for $i=2$, and all numbers $n \geq 7+10=17$ for $i=3$. So, we are left to find representations of the numbers 15 and 16 as sums of two distinct elements of $A_{3}$. These are $15=7+8$ and $16=7+9$. + +Let us now suppose that for some $k \geq 4$ there exist sets $A_{1}, A_{2}, \ldots, A_{k}$ satisfying the given property. Obviously, the sets $A_{1}, A_{2}, A_{3}, A_{4} \cup \cdots \cup A_{k}$ also satisfy the same property, so one may assume $k=4$. + +Put $B_{i}=A_{i} \cap\{1,2, \ldots, 23\}$ for $i=1,2,3,4$. Now for any index $i$ each of the ten numbers $15,16, \ldots, 24$ can be written as sum of two distinct elements of $B_{i}$. Therefore this set needs to contain at least five elements. As we also have $\left|B_{1}\right|+\left|B_{2}\right|+\left|B_{3}\right|+\left|B_{4}\right|=23$, there has to be some index $j$ for which $\left|B_{j}\right|=5$. Let $B_{j}=\left\{x_{1}, x_{2}, x_{3}, x_{4}, x_{5}\right\}$. Finally, now the sums of two distinct elements of $A_{j}$ representing the numbers $15,16, \ldots, 24$ should be exactly all the pairwise sums of the elements of $B_{j}$. Calculating the sum of these numbers in two different ways, we reach + +$$ +4\left(x_{1}+x_{2}+x_{3}+x_{4}+x_{5}\right)=15+16+\ldots+24=195 . +$$ + +Thus the number 195 should be divisible by 4 , which is false. This contradiction completes our solution. + +Comment. There are several variation of the proof that $k$ should not exceed 3. E.g., one may consider the sets $C_{i}=A_{i} \cap\{1,2, \ldots, 19\}$ for $i=1,2,3,4$. As in the previous solution one can show that for some index $j$ one has $\left|C_{j}\right|=4$, and the six pairwise sums of the elements of $C_{j}$ should represent all numbers $15,16, \ldots, 20$. Let $C_{j}=\left\{y_{1}, y_{2}, y_{3}, y_{4}\right\}$ with $y_{1} 1$. In the sequel, the word collision will be used to denote meeting of exactly two ants, moving in opposite directions. + +If at the beginning we place an ant on the southwest corner square facing east and an ant on the southeast corner square facing west, then they will meet in the middle of the bottom row at time $\frac{m-1}{2}$. After the collision, the ant that moves to the north will stay on the board for another $m-\frac{1}{2}$ time units and thus we have established an example in which the last ant falls off at time $\frac{m-1}{2}+m-\frac{1}{2}=\frac{3 m}{2}-1$. So, we are left to prove that this is the latest possible moment. + +Consider any collision of two ants $a$ and $a^{\prime}$. Let us change the rule for this collision, and enforce these two ants to turn anticlockwise. Then the succeeding behavior of all the ants does not change; the only difference is that $a$ and $a^{\prime}$ swap their positions. These arguments may be applied to any collision separately, so we may assume that at any collision, either both ants rotate clockwise or both of them rotate anticlockwise by our own choice. + +For instance, we may assume that there are only two types of ants, depending on their initial direction: $N E$-ants, which move only north or east, and $S W$-ants, moving only south and west. Then we immediately obtain that all ants will have fallen off the board after $2 m-1$ time units. However, we can get a better bound by considering the last moment at which a given ant collides with another ant. + +Choose a coordinate system such that the corners of the checkerboard are $(0,0),(m, 0),(m, m)$ and $(0, m)$. At time $t$, there will be no NE-ants in the region $\{(x, y): x+y 2 m-t-1\}$. So if two ants collide at $(x, y)$ at time $t$, we have + +$$ +t+1 \leq x+y \leq 2 m-t-1 +$$ + +Analogously, we may change the rules so that each ant would move either alternatingly north and west, or alternatingly south and east. By doing so, we find that apart from (1) we also have $|x-y| \leq m-t-1$ for each collision at point $(x, y)$ and time $t$. + +To visualize this, put + +$$ +B(t)=\left\{(x, y) \in[0, m]^{2}: t+1 \leq x+y \leq 2 m-t-1 \text { and }|x-y| \leq m-t-1\right\} . +$$ + +An ant can thus only collide with another ant at time $t$ if it happens to be in the region $B(t)$. The following figure displays $B(t)$ for $t=\frac{1}{2}$ and $t=\frac{7}{2}$ in the case $m=6$ : + + + +Now suppose that an NE-ant has its last collision at time $t$ and that it does so at the point $(x, y)$ (if the ant does not collide at all, it will fall off the board within $m-\frac{1}{2}<\frac{3 m}{2}-1$ time units, so this case can be ignored). Then we have $(x, y) \in B(t)$ and thus $x+y \geq t+1$ and $x-y \geq-(m-t-1)$. So we get + +$$ +x \geq \frac{(t+1)-(m-t-1)}{2}=t+1-\frac{m}{2} +$$ + +By symmetry we also have $y \geq t+1-\frac{m}{2}$, and hence $\min \{x, y\} \geq t+1-\frac{m}{2}$. After this collision, the ant will move directly to an edge, which will take at $\operatorname{most} m-\min \{x, y\}$ units of time. In sum, the total amount of time the ant stays on the board is at most + +$$ +t+(m-\min \{x, y\}) \leq t+m-\left(t+1-\frac{m}{2}\right)=\frac{3 m}{2}-1 +$$ + +By symmetry, the same bound holds for $\mathrm{SW}$-ants as well. + +## C6 + +Let $n$ be a positive integer and let $W=\ldots x_{-1} x_{0} x_{1} x_{2} \ldots$ be an infinite periodic word consisting of the letters $a$ and $b$. Suppose that the minimal period $N$ of $W$ is greater than $2^{n}$. + +A finite nonempty word $U$ is said to appear in $W$ if there exist indices $k \leq \ell$ such that $U=x_{k} x_{k+1} \ldots x_{\ell}$. A finite word $U$ is called ubiquitous if the four words $U a, U b, a U$, and $b U$ all appear in $W$. Prove that there are at least $n$ ubiquitous finite nonempty words. + +Solution. Throughout the solution, all the words are nonempty. For any word $R$ of length $m$, we call the number of indices $i \in\{1,2, \ldots, N\}$ for which $R$ coincides with the subword $x_{i+1} x_{i+2} \ldots x_{i+m}$ of $W$ the multiplicity of $R$ and denote it by $\mu(R)$. Thus a word $R$ appears in $W$ if and only if $\mu(R)>0$. Since each occurrence of a word in $W$ is both succeeded by either the letter $a$ or the letter $b$ and similarly preceded by one of those two letters, we have + +$$ +\mu(R)=\mu(R a)+\mu(R b)=\mu(a R)+\mu(b R) +$$ + +for all words $R$. + +We claim that the condition that $N$ is in fact the minimal period of $W$ guarantees that each word of length $N$ has multiplicity 1 or 0 depending on whether it appears or not. Indeed, if the words $x_{i+1} x_{i+2} \ldots x_{i+N}$ and $x_{j+1} \ldots x_{j+N}$ are equal for some $1 \leq i 2^{n}$, at least one of the two words $a$ and $b$ has a multiplicity that is strictly larger than $2^{n-1}$. + +For each $k=0,1, \ldots, n-1$, let $U_{k}$ be a subword of $W$ whose multiplicity is strictly larger than $2^{k}$ and whose length is maximal subject to this property. Note that such a word exists in view of the two observations made in the two previous paragraphs. + +Fix some index $k \in\{0,1, \ldots, n-1\}$. Since the word $U_{k} b$ is longer than $U_{k}$, its multiplicity can be at most $2^{k}$, so in particular $\mu\left(U_{k} b\right)<\mu\left(U_{k}\right)$. Therefore, the word $U_{k} a$ has to appear by (11). For a similar reason, the words $U_{k} b, a U_{k}$, and $b U_{k}$ have to appear as well. Hence, the word $U_{k}$ is ubiquitous. Moreover, if the multiplicity of $U_{k}$ were strictly greater than $2^{k+1}$, then by (1) at least one of the two words $U_{k} a$ and $U_{k} b$ would have multiplicity greater than $2^{k}$ and would thus violate the maximality condition imposed on $U_{k}$. + +So we have $\mu\left(U_{0}\right) \leq 2<\mu\left(U_{1}\right) \leq 4<\ldots \leq 2^{n-1}<\mu\left(U_{n-1}\right)$, which implies in particular that the words $U_{0}, U_{1}, \ldots, U_{n-1}$ have to be distinct. As they have been proved to be ubiquitous as well, the problem is solved. + +Comment 1. There is an easy construction for obtaining ubiquitous words from appearing words whose multiplicity is at least two. Starting with any such word $U$ we may simply extend one of its occurrences in $W$ forwards and backwards as long as its multiplicity remains fixed, thus arriving at a +word that one might call the ubiquitous prolongation $p(U)$ of $U$. + +There are several variants of the argument in the second half of the solution using the concept of prolongation. For instance, one may just take all ubiquitous words $U_{1}, U_{2}, \ldots, U_{\ell}$ ordered by increasing multiplicity and then prove for $i \in\{1,2, \ldots, \ell\}$ that $\mu\left(U_{i}\right) \leq 2^{i}$. Indeed, assume that $i$ is a minimal counterexample to this statement; then by the arguments similar to those presented above, the ubiquitous prolongation of one of the words $U_{i} a, U_{i} b, a U_{i}$ or $b U_{i}$ violates the definition of $U_{i}$. + +Now the multiplicity of one of the two letters $a$ and $b$ is strictly greater than $2^{n-1}$, so passing to ubiquitous prolongations once more we obtain $2^{n-1}<\mu\left(U_{\ell}\right) \leq 2^{\ell}$, which entails $\ell \geq n$, as needed. + +Comment 2. The bound $n$ for the number of ubiquitous subwords in the problem statement is not optimal, but it is close to an optimal one in the following sense. There is a universal constant $C>0$ such that for each positive integer $n$ there exists an infinite periodic word $W$ whose minimal period is greater than $2^{n}$ but for which there exist fewer than $C n$ ubiquitous words. + +## C7 + +On a square table of 2011 by 2011 cells we place a finite number of napkins that each cover a square of 52 by 52 cells. In each cell we write the number of napkins covering it, and we record the maximal number $k$ of cells that all contain the same nonzero number. Considering all possible napkin configurations, what is the largest value of $k$ ? + +Answer. $2011^{2}-\left(\left(52^{2}-35^{2}\right) \cdot 39-17^{2}\right)=4044121-57392=3986729$. + +Solution 1. Let $m=39$, then $2011=52 m-17$. We begin with an example showing that there can exist 3986729 cells carrying the same positive number. + + + +To describe it, we number the columns from the left to the right and the rows from the bottom to the top by $1,2, \ldots, 2011$. We will denote each napkin by the coordinates of its lowerleft cell. There are four kinds of napkins: first, we take all napkins $(52 i+36,52 j+1)$ with $0 \leq j \leq i \leq m-2$; second, we use all napkins $(52 i+1,52 j+36)$ with $0 \leq i \leq j \leq m-2$; third, we use all napkins $(52 i+36,52 i+36)$ with $0 \leq i \leq m-2$; and finally the napkin $(1,1)$. Different groups of napkins are shown by different types of hatchings in the picture. + +Now except for those squares that carry two or more different hatchings, all squares have the number 1 written into them. The number of these exceptional cells is easily computed to be $\left(52^{2}-35^{2}\right) m-17^{2}=57392$. + +We are left to prove that 3986729 is an upper bound for the number of cells containing the same number. Consider any configuration of napkins and any positive integer $M$. Suppose there are $g$ cells with a number different from $M$. Then it suffices to show $g \geq 57392$. Throughout the solution, a line will mean either a row or a column. + +Consider any line $\ell$. Let $a_{1}, \ldots, a_{52 m-17}$ be the numbers written into its consecutive cells. For $i=1,2, \ldots, 52$, let $s_{i}=\sum_{t \equiv i(\bmod 52)} a_{t}$. Note that $s_{1}, \ldots, s_{35}$ have $m$ terms each, while $s_{36}, \ldots, s_{52}$ have $m-1$ terms each. Every napkin intersecting $\ell$ contributes exactly 1 to each $s_{i}$; +hence the number $s$ of all those napkins satisfies $s_{1}=\cdots=s_{52}=s$. Call the line $\ell$ rich if $s>(m-1) M$ and poor otherwise. + +Suppose now that $\ell$ is rich. Then in each of the sums $s_{36}, \ldots, s_{52}$ there exists a term greater than $M$; consider all these terms and call the corresponding cells the rich bad cells for this line. So, each rich line contains at least 17 cells that are bad for this line. + +If, on the other hand, $\ell$ is poor, then certainly $s 2 H^{2}$, then the answer and the example are the same as in the previous case; otherwise the answer is $(2 m-1) S^{2}+2 S H(m-1)$, and the example is provided simply by $(m-1)^{2}$ nonintersecting napkins. + +Now we sketch the proof of both estimates for Case 2. We introduce a more appropriate notation based on that from Solution 2. Denote by $a_{-}$and $a_{+}$the number of cells of class $A$ that contain the number which is strictly less than $M$ and strictly greater than $M$, respectively. The numbers $b_{ \pm}, c_{ \pm}$, and $d_{ \pm}$are defined in a similar way. One may notice that the proofs of Claim 1 and Claims 2, 3 lead in fact to the inequalities + +$$ +m-1 \leq \frac{b_{-}+c_{-}}{2 S H}+\frac{d_{+}}{H^{2}} \quad \text { and } \quad 2 m-1 \leq \frac{a}{S^{2}}+\frac{b_{+}+c_{+}}{2 S H}+\frac{d_{+}}{H^{2}} +$$ + +(to obtain the first one, one needs to look at the big lines instead of the small ones). Combining these inequalities, one may obtain the desired estimates. + +These estimates can also be proved in some different ways, e.g. without distinguishing rich and poor cells. + +## G1 + +Let $A B C$ be an acute triangle. Let $\omega$ be a circle whose center $L$ lies on the side $B C$. Suppose that $\omega$ is tangent to $A B$ at $B^{\prime}$ and to $A C$ at $C^{\prime}$. Suppose also that the circumcenter $O$ of the triangle $A B C$ lies on the shorter arc $B^{\prime} C^{\prime}$ of $\omega$. Prove that the circumcircle of $A B C$ and $\omega$ meet at two points. + +Solution. The point $B^{\prime}$, being the perpendicular foot of $L$, is an interior point of side $A B$. Analogously, $C^{\prime}$ lies in the interior of $A C$. The point $O$ is located inside the triangle $A B^{\prime} C^{\prime}$, hence $\angle C O B<\angle C^{\prime} O B^{\prime}$. + + + +Let $\alpha=\angle C A B$. The angles $\angle C A B$ and $\angle C^{\prime} O B^{\prime}$ are inscribed into the two circles with centers $O$ and $L$, respectively, so $\angle C O B=2 \angle C A B=2 \alpha$ and $2 \angle C^{\prime} O B^{\prime}=360^{\circ}-\angle C^{\prime} L B^{\prime}$. From the kite $A B^{\prime} L C^{\prime}$ we have $\angle C^{\prime} L B^{\prime}=180^{\circ}-\angle C^{\prime} A B^{\prime}=180^{\circ}-\alpha$. Combining these, we get + +$$ +2 \alpha=\angle C O B<\angle C^{\prime} O B^{\prime}=\frac{360^{\circ}-\angle C^{\prime} L B^{\prime}}{2}=\frac{360^{\circ}-\left(180^{\circ}-\alpha\right)}{2}=90^{\circ}+\frac{\alpha}{2}, +$$ + +So + +$$ +\alpha<60^{\circ} \text {. } +$$ + +Let $O^{\prime}$ be the reflection of $O$ in the line $B C$. In the quadrilateral $A B O^{\prime} C$ we have + +$$ +\angle C O^{\prime} B+\angle C A B=\angle C O B+\angle C A B=2 \alpha+\alpha<180^{\circ}, +$$ + +so the point $O^{\prime}$ is outside the circle $A B C$. Hence, $O$ and $O^{\prime}$ are two points of $\omega$ such that one of them lies inside the circumcircle, while the other one is located outside. Therefore, the two circles intersect. + +Comment. There are different ways of reducing the statement of the problem to the case $\alpha<60^{\circ}$. E.g., since the point $O$ lies in the interior of the isosceles triangle $A B^{\prime} C^{\prime}$, we have $O A2 L B^{\prime}$, and this condition implies $\angle C A B=2 \angle B^{\prime} A L<2 \cdot 30^{\circ}=60^{\circ}$. + +## G2 + +Let $A_{1} A_{2} A_{3} A_{4}$ be a non-cyclic quadrilateral. Let $O_{1}$ and $r_{1}$ be the circumcenter and the circumradius of the triangle $A_{2} A_{3} A_{4}$. Define $O_{2}, O_{3}, O_{4}$ and $r_{2}, r_{3}, r_{4}$ in a similar way. Prove that + +$$ +\frac{1}{O_{1} A_{1}^{2}-r_{1}^{2}}+\frac{1}{O_{2} A_{2}^{2}-r_{2}^{2}}+\frac{1}{O_{3} A_{3}^{2}-r_{3}^{2}}+\frac{1}{O_{4} A_{4}^{2}-r_{4}^{2}}=0 +$$ + +Solution 1. Let $M$ be the point of intersection of the diagonals $A_{1} A_{3}$ and $A_{2} A_{4}$. On each diagonal choose a direction and let $x, y, z$, and $w$ be the signed distances from $M$ to the points $A_{1}, A_{2}, A_{3}$, and $A_{4}$, respectively. + +Let $\omega_{1}$ be the circumcircle of the triangle $A_{2} A_{3} A_{4}$ and let $B_{1}$ be the second intersection point of $\omega_{1}$ and $A_{1} A_{3}$ (thus, $B_{1}=A_{3}$ if and only if $A_{1} A_{3}$ is tangent to $\omega_{1}$ ). Since the expression $O_{1} A_{1}^{2}-r_{1}^{2}$ is the power of the point $A_{1}$ with respect to $\omega_{1}$, we get + +$$ +O_{1} A_{1}^{2}-r_{1}^{2}=A_{1} B_{1} \cdot A_{1} A_{3} +$$ + +On the other hand, from the equality $M B_{1} \cdot M A_{3}=M A_{2} \cdot M A_{4}$ we obtain $M B_{1}=y w / z$. Hence, we have + +$$ +O_{1} A_{1}^{2}-r_{1}^{2}=\left(\frac{y w}{z}-x\right)(z-x)=\frac{z-x}{z}(y w-x z) . +$$ + +Substituting the analogous expressions into the sought sum we get + +$$ +\sum_{i=1}^{4} \frac{1}{O_{i} A_{i}^{2}-r_{i}^{2}}=\frac{1}{y w-x z}\left(\frac{z}{z-x}-\frac{w}{w-y}+\frac{x}{x-z}-\frac{y}{y-w}\right)=0 +$$ + +as desired. + +Comment. One might reformulate the problem by assuming that the quadrilateral $A_{1} A_{2} A_{3} A_{4}$ is convex. This should not really change the difficulty, but proofs that distinguish several cases may become shorter. + +Solution 2. Introduce a Cartesian coordinate system in the plane. Every circle has an equation of the form $p(x, y)=x^{2}+y^{2}+l(x, y)=0$, where $l(x, y)$ is a polynomial of degree at most 1 . For any point $A=\left(x_{A}, y_{A}\right)$ we have $p\left(x_{A}, y_{A}\right)=d^{2}-r^{2}$, where $d$ is the distance from $A$ to the center of the circle and $r$ is the radius of the circle. + +For each $i$ in $\{1,2,3,4\}$ let $p_{i}(x, y)=x^{2}+y^{2}+l_{i}(x, y)=0$ be the equation of the circle with center $O_{i}$ and radius $r_{i}$ and let $d_{i}$ be the distance from $A_{i}$ to $O_{i}$. Consider the equation + +$$ +\sum_{i=1}^{4} \frac{p_{i}(x, y)}{d_{i}^{2}-r_{i}^{2}}=1 +$$ + +Since the coordinates of the points $A_{1}, A_{2}, A_{3}$, and $A_{4}$ satisfy (1) but these four points do not lie on a circle or on an line, equation (1) defines neither a circle, nor a line. Hence, the equation is an identity and the coefficient of the quadratic term $x^{2}+y^{2}$ also has to be zero, i.e. + +$$ +\sum_{i=1}^{4} \frac{1}{d_{i}^{2}-r_{i}^{2}}=0 +$$ + +Comment. Using the determinant form of the equation of the circle through three given points, the same solution can be formulated as follows. + +For $i=1,2,3,4$ let $\left(u_{i}, v_{i}\right)$ be the coordinates of $A_{i}$ and define + +$$ +\Delta=\left|\begin{array}{llll} +u_{1}^{2}+v_{1}^{2} & u_{1} & v_{1} & 1 \\ +u_{2}^{2}+v_{2}^{2} & u_{2} & v_{2} & 1 \\ +u_{3}^{2}+v_{3}^{2} & u_{3} & v_{3} & 1 \\ +u_{4}^{2}+v_{4}^{2} & u_{4} & v_{4} & 1 +\end{array}\right| \quad \text { and } \quad \Delta_{i}=\left|\begin{array}{lll} +u_{i+1} & v_{i+1} & 1 \\ +u_{i+2} & v_{i+2} & 1 \\ +u_{i+3} & v_{i+3} & 1 +\end{array}\right| +$$ + +where $i+1, i+2$, and $i+3$ have to be read modulo 4 as integers in the set $\{1,2,3,4\}$. + +Expanding $\left|\begin{array}{llll}u_{1} & v_{1} & 1 & 1 \\ u_{2} & v_{2} & 1 & 1 \\ u_{3} & v_{3} & 1 & 1 \\ u_{4} & v_{4} & 1 & 1\end{array}\right|=0$ along the third column, we get $\Delta_{1}-\Delta_{2}+\Delta_{3}-\Delta_{4}=0$. + +The circle through $A_{i+1}, A_{i+2}$, and $A_{i+3}$ is given by the equation + +$$ +\frac{1}{\Delta_{i}}\left|\begin{array}{cccc} +x^{2}+y^{2} & x & y & 1 \\ +u_{i+1}^{2}+v_{i+1}^{2} & u_{i+1} & v_{i+1} & 1 \\ +u_{i+2}^{2}+v_{i+2}^{2} & u_{i+2} & v_{i+2} & 1 \\ +u_{i+3}^{2}+v_{i+3}^{2} & u_{i+3} & v_{i+3} & 1 +\end{array}\right|=0 +$$ + +On the left-hand side, the coefficient of $x^{2}+y^{2}$ is equal to 1 . Substituting $\left(u_{i}, v_{i}\right)$ for $(x, y)$ in (2) we obtain the power of point $A_{i}$ with respect to the circle through $A_{i+1}, A_{i+2}$, and $A_{i+3}$ : + +$$ +d_{i}^{2}-r_{i}^{2}=\frac{1}{\Delta_{i}}\left|\begin{array}{cccc} +u_{i}^{2}+v_{i}^{2} & u_{i} & v_{i} & 1 \\ +u_{i+1}^{2}+v_{i+1}^{2} & u_{i+1} & v_{i+1} & 1 \\ +u_{i+2}^{2}+v_{i+2}^{2} & u_{i+2} & v_{i+2} & 1 \\ +u_{i+3}^{2}+v_{i+3}^{2} & u_{i+3} & v_{i+3} & 1 +\end{array}\right|=(-1)^{i+1} \frac{\Delta}{\Delta_{i}} +$$ + +Thus, we have + +$$ +\sum_{i=1}^{4} \frac{1}{d_{i}^{2}-r_{i}^{2}}=\frac{\Delta_{1}-\Delta_{2}+\Delta_{3}-\Delta_{4}}{\Delta}=0 +$$ + +## G3 + +Let $A B C D$ be a convex quadrilateral whose sides $A D$ and $B C$ are not parallel. Suppose that the circles with diameters $A B$ and $C D$ meet at points $E$ and $F$ inside the quadrilateral. Let $\omega_{E}$ be the circle through the feet of the perpendiculars from $E$ to the lines $A B, B C$, and $C D$. Let $\omega_{F}$ be the circle through the feet of the perpendiculars from $F$ to the lines $C D, D A$, and $A B$. Prove that the midpoint of the segment $E F$ lies on the line through the two intersection points of $\omega_{E}$ and $\omega_{F}$. + +Solution. Denote by $P, Q, R$, and $S$ the projections of $E$ on the lines $D A, A B, B C$, and $C D$ respectively. The points $P$ and $Q$ lie on the circle with diameter $A E$, so $\angle Q P E=\angle Q A E$; analogously, $\angle Q R E=\angle Q B E$. So $\angle Q P E+\angle Q R E=\angle Q A E+\angle Q B E=90^{\circ}$. By similar reasons, we have $\angle S P E+\angle S R E=90^{\circ}$, hence we get $\angle Q P S+\angle Q R S=90^{\circ}+90^{\circ}=180^{\circ}$, and the quadrilateral $P Q R S$ is inscribed in $\omega_{E}$. Analogously, all four projections of $F$ onto the sides of $A B C D$ lie on $\omega_{F}$. + +Denote by $K$ the meeting point of the lines $A D$ and $B C$. Due to the arguments above, there is no loss of generality in assuming that $A$ lies on segment $D K$. Suppose that $\angle C K D \geq 90^{\circ}$; then the circle with diameter $C D$ covers the whole quadrilateral $A B C D$, so the points $E, F$ cannot lie inside this quadrilateral. Hence our assumption is wrong. Therefore, the lines EP and $B C$ intersect at some point $P^{\prime}$, while the lines $E R$ and $A D$ intersect at some point $R^{\prime}$. + + + +Figure 1 + +We claim that the points $P^{\prime}$ and $R^{\prime}$ also belong to $\omega_{E}$. Since the points $R, E, Q, B$ are concyclic, $\angle Q R K=\angle Q E B=90^{\circ}-\angle Q B E=\angle Q A E=\angle Q P E$. So $\angle Q R K=\angle Q P P^{\prime}$, which means that the point $P^{\prime}$ lies on $\omega_{E}$. Analogously, $R^{\prime}$ also lies on $\omega_{E}$. + +In the same manner, denote by $M$ and $N$ the projections of $F$ on the lines $A D$ and $B C$ +respectively, and let $M^{\prime}=F M \cap B C, N^{\prime}=F N \cap A D$. By the same arguments, we obtain that the points $M^{\prime}$ and $N^{\prime}$ belong to $\omega_{F}$. + + + +Figure 2 + +Now we concentrate on Figure 2, where all unnecessary details are removed. Let $U=N N^{\prime} \cap$ $P P^{\prime}, V=M M^{\prime} \cap R R^{\prime}$. Due to the right angles at $N$ and $P$, the points $N, N^{\prime}, P, P^{\prime}$ are concyclic, so $U N \cdot U N^{\prime}=U P \cdot U P^{\prime}$ which means that $U$ belongs to the radical axis $g$ of the circles $\omega_{E}$ and $\omega_{F}$. Analogously, $V$ also belongs to $g$. + +Finally, since $E U F V$ is a parallelogram, the radical axis $U V$ of $\omega_{E}$ and $\omega_{F}$ bisects $E F$. + +## G4 + +Let $A B C$ be an acute triangle with circumcircle $\Omega$. Let $B_{0}$ be the midpoint of $A C$ and let $C_{0}$ be the midpoint of $A B$. Let $D$ be the foot of the altitude from $A$, and let $G$ be the centroid of the triangle $A B C$. Let $\omega$ be a circle through $B_{0}$ and $C_{0}$ that is tangent to the circle $\Omega$ at a point $X \neq A$. Prove that the points $D, G$, and $X$ are collinear. + +Solution 1. If $A B=A C$, then the statement is trivial. So without loss of generality we may assume $A B0$, let $f(d)$ be the smallest positive integer that has exactly $d$ positive divisors (so for example we have $f(1)=1, f(5)=16$, and $f(6)=12$ ). Prove that for every integer $k \geq 0$ the number $f\left(2^{k}\right)$ divides $f\left(2^{k+1}\right)$. + +Solution 1. For any positive integer $n$, let $d(n)$ be the number of positive divisors of $n$. Let $n=\prod_{p} p^{a(p)}$ be the prime factorization of $n$ where $p$ ranges over the prime numbers, the integers $a(p)$ are nonnegative and all but finitely many $a(p)$ are zero. Then we have $d(n)=\prod_{p}(a(p)+1)$. Thus, $d(n)$ is a power of 2 if and only if for every prime $p$ there is a nonnegative integer $b(p)$ with $a(p)=2^{b(p)}-1=1+2+2^{2}+\cdots+2^{b(p)-1}$. We then have + +$$ +n=\prod_{p} \prod_{i=0}^{b(p)-1} p^{2^{i}}, \quad \text { and } \quad d(n)=2^{k} \quad \text { with } \quad k=\sum_{p} b(p) +$$ + +Let $\mathcal{S}$ be the set of all numbers of the form $p^{2^{r}}$ with $p$ prime and $r$ a nonnegative integer. Then we deduce that $d(n)$ is a power of 2 if and only if $n$ is the product of the elements of some finite subset $\mathcal{T}$ of $\mathcal{S}$ that satisfies the following condition: for all $t \in \mathcal{T}$ and $s \in \mathcal{S}$ with $s \mid t$ we have $s \in \mathcal{T}$. Moreover, if $d(n)=2^{k}$ then the corresponding set $\mathcal{T}$ has $k$ elements. + +Note that the set $\mathcal{T}_{k}$ consisting of the smallest $k$ elements from $\mathcal{S}$ obviously satisfies the condition above. Thus, given $k$, the smallest $n$ with $d(n)=2^{k}$ is the product of the elements of $\mathcal{T}_{k}$. This $n$ is $f\left(2^{k}\right)$. Since obviously $\mathcal{T}_{k} \subset \mathcal{T}_{k+1}$, it follows that $f\left(2^{k}\right) \mid f\left(2^{k+1}\right)$. + +Solution 2. This is an alternative to the second part of the Solution 1. Suppose $k$ is a nonnegative integer. From the first part of Solution 1 we see that $f\left(2^{k}\right)=\prod_{p} p^{a(p)}$ with $a(p)=2^{b(p)}-1$ and $\sum_{p} b(p)=k$. We now claim that for any two distinct primes $p, q$ with $b(q)>0$ we have + +$$ +m=p^{2^{b(p)}}>q^{2^{b(q)-1}}=\ell . +$$ + +To see this, note first that $\ell$ divides $f\left(2^{k}\right)$. With the first part of Solution 1 one can see that the integer $n=f\left(2^{k}\right) m / \ell$ also satisfies $d(n)=2^{k}$. By the definition of $f\left(2^{k}\right)$ this implies that $n \geq f\left(2^{k}\right)$ so $m \geq \ell$. Since $p \neq q$ the inequality (1) follows. + +Let the prime factorization of $f\left(2^{k+1}\right)$ be given by $f\left(2^{k+1}\right)=\prod_{p} p^{r(p)}$ with $r(p)=2^{s(p)}-1$. Since we have $\sum_{p} s(p)=k+1>k=\sum_{p} b(p)$ there is a prime $p$ with $s(p)>b(p)$. For any prime $q \neq p$ with $b(q)>0$ we apply inequality (1) twice and get + +$$ +q^{2^{s(q)}}>p^{2^{s(p)-1}} \geq p^{2^{b(p)}}>q^{2^{b(q)-1}} +$$ + +which implies $s(q) \geq b(q)$. It follows that $s(q) \geq b(q)$ for all primes $q$, so $f\left(2^{k}\right) \mid f\left(2^{k+1}\right)$. + +N2 + +Consider a polynomial $P(x)=\left(x+d_{1}\right)\left(x+d_{2}\right) \cdot \ldots \cdot\left(x+d_{9}\right)$, where $d_{1}, d_{2}, \ldots, d_{9}$ are nine distinct integers. Prove that there exists an integer $N$ such that for all integers $x \geq N$ the number $P(x)$ is divisible by a prime number greater than 20 . + +Solution 1. Note that the statement of the problem is invariant under translations of $x$; hence without loss of generality we may suppose that the numbers $d_{1}, d_{2}, \ldots, d_{9}$ are positive. + +The key observation is that there are only eight primes below 20, while $P(x)$ involves more than eight factors. + +We shall prove that $N=d^{8}$ satisfies the desired property, where $d=\max \left\{d_{1}, d_{2}, \ldots, d_{9}\right\}$. Suppose for the sake of contradiction that there is some integer $x \geq N$ such that $P(x)$ is composed of primes below 20 only. Then for every index $i \in\{1,2, \ldots, 9\}$ the number $x+d_{i}$ can be expressed as product of powers of the first 8 primes. + +Since $x+d_{i}>x \geq d^{8}$ there is some prime power $f_{i}>d$ that divides $x+d_{i}$. Invoking the pigeonhole principle we see that there are two distinct indices $i$ and $j$ such that $f_{i}$ and $f_{j}$ are powers of the same prime number. For reasons of symmetry, we may suppose that $f_{i} \leq f_{j}$. Now both of the numbers $x+d_{i}$ and $x+d_{j}$ are divisible by $f_{i}$ and hence so is their difference $d_{i}-d_{j}$. But as + +$$ +0<\left|d_{i}-d_{j}\right| \leq \max \left(d_{i}, d_{j}\right) \leq d D_{i}$ the numerator of the fraction we thereby get cannot be 1 , and hence it has to be divisible by some prime number $p_{i}<20$. + +By the pigeonhole principle, there are a prime number $p$ and two distinct indices $i$ and $j$ such that $p_{i}=p_{j}=p$. Let $p^{\alpha_{i}}$ and $p^{\alpha_{j}}$ be the greatest powers of $p$ dividing $x+d_{i}$ and $x+d_{j}$, respectively. Due to symmetry we may suppose $\alpha_{i} \leq \alpha_{j}$. But now $p^{\alpha_{i}}$ divides $d_{i}-d_{j}$ and hence also $D_{i}$, which means that all occurrences of $p$ in the numerator of the fraction $\left(x+d_{i}\right) / D_{i}$ cancel out, contrary to the choice of $p=p_{i}$. This contradiction proves our claim. + +Solution 3. Given a nonzero integer $N$ as well as a prime number $p$ we write $v_{p}(N)$ for the exponent with which $p$ occurs in the prime factorization of $|N|$. + +Evidently, if the statement of the problem were not true, then there would exist an infinite sequence $\left(x_{n}\right)$ of positive integers tending to infinity such that for each $n \in \mathbb{Z}_{+}$the integer $P\left(x_{n}\right)$ is not divisible by any prime number $>20$. Observe that the numbers $-d_{1},-d_{2}, \ldots,-d_{9}$ do not appear in this sequence. + +Now clearly there exists a prime $p_{1}<20$ for which the sequence $v_{p_{1}}\left(x_{n}+d_{1}\right)$ is not bounded; thinning out the sequence $\left(x_{n}\right)$ if necessary we may even suppose that + +$$ +v_{p_{1}}\left(x_{n}+d_{1}\right) \longrightarrow \infty . +$$ + +Repeating this argument eight more times we may similarly choose primes $p_{2}, \ldots, p_{9}<20$ and suppose that our sequence $\left(x_{n}\right)$ has been thinned out to such an extent that $v_{p_{i}}\left(x_{n}+d_{i}\right) \longrightarrow \infty$ holds for $i=2, \ldots, 9$ as well. In view of the pigeonhole principle, there are distinct indices $i$ and $j$ as well as a prime $p<20$ such that $p_{i}=p_{j}=p$. Setting $k=v_{p}\left(d_{i}-d_{j}\right)$ there now has to be some $n$ for which both $v_{p}\left(x_{n}+d_{i}\right)$ and $v_{p}\left(x_{n}+d_{j}\right)$ are greater than $k$. But now the numbers $x_{n}+d_{i}$ and $x_{n}+d_{j}$ are divisible by $p^{k+1}$ whilst their difference $d_{i}-d_{j}$ is not - a contradiction. + +Comment. This problem is supposed to be a relatively easy one, so one might consider adding the hypothesis that the numbers $d_{1}, d_{2}, \ldots, d_{9}$ be positive. Then certain merely technical issues are not going to arise while the main ideas required to solve the problems remain the same. + +Let $n \geq 1$ be an odd integer. Determine all functions $f$ from the set of integers to itself such that for all integers $x$ and $y$ the difference $f(x)-f(y)$ divides $x^{n}-y^{n}$. + +Answer. All functions $f$ of the form $f(x)=\varepsilon x^{d}+c$, where $\varepsilon$ is in $\{1,-1\}$, the integer $d$ is a positive divisor of $n$, and $c$ is an integer. + +Solution. Obviously, all functions in the answer satisfy the condition of the problem. We will show that there are no other functions satisfying that condition. + +Let $f$ be a function satisfying the given condition. For each integer $n$, the function $g$ defined by $g(x)=f(x)+n$ also satisfies the same condition. Therefore, by subtracting $f(0)$ from $f(x)$ we may assume that $f(0)=0$. + +For any prime $p$, the condition on $f$ with $(x, y)=(p, 0)$ states that $f(p)$ divides $p^{n}$. Since the set of primes is infinite, there exist integers $d$ and $\varepsilon$ with $0 \leq d \leq n$ and $\varepsilon \in\{1,-1\}$ such that for infinitely many primes $p$ we have $f(p)=\varepsilon p^{d}$. Denote the set of these primes by $P$. Since a function $g$ satisfies the given condition if and only if $-g$ satisfies the same condition, we may suppose $\varepsilon=1$. + +The case $d=0$ is easily ruled out, because 0 does not divide any nonzero integer. Suppose $d \geq 1$ and write $n$ as $m d+r$, where $m$ and $r$ are integers such that $m \geq 1$ and $0 \leq r \leq d-1$. Let $x$ be an arbitrary integer. For each prime $p$ in $P$, the difference $f(p)-f(x)$ divides $p^{n}-x^{n}$. Using the equality $f(p)=p^{d}$, we get + +$$ +p^{n}-x^{n}=p^{r}\left(p^{d}\right)^{m}-x^{n} \equiv p^{r} f(x)^{m}-x^{n} \equiv 0 \quad\left(\bmod p^{d}-f(x)\right) +$$ + +Since we have $r 8$. For each positive integer $n$, there exists an $i \in\{0,1, \ldots, a-5\}$ such that $n+i=2 d$ for some odd $d$. We get + +$$ +t(n+i)=d \not \equiv d+2=t(n+i+4) \quad(\bmod 4) +$$ + +and + +$$ +t(n+a+i)=n+a+i \equiv n+a+i+4=t(n+a+i+4) \quad(\bmod 4) +$$ + +Therefore, the integers $t(n+a+i)-t(n+i)$ and $t(n+a+i+4)-t(n+i+4)$ cannot be both divisible by 4 , and therefore there are no winning pairs in this case. + +Case 3: $a=7$. For each positive integer $n$, there exists an $i \in\{0,1, \ldots, 6\}$ such that $n+i$ is either of the form $8 k+3$ or of the form $8 k+6$, where $k$ is a nonnegative integer. But we have + +$$ +t(8 k+3) \equiv 3 \not \equiv 1 \equiv 4 k+5=t(8 k+3+7) \quad(\bmod 4) +$$ + +and + +$$ +t(8 k+6)=4 k+3 \equiv 3 \not \equiv 1 \equiv t(8 k+6+7) \quad(\bmod 4) . +$$ + +Hence, there are no winning pairs of the form $(7, n)$. + +## N5 + +Let $f$ be a function from the set of integers to the set of positive integers. Suppose that for any two integers $m$ and $n$, the difference $f(m)-f(n)$ is divisible by $f(m-n)$. Prove that for all integers $m, n$ with $f(m) \leq f(n)$ the number $f(n)$ is divisible by $f(m)$. + +Solution 1. Suppose that $x$ and $y$ are two integers with $f(x) 0 +$$ + +so $f(x-y) \leq f(y)-f(x) f(1)$. Note that such a number exists due to the symmetry of $f$ obtained in Claim 2. + +Claim 3. $f(n) \neq f(1)$ if and only if $a \mid n$. + +Proof. Since $f(1)=\cdots=f(a-1) 0$, so $f(n+a) \leq$ $f(a)-f(n) b_{2}>\cdots>b_{k}$ be all these values. One may show (essentially in the same way as in Claim 3) that the set $S_{i}=\left\{n: f(n) \geq b_{i}\right\}$ consists exactly of all numbers divisible by some integer $a_{i} \geq 0$. One obviously has $a_{i} \mid a_{i-1}$, which implies $f\left(a_{i}\right) \mid f\left(a_{i-1}\right)$ by Claim 1. So, $b_{k}\left|b_{k-1}\right| \cdots \mid b_{1}$, thus proving the problem statement. + +Moreover, now it is easy to describe all functions satisfying the conditions of the problem. Namely, all these functions can be constructed as follows. Consider a sequence of nonnegative integers $a_{1}, a_{2}, \ldots, a_{k}$ and another sequence of positive integers $b_{1}, b_{2}, \ldots, b_{k}$ such that $\left|a_{k}\right|=1, a_{i} \neq a_{j}$ and $b_{i} \neq b_{j}$ for all $1 \leq i 0$ this implies $M \leq 3^{P(m+a x-b y)}-1$. But $P(m+a x-b y)$ is listed among $P(1), P(2), \ldots, P(d)$, so + +$$ +M<3^{P(m+a x-b y)} \leq 3^{\max \{P(1), P(2), \ldots, P(d)\}} +$$ + +which contradicts (1). + +Comment. We present another variant of the solution above. + +Denote the degree of $P$ by $k$ and its leading coefficient by $p$. Consider any positive integer $n$ and let $a=Q(n)$. Again, denote by $b$ the multiplicative order of 3 modulo $2^{a}-1$. Since $2^{a}-1 \mid 3^{P(n)}-1$, we have $b \mid P(n)$. Moreover, since $2^{Q(n+a t)}-1 \mid 3^{P(n+a t)}-1$ and $a=Q(n) \mid Q(n+a t)$ for each positive integer $t$, we have $2^{a}-1 \mid 3^{P(n+a t)}-1$, hence $b \mid P(n+a t)$ as well. + +Therefore, $b$ divides $\operatorname{gcd}\{P(n+a t): t \geq 0\}$; hence it also divides the number + +$$ +\sum_{i=0}^{k}(-1)^{k-i}\left(\begin{array}{c} +k \\ +i +\end{array}\right) P(n+a i)=p \cdot k ! \cdot a^{k} +$$ + +Finally, we get $b \mid \operatorname{gcd}\left(P(n), k ! \cdot p \cdot Q(n)^{k}\right)$, which is bounded by the same arguments as in the beginning of the solution. So $3^{b}-1$ is bounded, and hence $2^{Q(n)}-1$ is bounded as well. + +## N7 + +Let $p$ be an odd prime number. For every integer $a$, define the number + +$$ +S_{a}=\frac{a}{1}+\frac{a^{2}}{2}+\cdots+\frac{a^{p-1}}{p-1} +$$ + +Let $m$ and $n$ be integers such that + +$$ +S_{3}+S_{4}-3 S_{2}=\frac{m}{n} +$$ + +Prove that $p$ divides $m$. + +Solution 1. For rational numbers $p_{1} / q_{1}$ and $p_{2} / q_{2}$ with the denominators $q_{1}, q_{2}$ not divisible by $p$, we write $p_{1} / q_{1} \equiv p_{2} / q_{2}(\bmod p)$ if the numerator $p_{1} q_{2}-p_{2} q_{1}$ of their difference is divisible by $p$. + +We start with finding an explicit formula for the residue of $S_{a}$ modulo $p$. Note first that for every $k=1, \ldots, p-1$ the number $\left(\begin{array}{l}p \\ k\end{array}\right)$ is divisible by $p$, and + +$$ +\frac{1}{p}\left(\begin{array}{l} +p \\ +k +\end{array}\right)=\frac{(p-1)(p-2) \cdots(p-k+1)}{k !} \equiv \frac{(-1) \cdot(-2) \cdots(-k+1)}{k !}=\frac{(-1)^{k-1}}{k} \quad(\bmod p) +$$ + +Therefore, we have + +$$ +S_{a}=-\sum_{k=1}^{p-1} \frac{(-a)^{k}(-1)^{k-1}}{k} \equiv-\sum_{k=1}^{p-1}(-a)^{k} \cdot \frac{1}{p}\left(\begin{array}{l} +p \\ +k +\end{array}\right) \quad(\bmod p) +$$ + +The number on the right-hand side is integer. Using the binomial formula we express it as + +$$ +-\sum_{k=1}^{p-1}(-a)^{k} \cdot \frac{1}{p}\left(\begin{array}{l} +p \\ +k +\end{array}\right)=-\frac{1}{p}\left(-1-(-a)^{p}+\sum_{k=0}^{p}(-a)^{k}\left(\begin{array}{l} +p \\ +k +\end{array}\right)\right)=\frac{(a-1)^{p}-a^{p}+1}{p} +$$ + +since $p$ is odd. So, we have + +$$ +S_{a} \equiv \frac{(a-1)^{p}-a^{p}+1}{p} \quad(\bmod p) +$$ + +Finally, using the obtained formula we get + +$$ +\begin{aligned} +S_{3}+S_{4}-3 S_{2} & \equiv \frac{\left(2^{p}-3^{p}+1\right)+\left(3^{p}-4^{p}+1\right)-3\left(1^{p}-2^{p}+1\right)}{p} \\ +& =\frac{4 \cdot 2^{p}-4^{p}-4}{p}=-\frac{\left(2^{p}-2\right)^{2}}{p} \quad(\bmod p) . +\end{aligned} +$$ + +By Fermat's theorem, $p \mid 2^{p}-2$, so $p^{2} \mid\left(2^{p}-2\right)^{2}$ and hence $S_{3}+S_{4}-3 S_{2} \equiv 0(\bmod p)$. + +Solution 2. One may solve the problem without finding an explicit formula for $S_{a}$. It is enough to find the following property. + +Lemma. For every integer $a$, we have $S_{a+1} \equiv S_{-a}(\bmod p)$. + +Proof. We expand $S_{a+1}$ using the binomial formula as + +$$ +S_{a+1}=\sum_{k=1}^{p-1} \frac{1}{k} \sum_{j=0}^{k}\left(\begin{array}{l} +k \\ +j +\end{array}\right) a^{j}=\sum_{k=1}^{p-1}\left(\frac{1}{k}+\sum_{j=1}^{k} a^{j} \cdot \frac{1}{k}\left(\begin{array}{l} +k \\ +j +\end{array}\right)\right)=\sum_{k=1}^{p-1} \frac{1}{k}+\sum_{j=1}^{p-1} a^{j} \sum_{k=j}^{p-1} \frac{1}{k}\left(\begin{array}{l} +k \\ +j +\end{array}\right) a^{k} . +$$ + +Note that $\frac{1}{k}+\frac{1}{p-k}=\frac{p}{k(p-k)} \equiv 0(\bmod p)$ for all $1 \leq k \leq p-1$; hence the first sum vanishes modulo $p$. For the second sum, we use the relation $\frac{1}{k}\left(\begin{array}{c}k \\ j\end{array}\right)=\frac{1}{j}\left(\begin{array}{c}k-1 \\ j-1\end{array}\right)$ to obtain + +$$ +S_{a+1} \equiv \sum_{j=1}^{p-1} \frac{a^{j}}{j} \sum_{k=1}^{p-1}\left(\begin{array}{c} +k-1 \\ +j-1 +\end{array}\right) \quad(\bmod p) +$$ + +Finally, from the relation + +$$ +\sum_{k=1}^{p-1}\left(\begin{array}{l} +k-1 \\ +j-1 +\end{array}\right)=\left(\begin{array}{c} +p-1 \\ +j +\end{array}\right)=\frac{(p-1)(p-2) \ldots(p-j)}{j !} \equiv(-1)^{j} \quad(\bmod p) +$$ + +we obtain + +$$ +S_{a+1} \equiv \sum_{j=1}^{p-1} \frac{a^{j}(-1)^{j}}{j !}=S_{-a} +$$ + +Now we turn to the problem. Using the lemma we get + +$$ +S_{3}-3 S_{2} \equiv S_{-2}-3 S_{2}=\sum_{\substack{1 \leq k \leq p-1 \\ k \text { is even }}} \frac{-2 \cdot 2^{k}}{k}+\sum_{\substack{1 \leq k \leq p-1 \\ k \text { is odd }}} \frac{-4 \cdot 2^{k}}{k}(\bmod p) . +$$ + +The first sum in (11) expands as + +$$ +\sum_{\ell=1}^{(p-1) / 2} \frac{-2 \cdot 2^{2 \ell}}{2 \ell}=-\sum_{\ell=1}^{(p-1) / 2} \frac{4^{\ell}}{\ell} +$$ + +Next, using Fermat's theorem, we expand the second sum in (11) as + +$$ +-\sum_{\ell=1}^{(p-1) / 2} \frac{2^{2 \ell+1}}{2 \ell-1} \equiv-\sum_{\ell=1}^{(p-1) / 2} \frac{2^{p+2 \ell}}{p+2 \ell-1}=-\sum_{m=(p+1) / 2}^{p-1} \frac{2 \cdot 4^{m}}{2 m}=-\sum_{m=(p+1) / 2}^{p-1} \frac{4^{m}}{m}(\bmod p) +$$ + +(here we set $m=\ell+\frac{p-1}{2}$ ). Hence, + +$$ +S_{3}-3 S_{2} \equiv-\sum_{\ell=1}^{(p-1) / 2} \frac{4^{\ell}}{\ell}-\sum_{m=(p+1) / 2}^{p-1} \frac{4^{m}}{m}=-S_{4} \quad(\bmod p) +$$ + +Let $k$ be a positive integer and set $n=2^{k}+1$. Prove that $n$ is a prime number if and only if the following holds: there is a permutation $a_{1}, \ldots, a_{n-1}$ of the numbers $1,2, \ldots, n-1$ and a sequence of integers $g_{1}, g_{2}, \ldots, g_{n-1}$ such that $n$ divides $g_{i}^{a_{i}}-a_{i+1}$ for every $i \in\{1,2, \ldots, n-1\}$, where we set $a_{n}=a_{1}$. + +Solution. Let $N=\{1,2, \ldots, n-1\}$. For $a, b \in N$, we say that $b$ follows $a$ if there exists an integer $g$ such that $b \equiv g^{a}(\bmod n)$ and denote this property as $a \rightarrow b$. This way we have a directed graph with $N$ as set of vertices. If $a_{1}, \ldots, a_{n-1}$ is a permutation of $1,2, \ldots, n-1$ such that $a_{1} \rightarrow a_{2} \rightarrow \ldots \rightarrow a_{n-1} \rightarrow a_{1}$ then this is a Hamiltonian cycle in the graph. + +Step I. First consider the case when $n$ is composite. Let $n=p_{1}^{\alpha_{1}} \ldots p_{s}^{\alpha_{s}}$ be its prime factorization. All primes $p_{i}$ are odd. + +Suppose that $\alpha_{i}>1$ for some $i$. For all integers $a, g$ with $a \geq 2$, we have $g^{a} \not \equiv p_{i}\left(\bmod p_{i}^{2}\right)$, because $g^{a}$ is either divisible by $p_{i}^{2}$ or it is not divisible by $p_{i}$. It follows that in any Hamiltonian cycle $p_{i}$ comes immediately after 1 . The same argument shows that $2 p_{i}$ also should come immediately after 1, which is impossible. Hence, there is no Hamiltonian cycle in the graph. + +Now suppose that $n$ is square-free. We have $n=p_{1} p_{2} \ldots p_{s}>9$ and $s \geq 2$. Assume that there exists a Hamiltonian cycle. There are $\frac{n-1}{2}$ even numbers in this cycle, and each number which follows one of them should be a quadratic residue modulo $n$. So, there should be at least $\frac{n-1}{2}$ nonzero quadratic residues modulo $n$. On the other hand, for each $p_{i}$ there exist exactly $\frac{p_{i}+1}{2}$ quadratic residues modulo $p_{i}$; by the Chinese Remainder Theorem, the number of quadratic residues modulo $n$ is exactly $\frac{p_{1}+1}{2} \cdot \frac{p_{2}+1}{2} \cdot \ldots \cdot \frac{p_{s}+1}{2}$, including 0 . Then we have a contradiction by + +$$ +\frac{p_{1}+1}{2} \cdot \frac{p_{2}+1}{2} \cdot \ldots \cdot \frac{p_{s}+1}{2} \leq \frac{2 p_{1}}{3} \cdot \frac{2 p_{2}}{3} \cdot \ldots \cdot \frac{2 p_{s}}{3}=\left(\frac{2}{3}\right)^{s} n \leq \frac{4 n}{9}<\frac{n-1}{2} +$$ + +This proves the "if"-part of the problem. + +Step II. Now suppose that $n$ is prime. For any $a \in N$, denote by $\nu_{2}(a)$ the exponent of 2 in the prime factorization of $a$, and let $\mu(a)=\max \left\{t \in[0, k] \mid 2^{t} \rightarrow a\right\}$. + +Lemma. For any $a, b \in N$, we have $a \rightarrow b$ if and only if $\nu_{2}(a) \leq \mu(b)$. + +Proof. Let $\ell=\nu_{2}(a)$ and $m=\mu(b)$. + +Suppose $\ell \leq m$. Since $b$ follows $2^{m}$, there exists some $g_{0}$ such that $b \equiv g_{0}^{2^{m}}(\bmod n)$. By $\operatorname{gcd}(a, n-1)=2^{\ell}$ there exist some integers $p$ and $q$ such that $p a-q(n-1)=2^{\ell}$. Choosing $g=g_{0}^{2^{m-\ell} p}$ we have $g^{a}=g_{0}^{2^{m-\ell} p a}=g_{0}^{2^{m}+2^{m-\ell} q(n-1)} \equiv g_{0}^{2^{m}} \equiv b(\bmod n)$ by FERMAT's theorem. Hence, $a \rightarrow b$. + +To prove the reverse statement, suppose that $a \rightarrow b$, so $b \equiv g^{a}(\bmod n)$ with some $g$. Then $b \equiv\left(g^{a / 2^{\ell}}\right)^{2^{\ell}}$, and therefore $2^{\ell} \rightarrow b$. By the definition of $\mu(b)$, we have $\mu(b) \geq \ell$. The lemma is +proved. + +Now for every $i$ with $0 \leq i \leq k$, let + +$$ +\begin{aligned} +A_{i} & =\left\{a \in N \mid \nu_{2}(a)=i\right\}, \\ +B_{i} & =\{a \in N \mid \mu(a)=i\}, \\ +\text { and } C_{i} & =\{a \in N \mid \mu(a) \geq i\}=B_{i} \cup B_{i+1} \cup \ldots \cup B_{k} . +\end{aligned} +$$ + +We claim that $\left|A_{i}\right|=\left|B_{i}\right|$ for all $0 \leq i \leq k$. Obviously we have $\left|A_{i}\right|=2^{k-i-1}$ for all $i=$ $0, \ldots, k-1$, and $\left|A_{k}\right|=1$. Now we determine $\left|C_{i}\right|$. We have $\left|C_{0}\right|=n-1$ and by Fermat's theorem we also have $C_{k}=\{1\}$, so $\left|C_{k}\right|=1$. Next, notice that $C_{i+1}=\left\{x^{2} \bmod n \mid x \in C_{i}\right\}$. For every $a \in N$, the relation $x^{2} \equiv a(\bmod n)$ has at most two solutions in $N$. Therefore we have $2\left|C_{i+1}\right| \leq\left|C_{i}\right|$, with the equality achieved only if for every $y \in C_{i+1}$, there exist distinct elements $x, x^{\prime} \in C_{i}$ such that $x^{2} \equiv x^{\prime 2} \equiv y(\bmod n)$ (this implies $\left.x+x^{\prime}=n\right)$. Now, since $2^{k}\left|C_{k}\right|=\left|C_{0}\right|$, we obtain that this equality should be achieved in each step. Hence $\left|C_{i}\right|=2^{k-i}$ for $0 \leq i \leq k$, and therefore $\left|B_{i}\right|=2^{k-i-1}$ for $0 \leq i \leq k-1$ and $\left|B_{k}\right|=1$. + +From the previous arguments we can see that for each $z \in C_{i}(0 \leq i 0$. Finally, if $\lambda=k-1$, then $C$ contains $2^{k-1}$ which is the only element of $A_{k-1}$. Since $B_{k-1}=\left\{2^{k}\right\}=A_{k}$ and $B_{k}=\{1\}$, the cycle $C$ contains the path $2^{k-1} \rightarrow 2^{k} \rightarrow 1$ and it contains an odd number again. This completes the proof of the "only if"-part of the problem. + +Comment 1. The lemma and the fact $\left|A_{i}\right|=\left|B_{i}\right|$ together show that for every edge $a \rightarrow b$ of the Hamiltonian cycle, $\nu_{2}(a)=\mu(b)$ must hold. After this observation, the Hamiltonian cycle can be built in many ways. For instance, it is possible to select edges from $A_{i}$ to $B_{i}$ for $i=k, k-1, \ldots, 1$ in such a way that they form disjoint paths; at the end all these paths will have odd endpoints. In the final step, the paths can be closed to form a unique cycle. + +Comment 2. Step II is an easy consequence of some basic facts about the multiplicative group modulo the prime $n=2^{k}+1$. The Lemma follows by noting that this group has order $2^{k}$, so the $a$-th powers are exactly the $2^{\nu_{2}(a)}$-th powers. Using the existence of a primitive root $g$ modulo $n$ one sees that the map from $\{1,2, \ldots, n-1\}$ to itself that sends $a$ to $g^{a} \bmod n$ is a bijection that sends $A_{i}$ to $B_{i}$ for each $i \in\{0, \ldots, k\}$. + diff --git a/IMO/md/en-IMO2012SL.md b/IMO/md/en-IMO2012SL.md new file mode 100644 index 0000000000000000000000000000000000000000..aee35324f6beb2b9175c306a96d6d2a86e48c67f --- /dev/null +++ b/IMO/md/en-IMO2012SL.md @@ -0,0 +1,1639 @@ +# Shortlisted Problems with Solutions + +$53^{\text {rd }}$ International Mathematical Olympiad + +Mar del Plata, Argentina 2012 + +## The shortlisted problems should be kept strictly confidential until IMO 2013 + +## Contributing Countries + +The Organizing Committee and the Problem Selection Committee of IMO 2012 thank the following 40 countries for contributing 136 problem proposals: + +Australia, Austria, Belarus, Belgium, Bulgaria, Canada, Cyprus, Czech Republic, Denmark, Estonia, Finland, France, Germany, Greece, Hong Kong, India, Iran, Ireland, Israel, Japan, Kazakhstan, Luxembourg, Malaysia, Montenegro, Netherlands, Norway, Pakistan, Romania, Russia, Serbia, Slovakia, Slovenia, South Africa, South Korea, Sweden, Thailand, Ukraine, United Kingdom, United States of America, Uzbekistan + +## Problem Selection Committee + +Martín Avendaño + +Carlos di Fiore + +Géza Kós + +Svetoslav Savchev + +## Algebra + +A1. Find all the functions $f: \mathbb{Z} \rightarrow \mathbb{Z}$ such that + +$$ +f(a)^{2}+f(b)^{2}+f(c)^{2}=2 f(a) f(b)+2 f(b) f(c)+2 f(c) f(a) +$$ + +for all integers $a, b, c$ satisfying $a+b+c=0$. + +A2. Let $\mathbb{Z}$ and $\mathbb{Q}$ be the sets of integers and rationals respectively. + +a) Does there exist a partition of $\mathbb{Z}$ into three non-empty subsets $A, B, C$ such that the sets $A+B, B+C, C+A$ are disjoint? + +b) Does there exist a partition of $\mathbb{Q}$ into three non-empty subsets $A, B, C$ such that the sets $A+B, B+C, C+A$ are disjoint? + +Here $X+Y$ denotes the set $\{x+y \mid x \in X, y \in Y\}$, for $X, Y \subseteq \mathbb{Z}$ and $X, Y \subseteq \mathbb{Q}$. + +A3. Let $a_{2}, \ldots, a_{n}$ be $n-1$ positive real numbers, where $n \geq 3$, such that $a_{2} a_{3} \cdots a_{n}=1$. Prove that + +$$ +\left(1+a_{2}\right)^{2}\left(1+a_{3}\right)^{3} \cdots\left(1+a_{n}\right)^{n}>n^{n} . +$$ + +A4. Let $f$ and $g$ be two nonzero polynomials with integer coefficients and $\operatorname{deg} f>\operatorname{deg} g$. Suppose that for infinitely many primes $p$ the polynomial $p f+g$ has a rational root. Prove that $f$ has a rational root. + +A5. Find all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ that satisfy the conditions + +$$ +f(1+x y)-f(x+y)=f(x) f(y) \quad \text { for all } x, y \in \mathbb{R} +$$ + +and $f(-1) \neq 0$. + +A6. Let $f: \mathbb{N} \rightarrow \mathbb{N}$ be a function, and let $f^{m}$ be $f$ applied $m$ times. Suppose that for every $n \in \mathbb{N}$ there exists a $k \in \mathbb{N}$ such that $f^{2 k}(n)=n+k$, and let $k_{n}$ be the smallest such $k$. Prove that the sequence $k_{1}, k_{2}, \ldots$ is unbounded. + +A7. We say that a function $f: \mathbb{R}^{k} \rightarrow \mathbb{R}$ is a metapolynomial if, for some positive integers $m$ and $n$, it can be represented in the form + +$$ +f\left(x_{1}, \ldots, x_{k}\right)=\max _{i=1, \ldots, m} \min _{j=1, \ldots, n} P_{i, j}\left(x_{1}, \ldots, x_{k}\right) +$$ + +where $P_{i, j}$ are multivariate polynomials. Prove that the product of two metapolynomials is also a metapolynomial. + +## Combinatorics + +C1. Several positive integers are written in a row. Iteratively, Alice chooses two adjacent numbers $x$ and $y$ such that $x>y$ and $x$ is to the left of $y$, and replaces the pair $(x, y)$ by either $(y+1, x)$ or $(x-1, x)$. Prove that she can perform only finitely many such iterations. + +C2. Let $n \geq 1$ be an integer. What is the maximum number of disjoint pairs of elements of the set $\{1,2, \ldots, n\}$ such that the sums of the different pairs are different integers not exceeding $n$ ? + +C3. In a $999 \times 999$ square table some cells are white and the remaining ones are red. Let $T$ be the number of triples $\left(C_{1}, C_{2}, C_{3}\right)$ of cells, the first two in the same row and the last two in the same column, with $C_{1}$ and $C_{3}$ white and $C_{2}$ red. Find the maximum value $T$ can attain. + +C4. Players $A$ and $B$ play a game with $N \geq 2012$ coins and 2012 boxes arranged around a circle. Initially $A$ distributes the coins among the boxes so that there is at least 1 coin in each box. Then the two of them make moves in the order $B, A, B, A, \ldots$ by the following rules: + +- On every move of his $B$ passes 1 coin from every box to an adjacent box. +- On every move of hers $A$ chooses several coins that were not involved in $B$ 's previous move and are in different boxes. She passes every chosen coin to an adjacent box. + +Player $A$ 's goal is to ensure at least 1 coin in each box after every move of hers, regardless of how $B$ plays and how many moves are made. Find the least $N$ that enables her to succeed. + +C5. The columns and the rows of a $3 n \times 3 n$ square board are numbered $1,2, \ldots, 3 n$. Every square $(x, y)$ with $1 \leq x, y \leq 3 n$ is colored asparagus, byzantium or citrine according as the modulo 3 remainder of $x+y$ is 0,1 or 2 respectively. One token colored asparagus, byzantium or citrine is placed on each square, so that there are $3 n^{2}$ tokens of each color. + +Suppose that one can permute the tokens so that each token is moved to a distance of at most $d$ from its original position, each asparagus token replaces a byzantium token, each byzantium token replaces a citrine token, and each citrine token replaces an asparagus token. Prove that it is possible to permute the tokens so that each token is moved to a distance of at most $d+2$ from its original position, and each square contains a token with the same color as the square. + +C6. Let $k$ and $n$ be fixed positive integers. In the liar's guessing game, Amy chooses integers $x$ and $N$ with $1 \leq x \leq N$. She tells Ben what $N$ is, but not what $x$ is. Ben may then repeatedly ask Amy whether $x \in S$ for arbitrary sets $S$ of integers. Amy will always answer with yes or no, but she might lie. The only restriction is that she can lie at most $k$ times in a row. After he has asked as many questions as he wants, Ben must specify a set of at most $n$ positive integers. If $x$ is in this set he wins; otherwise, he loses. Prove that: + +a) If $n \geq 2^{k}$ then Ben can always win. + +b) For sufficiently large $k$ there exist $n \geq 1.99^{k}$ such that Ben cannot guarantee a win. + +C7. There are given $2^{500}$ points on a circle labeled $1,2, \ldots, 2^{500}$ in some order. Prove that one can choose 100 pairwise disjoint chords joining some of these points so that the 100 sums of the pairs of numbers at the endpoints of the chosen chords are equal. + +## Geometry + +G1. In the triangle $A B C$ the point $J$ is the center of the excircle opposite to $A$. This excircle is tangent to the side $B C$ at $M$, and to the lines $A B$ and $A C$ at $K$ and $L$ respectively. The lines $L M$ and $B J$ meet at $F$, and the lines $K M$ and $C J$ meet at $G$. Let $S$ be the point of intersection of the lines $A F$ and $B C$, and let $T$ be the point of intersection of the lines $A G$ and $B C$. Prove that $M$ is the midpoint of $S T$. + +G2. Let $A B C D$ be a cyclic quadrilateral whose diagonals $A C$ and $B D$ meet at $E$. The extensions of the sides $A D$ and $B C$ beyond $A$ and $B$ meet at $F$. Let $G$ be the point such that $E C G D$ is a parallelogram, and let $H$ be the image of $E$ under reflection in $A D$. Prove that $D, H, F, G$ are concyclic. + +G3. In an acute triangle $A B C$ the points $D, E$ and $F$ are the feet of the altitudes through $A$, $B$ and $C$ respectively. The incenters of the triangles $A E F$ and $B D F$ are $I_{1}$ and $I_{2}$ respectively; the circumcenters of the triangles $A C I_{1}$ and $B C I_{2}$ are $O_{1}$ and $O_{2}$ respectively. Prove that $I_{1} I_{2}$ and $O_{1} O_{2}$ are parallel. + +G4. Let $A B C$ be a triangle with $A B \neq A C$ and circumcenter $O$. The bisector of $\angle B A C$ intersects $B C$ at $D$. Let $E$ be the reflection of $D$ with respect to the midpoint of $B C$. The lines through $D$ and $E$ perpendicular to $B C$ intersect the lines $A O$ and $A D$ at $X$ and $Y$ respectively. Prove that the quadrilateral $B X C Y$ is cyclic. + +G5. Let $A B C$ be a triangle with $\angle B C A=90^{\circ}$, and let $C_{0}$ be the foot of the altitude from $C$. Choose a point $X$ in the interior of the segment $C C_{0}$, and let $K, L$ be the points on the segments $A X, B X$ for which $B K=B C$ and $A L=A C$ respectively. Denote by $M$ the intersection of $A L$ and $B K$. Show that $M K=M L$. + +G6. Let $A B C$ be a triangle with circumcenter $O$ and incenter $I$. The points $D, E$ and $F$ on the sides $B C, C A$ and $A B$ respectively are such that $B D+B F=C A$ and $C D+C E=A B$. The circumcircles of the triangles $B F D$ and $C D E$ intersect at $P \neq D$. Prove that $O P=O I$. + +G7. Let $A B C D$ be a convex quadrilateral with non-parallel sides $B C$ and $A D$. Assume that there is a point $E$ on the side $B C$ such that the quadrilaterals $A B E D$ and $A E C D$ are circumscribed. Prove that there is a point $F$ on the side $A D$ such that the quadrilaterals $A B C F$ and $B C D F$ are circumscribed if and only if $A B$ is parallel to $C D$. + +G8. Let $A B C$ be a triangle with circumcircle $\omega$ and $\ell$ a line without common points with $\omega$. Denote by $P$ the foot of the perpendicular from the center of $\omega$ to $\ell$. The side-lines $B C, C A, A B$ intersect $\ell$ at the points $X, Y, Z$ different from $P$. Prove that the circumcircles of the triangles $A X P, B Y P$ and $C Z P$ have a common point different from $P$ or are mutually tangent at $P$. + +## Number Theory + +N1. Call admissible a set $A$ of integers that has the following property: + +$$ +\text { If } x, y \in A \text { (possibly } x=y \text { ) then } x^{2}+k x y+y^{2} \in A \text { for every integer } k \text {. } +$$ + +Determine all pairs $m, n$ of nonzero integers such that the only admissible set containing both $m$ and $n$ is the set of all integers. + +N2. Find all triples $(x, y, z)$ of positive integers such that $x \leq y \leq z$ and + +$$ +x^{3}\left(y^{3}+z^{3}\right)=2012(x y z+2) \text {. } +$$ + +N3. Determine all integers $m \geq 2$ such that every $n$ with $\frac{m}{3} \leq n \leq \frac{m}{2}$ divides the binomial coefficient $\left(\begin{array}{c}n \\ m-2 n\end{array}\right)$. + +N4. An integer $a$ is called friendly if the equation $\left(m^{2}+n\right)\left(n^{2}+m\right)=a(m-n)^{3}$ has a solution over the positive integers. + +a) Prove that there are at least 500 friendly integers in the set $\{1,2, \ldots, 2012\}$. + +b) Decide whether $a=2$ is friendly. + +N5. For a nonnegative integer $n$ define $\operatorname{rad}(n)=1$ if $n=0$ or $n=1$, and $\operatorname{rad}(n)=p_{1} p_{2} \cdots p_{k}$ where $p_{1} 100$ and every integer $r$ there exist two integers $a$ and $b$ such that $p$ divides $a^{2}+b^{5}-r$. + +## Algebra + +A1. Find all the functions $f: \mathbb{Z} \rightarrow \mathbb{Z}$ such that + +$$ +f(a)^{2}+f(b)^{2}+f(c)^{2}=2 f(a) f(b)+2 f(b) f(c)+2 f(c) f(a) +$$ + +for all integers $a, b, c$ satisfying $a+b+c=0$. + +Solution. The substitution $a=b=c=0$ gives $3 f(0)^{2}=6 f(0)^{2}$, hence + +$$ +f(0)=0 \text {. } +$$ + +The substitution $b=-a$ and $c=0$ gives $\left((f(a)-f(-a))^{2}=0\right.$. Hence $f$ is an even function: + +$$ +f(a)=f(-a) \quad \text { for all } a \in \mathbb{Z} +$$ + +Now set $b=a$ and $c=-2 a$ to obtain $2 f(a)^{2}+f(2 a)^{2}=2 f(a)^{2}+4 f(a) f(2 a)$. Hence + +$$ +f(2 a)=0 \text { or } f(2 a)=4 f(a) \text { for all } a \in \mathbb{Z} +$$ + +If $f(r)=0$ for some $r \geq 1$ then the substitution $b=r$ and $c=-a-r$ gives $(f(a+r)-f(a))^{2}=0$. So $f$ is periodic with period $r$, i. e. + +$$ +f(a+r)=f(a) \text { for all } a \in \mathbb{Z} +$$ + +In particular, if $f(1)=0$ then $f$ is constant, thus $f(a)=0$ for all $a \in \mathbb{Z}$. This function clearly satisfies the functional equation. For the rest of the analysis, we assume $f(1)=k \neq 0$. + +By (3) we have $f(2)=0$ or $f(2)=4 k$. If $f(2)=0$ then $f$ is periodic of period 2 , thus $f($ even $)=0$ and $f($ odd $)=k$. This function is a solution for every $k$. We postpone the verification; for the sequel assume $f(2)=4 k \neq 0$. + +By (3) again, we have $f(4)=0$ or $f(4)=16 k$. In the first case $f$ is periodic of period 4 , and $f(3)=f(-1)=f(1)=k$, so we have $f(4 n)=0, f(4 n+1)=f(4 n+3)=k$, and $f(4 n+2)=4 k$ for all $n \in \mathbb{Z}$. This function is a solution too, which we justify later. For the rest of the analysis, we assume $f(4)=16 k \neq 0$. + +We show now that $f(3)=9 k$. In order to do so, we need two substitutions: + +$$ +\begin{gathered} +a=1, b=2, c=-3 \Longrightarrow f(3)^{2}-10 k f(3)+9 k^{2}=0 \Longrightarrow f(3) \in\{k, 9 k\}, \\ +a=1, b=3, c=-4 \Longrightarrow f(3)^{2}-34 k f(3)+225 k^{2}=0 \Longrightarrow f(3) \in\{9 k, 25 k\} . +\end{gathered} +$$ + +Therefore $f(3)=9 k$, as claimed. Now we prove inductively that the only remaining function is $f(x)=k x^{2}, x \in \mathbb{Z}$. We proved this for $x=0,1,2,3,4$. Assume that $n \geq 4$ and that $f(x)=k x^{2}$ holds for all integers $x \in[0, n]$. Then the substitutions $a=n, b=1, c=-n-1$ and $a=n-1$, $b=2, c=-n-1$ lead respectively to + +$$ +f(n+1) \in\left\{k(n+1)^{2}, k(n-1)^{2}\right\} \quad \text { and } \quad f(n+1) \in\left\{k(n+1)^{2}, k(n-3)^{2}\right\} \text {. } +$$ + +Since $k(n-1)^{2} \neq k(n-3)^{2}$ for $n \neq 2$, the only possibility is $f(n+1)=k(n+1)^{2}$. This completes the induction, so $f(x)=k x^{2}$ for all $x \geq 0$. The same expression is valid for negative values of $x$ since $f$ is even. To verify that $f(x)=k x^{2}$ is actually a solution, we need to check the identity $a^{4}+b^{4}+(a+b)^{4}=2 a^{2} b^{2}+2 a^{2}(a+b)^{2}+2 b^{2}(a+b)^{2}$, which follows directly by expanding both sides. + +Therefore the only possible solutions of the functional equation are the constant function $f_{1}(x)=0$ and the following functions: + +$$ +f_{2}(x)=k x^{2} \quad f_{3}(x)=\left\{\begin{array}{cc} +0 & x \text { even } \\ +k & x \text { odd } +\end{array} \quad f_{4}(x)=\left\{\begin{array}{ccc} +0 & x \equiv 0 & (\bmod 4) \\ +k & x \equiv 1 & (\bmod 2) \\ +4 k & x \equiv 2 & (\bmod 4) +\end{array}\right.\right. +$$ + +for any non-zero integer $k$. The verification that they are indeed solutions was done for the first two. For $f_{3}$ note that if $a+b+c=0$ then either $a, b, c$ are all even, in which case $f(a)=f(b)=f(c)=0$, or one of them is even and the other two are odd, so both sides of the equation equal $2 k^{2}$. For $f_{4}$ we use similar parity considerations and the symmetry of the equation, which reduces the verification to the triples $(0, k, k),(4 k, k, k),(0,0,0),(0,4 k, 4 k)$. They all satisfy the equation. + +Comment. We used several times the same fact: For any $a, b \in \mathbb{Z}$ the functional equation is a quadratic equation in $f(a+b)$ whose coefficients depend on $f(a)$ and $f(b)$ : + +$$ +f(a+b)^{2}-2(f(a)+f(b)) f(a+b)+(f(a)-f(b))^{2}=0 +$$ + +Its discriminant is $16 f(a) f(b)$. Since this value has to be non-negative for any $a, b \in \mathbb{Z}$, we conclude that either $f$ or $-f$ is always non-negative. Also, if $f$ is a solution of the functional equation, then $-f$ is also a solution. Therefore we can assume $f(x) \geq 0$ for all $x \in \mathbb{Z}$. Now, the two solutions of the quadratic equation are + +$$ +f(a+b) \in\left\{(\sqrt{f(a)}+\sqrt{f(b)})^{2},(\sqrt{f(a)}-\sqrt{f(b)})^{2}\right\} \quad \text { for all } a, b \in \mathbb{Z} +$$ + +The computation of $f(3)$ from $f(1), f(2)$ and $f(4)$ that we did above follows immediately by setting $(a, b)=(1,2)$ and $(a, b)=(1,-4)$. The inductive step, where $f(n+1)$ is derived from $f(n), f(n-1)$, $f(2)$ and $f(1)$, follows immediately using $(a, b)=(n, 1)$ and $(a, b)=(n-1,2)$. + +A2. Let $\mathbb{Z}$ and $\mathbb{Q}$ be the sets of integers and rationals respectively. + +a) Does there exist a partition of $\mathbb{Z}$ into three non-empty subsets $A, B, C$ such that the sets $A+B, B+C, C+A$ are disjoint? + +b) Does there exist a partition of $\mathbb{Q}$ into three non-empty subsets $A, B, C$ such that the sets $A+B, B+C, C+A$ are disjoint? + +Here $X+Y$ denotes the set $\{x+y \mid x \in X, y \in Y\}$, for $X, Y \subseteq \mathbb{Z}$ and $X, Y \subseteq \mathbb{Q}$. + +Solution 1. a) The residue classes modulo 3 yield such a partition: + +$$ +A=\{3 k \mid k \in \mathbb{Z}\}, \quad B=\{3 k+1 \mid k \in \mathbb{Z}\}, \quad C=\{3 k+2 \mid k \in \mathbb{Z}\} +$$ + +b) The answer is no. Suppose that $\mathbb{Q}$ can be partitioned into non-empty subsets $A, B, C$ as stated. Note that for all $a \in A, b \in B, c \in C$ one has + +$$ +a+b-c \in C, \quad b+c-a \in A, \quad c+a-b \in B +$$ + +Indeed $a+b-c \notin A$ as $(A+B) \cap(A+C)=\emptyset$, and similarly $a+b-c \notin B$, hence $a+b-c \in C$. The other two relations follow by symmetry. Hence $A+B \subset C+C, B+C \subset A+A, C+A \subset B+B$. + +The opposite inclusions also hold. Let $a, a^{\prime} \in A$ and $b \in B, c \in C$ be arbitrary. By (1) $a^{\prime}+c-b \in B$, and since $a \in A, c \in C$, we use (1) again to obtain + +$$ +a+a^{\prime}-b=a+\left(a^{\prime}+c-b\right)-c \in C . +$$ + +So $A+A \subset B+C$ and likewise $B+B \subset C+A, C+C \subset A+B$. In summary + +$$ +B+C=A+A, \quad C+A=B+B, \quad A+B=C+C . +$$ + +Furthermore suppose that $0 \in A$ without loss of generality. Then $B=\{0\}+B \subset A+B$ and $C=\{0\}+C \subset A+C$. So, since $B+C$ is disjoint with $A+B$ and $A+C$, it is also disjoint with $B$ and $C$. Hence $B+C$ is contained in $\mathbb{Z} \backslash(B \cup C)=A$. Because $B+C=A+A$, we obtain $A+A \subset A$. On the other hand $A=\{0\}+A \subset A+A$, implying $A=A+A=B+C$. + +Therefore $A+B+C=A+A+A=A$, and now $B+B=C+A$ and $C+C=A+B$ yield $B+B+B=A+B+C=A, C+C+C=A+B+C=A$. In particular if $r \in \mathbb{Q}=A \cup B \cup C$ is arbitrary then $3 r \in A$. + +However such a conclusion is impossible. Take any $b \in B(B \neq \emptyset)$ and let $r=b / 3 \in \mathbb{Q}$. Then $b=3 r \in A$ which is a contradiction. + +Solution 2. We prove that the example for $\mathbb{Z}$ from the first solution is unique, and then use this fact to solve part b). + +Let $\mathbb{Z}=A \cup B \cup C$ be a partition of $\mathbb{Z}$ with $A, B, C \neq \emptyset$ and $A+B, B+C, C+A$ disjoint. We need the relations (1) which clearly hold for $\mathbb{Z}$. Fix two consecutive integers from different sets, say $b \in B$ and $c=b+1 \in C$. For every $a \in A$ we have, in view of (1), $a-1=a+b-c \in C$ and $a+1=a+c-b \in B$. So every $a \in A$ is preceded by a number from $C$ and followed by a number from $B$. + +In particular there are pairs of the form $c, c+1$ with $c \in C, c+1 \in A$. For such a pair and any $b \in B$ analogous reasoning shows that each $b \in B$ is preceded by a number from $A$ and followed by a number from $C$. There are also pairs $b, b-1$ with $b \in B, b-1 \in A$. We use them in a similar way to prove that each $c \in C$ is preceded by a number from $B$ and followed by a number from $A$. + +By putting the observations together we infer that $A, B, C$ are the three congruence classes modulo 3. Observe that all multiples of 3 are in the set of the partition that contains 0 . + +Now we turn to part b). Suppose that there is a partition of $\mathbb{Q}$ with the given properties. Choose three rationals $r_{i}=p_{i} / q_{i}$ from the three sets $A, B, C, i=1,2,3$, and set $N=3 q_{1} q_{2} q_{3}$. + +Let $S \subset \mathbb{Q}$ be the set of fractions with denominators $N$ (irreducible or not). It is obtained through multiplication of every integer by the constant $1 / N$, hence closed under sums and differences. Moreover, if we identify each $k \in \mathbb{Z}$ with $k / N \in S$ then $S$ is essentially the set $\mathbb{Z}$ with respect to addition. The numbers $r_{i}$ belong to $S$ because + +$$ +r_{1}=\frac{3 p_{1} q_{2} q_{3}}{N}, \quad r_{2}=\frac{3 p_{2} q_{3} q_{1}}{N}, \quad r_{3}=\frac{3 p_{3} q_{1} q_{2}}{N} +$$ + +The partition $\mathbb{Q}=A \cup B \cup C$ of $\mathbb{Q}$ induces a partition $S=A^{\prime} \cup B^{\prime} \cup C^{\prime}$ of $S$, with $A^{\prime}=A \cap S$, $B^{\prime}=B \cap S, C^{\prime}=C \cap S$. Clearly $A^{\prime}+B^{\prime}, B^{\prime}+C^{\prime}, C^{\prime}+A^{\prime}$ are disjoint, so this partition has the properties we consider. + +By the uniqueness of the example for $\mathbb{Z}$ the sets $A^{\prime}, B^{\prime}, C^{\prime}$ are the congruence classes modulo 3 , multiplied by $1 / N$. Also all multiples of $3 / N$ are in the same set, $A^{\prime}, B^{\prime}$ or $C^{\prime}$. This holds for $r_{1}, r_{2}, r_{3}$ in particular as they are all multiples of $3 / N$. However $r_{1}, r_{2}, r_{3}$ are in different sets $A^{\prime}, B^{\prime}, C^{\prime}$ since they were chosen from different sets $A, B, C$. The contradiction ends the proof. + +Comment. The uniqueness of the example for $\mathbb{Z}$ can also be deduced from the argument in the first solution. + +A3. Let $a_{2}, \ldots, a_{n}$ be $n-1$ positive real numbers, where $n \geq 3$, such that $a_{2} a_{3} \cdots a_{n}=1$. Prove that + +$$ +\left(1+a_{2}\right)^{2}\left(1+a_{3}\right)^{3} \cdots\left(1+a_{n}\right)^{n}>n^{n} . +$$ + +Solution. The substitution $a_{2}=\frac{x_{2}}{x_{1}}, a_{3}=\frac{x_{3}}{x_{2}}, \ldots, a_{n}=\frac{x_{1}}{x_{n-1}}$ transforms the original problem into the inequality + +$$ +\left(x_{1}+x_{2}\right)^{2}\left(x_{2}+x_{3}\right)^{3} \cdots\left(x_{n-1}+x_{1}\right)^{n}>n^{n} x_{1}^{2} x_{2}^{3} \cdots x_{n-1}^{n} +$$ + +for all $x_{1}, \ldots, x_{n-1}>0$. To prove this, we use the AM-GM inequality for each factor of the left-hand side as follows: + +$$ +\begin{array}{rlcl} +\left(x_{1}+x_{2}\right)^{2} & & & \geq 2^{2} x_{1} x_{2} \\ +\left(x_{2}+x_{3}\right)^{3} & = & \left(2\left(\frac{x_{2}}{2}\right)+x_{3}\right)^{3} & \geq 3^{3}\left(\frac{x_{2}}{2}\right)^{2} x_{3} \\ +\left(x_{3}+x_{4}\right)^{4} & = & \left(3\left(\frac{x_{3}}{3}\right)+x_{4}\right)^{4} & \geq 4^{4}\left(\frac{x_{3}}{3}\right)^{3} x_{4} \\ +& \vdots & \vdots & \vdots +\end{array} +$$ + +Multiplying these inequalities together gives $\left({ }^{*}\right)$, with inequality sign $\geq$ instead of $>$. However for the equality to occur it is necessary that $x_{1}=x_{2}, x_{2}=2 x_{3}, \ldots, x_{n-1}=(n-1) x_{1}$, implying $x_{1}=(n-1) ! x_{1}$. This is impossible since $x_{1}>0$ and $n \geq 3$. Therefore the inequality is strict. + +Comment. One can avoid the substitution $a_{i}=x_{i} / x_{i-1}$. Apply the weighted AM-GM inequality to each factor $\left(1+a_{k}\right)^{k}$, with the same weights like above, to obtain + +$$ +\left(1+a_{k}\right)^{k}=\left((k-1) \frac{1}{k-1}+a_{k}\right)^{k} \geq \frac{k^{k}}{(k-1)^{k-1}} a_{k} +$$ + +Multiplying all these inequalities together gives + +$$ +\left(1+a_{2}\right)^{2}\left(1+a_{3}\right)^{3} \cdots\left(1+a_{n}\right)^{n} \geq n^{n} a_{2} a_{3} \cdots a_{n}=n^{n} . +$$ + +The same argument as in the proof above shows that the equality cannot be attained. + +A4. Let $f$ and $g$ be two nonzero polynomials with integer coefficients and $\operatorname{deg} f>\operatorname{deg} g$. Suppose that for infinitely many primes $p$ the polynomial $p f+g$ has a rational root. Prove that $f$ has a rational root. + +Solution 1. Since $\operatorname{deg} f>\operatorname{deg} g$, we have $|g(x) / f(x)|<1$ for sufficiently large $x$; more precisely, there is a real number $R$ such that $|g(x) / f(x)|<1$ for all $x$ with $|x|>R$. Then for all such $x$ and all primes $p$ we have + +$$ +|p f(x)+g(x)| \geq|f(x)|\left(p-\frac{|g(x)|}{|f(x)|}\right)>0 +$$ + +Hence all real roots of the polynomials $p f+g$ lie in the interval $[-R, R]$. + +Let $f(x)=a_{n} x^{n}+a_{n-1} x^{n-1}+\cdots+a_{0}$ and $g(x)=b_{m} x^{m}+b_{m-1} x^{m-1}+\cdots+b_{0}$ where $n>m, a_{n} \neq 0$ and $b_{m} \neq 0$. Upon replacing $f(x)$ and $g(x)$ by $a_{n}^{n-1} f\left(x / a_{n}\right)$ and $a_{n}^{n-1} g\left(x / a_{n}\right)$ respectively, we reduce the problem to the case $a_{n}=1$. In other words one can assume that $f$ is monic. Then the leading coefficient of $p f+g$ is $p$, and if $r=u / v$ is a rational root of $p f+g$ with $(u, v)=1$ and $v>0$, then either $v=1$ or $v=p$. + +First consider the case when $v=1$ infinitely many times. If $v=1$ then $|u| \leq R$, so there are only finitely many possibilities for the integer $u$. Therefore there exist distinct primes $p$ and $q$ for which we have the same value of $u$. Then the polynomials $p f+g$ and $q f+g$ share this root, implying $f(u)=g(u)=0$. So in this case $f$ and $g$ have an integer root in common. + +Now suppose that $v=p$ infinitely many times. By comparing the exponent of $p$ in the denominators of $p f(u / p)$ and $g(u / p)$ we get $m=n-1$ and $p f(u / p)+g(u / p)=0$ reduces to an equation of the form + +$$ +\left(u^{n}+a_{n-1} p u^{n-1}+\ldots+a_{0} p^{n}\right)+\left(b_{n-1} u^{n-1}+b_{n-2} p u^{n-2}+\ldots+b_{0} p^{n-1}\right)=0 . +$$ + +The equation above implies that $u^{n}+b_{n-1} u^{n-1}$ is divisible by $p$ and hence, since $(u, p)=1$, we have $u+b_{n-1}=p k$ with some integer $k$. On the other hand all roots of $p f+g$ lie in the interval $[-R, R]$, so that + +$$ +\begin{gathered} +\frac{\left|p k-b_{n-1}\right|}{p}=\frac{|u|}{p} 5 / 4$ then $-x<5 / 4$ and so $g(2-x)-g(-x)=2$ by the above. On the other hand (3) gives $g(x)=2-g(2-x), g(x+2)=2-g(-x)$, so that $g(x+2)-g(x)=g(2-x)-g(-x)=2$. Thus (4) is true for all $x \in \mathbb{R}$. + +Now replace $x$ by $-x$ in (3) to obtain $g(-x)+g(2+x)=2$. In view of (4) this leads to $g(x)+g(-x)=0$, i. e. $g(-x)=-g(x)$ for all $x$. Taking this into account, we apply (1) to the pairs $(-x, y)$ and $(x,-y)$ : + +$g(1-x y)-g(-x+y)=(g(x)+1)(1-g(y)), \quad g(1-x y)-g(x-y)=(1-g(x))(g(y)+1)$. + +Adding up yields $g(1-x y)=1-g(x) g(y)$. Then $g(1+x y)=1+g(x) g(y)$ by (3). Now the original equation (1) takes the form $g(x+y)=g(x)+g(y)$. Hence $g$ is additive. + +By additvity $g(1+x y)=g(1)+g(x y)=1+g(x y)$; since $g(1+x y)=1+g(x) g(y)$ was shown above, we also have $g(x y)=g(x) g(y)$ ( $g$ is multiplicative). In particular $y=x$ gives $g\left(x^{2}\right)=g(x)^{2} \geq 0$ for all $x$, meaning that $g(x) \geq 0$ for $x \geq 0$. Since $g$ is additive and bounded from below on $[0,+\infty)$, it is linear; more exactly $g(x)=g(1) x=x$ for all $x \in \mathbb{R}$. + +In summary $f(x)=x-1, x \in \mathbb{R}$. It is straightforward that this function satisfies the requirements. + +Comment. There are functions that satisfy the given equation but vanish at -1 , for instance the constant function 0 and $f(x)=x^{2}-1, x \in \mathbb{R}$. + +A6. Let $f: \mathbb{N} \rightarrow \mathbb{N}$ be a function, and let $f^{m}$ be $f$ applied $m$ times. Suppose that for every $n \in \mathbb{N}$ there exists a $k \in \mathbb{N}$ such that $f^{2 k}(n)=n+k$, and let $k_{n}$ be the smallest such $k$. Prove that the sequence $k_{1}, k_{2}, \ldots$ is unbounded. + +Solution. We restrict attention to the set + +$$ +S=\left\{1, f(1), f^{2}(1), \ldots\right\} +$$ + +Observe that $S$ is unbounded because for every number $n$ in $S$ there exists a $k>0$ such that $f^{2 k}(n)=n+k$ is in $S$. Clearly $f$ maps $S$ into itself; moreover $f$ is injective on $S$. Indeed if $f^{i}(1)=f^{j}(1)$ with $i \neq j$ then the values $f^{m}(1)$ start repeating periodically from some point on, and $S$ would be finite. + +Define $g: S \rightarrow S$ by $g(n)=f^{2 k_{n}}(n)=n+k_{n}$. We prove that $g$ is injective too. Suppose that $g(a)=g(b)$ with $ak_{b}$. So, since $f$ is injective on $S$, we obtain + +$$ +f^{2\left(k_{a}-k_{b}\right)}(a)=b=a+\left(k_{a}-k_{b}\right) . +$$ + +However this contradicts the minimality of $k_{a}$ as $0 n$ for $n \in S$, so $T$ is non-empty. For each $t \in T$ denote $C_{t}=\left\{t, g(t), g^{2}(t), \ldots\right\}$; call $C_{t}$ the chain starting at $t$. Observe that distinct chains are disjoint because $g$ is injective. Each $n \in S \backslash T$ has the form $n=g\left(n^{\prime}\right)$ with $n^{\prime} k$, i. e. $k_{n}>k$. In conclusion $k_{1}, k_{2}, \ldots$ is unbounded. + +A7. We say that a function $f: \mathbb{R}^{k} \rightarrow \mathbb{R}$ is a metapolynomial if, for some positive integers $m$ and $n$, it can be represented in the form + +$$ +f\left(x_{1}, \ldots, x_{k}\right)=\max _{i=1, \ldots, m} \min _{j=1, \ldots, n} P_{i, j}\left(x_{1}, \ldots, x_{k}\right) +$$ + +where $P_{i, j}$ are multivariate polynomials. Prove that the product of two metapolynomials is also a metapolynomial. + +Solution. We use the notation $f(x)=f\left(x_{1}, \ldots, x_{k}\right)$ for $x=\left(x_{1}, \ldots, x_{k}\right)$ and $[m]=\{1,2, \ldots, m\}$. Observe that if a metapolynomial $f(x)$ admits a representation like the one in the statement for certain positive integers $m$ and $n$, then they can be replaced by any $m^{\prime} \geq m$ and $n^{\prime} \geq n$. For instance, if we want to replace $m$ by $m+1$ then it is enough to define $P_{m+1, j}(x)=P_{m, j}(x)$ and note that repeating elements of a set do not change its maximum nor its minimum. So one can assume that any two metapolynomials are defined with the same $m$ and $n$. We reserve letters $P$ and $Q$ for polynomials, so every function called $P, P_{i, j}, Q, Q_{i, j}, \ldots$ is a polynomial function. + +We start with a lemma that is useful to change expressions of the form $\min \max f_{i, j}$ to ones of the form $\max \min g_{i, j}$. + +Lemma. Let $\left\{a_{i, j}\right\}$ be real numbers, for all $i \in[m]$ and $j \in[n]$. Then + +$$ +\min _{i \in[m]} \max _{j \in[n]} a_{i, j}=\max _{j_{1}, \ldots, j_{m} \in[n]} \min _{i \in[m]} a_{i, j_{i}} +$$ + +where the max in the right-hand side is over all vectors $\left(j_{1}, \ldots, j_{m}\right)$ with $j_{1}, \ldots, j_{m} \in[n]$. + +Proof. We can assume for all $i$ that $a_{i, n}=\max \left\{a_{i, 1}, \ldots, a_{i, n}\right\}$ and $a_{m, n}=\min \left\{a_{1, n}, \ldots, a_{m, n}\right\}$. The left-hand side is $=a_{m, n}$ and hence we need to prove the same for the right-hand side. If $\left(j_{1}, j_{2}, \ldots, j_{m}\right)=(n, n, \ldots, n)$ then $\min \left\{a_{1, j_{1}}, \ldots, a_{m, j_{m}}\right\}=\min \left\{a_{1, n}, \ldots, a_{m, n}\right\}=a_{m, n}$ which implies that the right-hand side is $\geq a_{m, n}$. It remains to prove the opposite inequality and this is equivalent to $\min \left\{a_{1, j_{1}}, \ldots, a_{m, j_{m}}\right\} \leq a_{m, n}$ for all possible $\left(j_{1}, j_{2}, \ldots, j_{m}\right)$. This is true because $\min \left\{a_{1, j_{1}}, \ldots, a_{m, j_{m}}\right\} \leq a_{m, j_{m}} \leq a_{m, n}$. + +We need to show that the family $\mathcal{M}$ of metapolynomials is closed under multiplication, but it turns out easier to prove more: that it is also closed under addition, maxima and minima. + +First we prove the assertions about the maxima and the minima. If $f_{1}, \ldots, f_{r}$ are metapolynomials, assume them defined with the same $m$ and $n$. Then + +$$ +f=\max \left\{f_{1}, \ldots, f_{r}\right\}=\max \left\{\max _{i \in[m]} \min _{j \in[n]} P_{i, j}^{1}, \ldots, \max _{i \in[m]} \min _{j \in[n]} P_{i, j}^{r}\right\}=\max _{s \in[r], i \in[m]} \min _{j \in[n]} P_{i, j}^{s} +$$ + +It follows that $f=\max \left\{f_{1}, \ldots, f_{r}\right\}$ is a metapolynomial. The same argument works for the minima, but first we have to replace $\min \max$ by $\max \min$, and this is done via the lemma. + +Another property we need is that if $f=\max \min P_{i, j}$ is a metapolynomial then so is $-f$. Indeed, $-f=\min \left(-\min P_{i, j}\right)=\min \max P_{i, j}$. + +To prove $\mathcal{M}$ is closed under addition let $f=\max \min P_{i, j}$ and $g=\max \min Q_{i, j}$. Then + +$$ +\begin{gathered} +f(x)+g(x)=\max _{i \in[m]} \min _{j \in[n]} P_{i, j}(x)+\max _{i \in[m]} \min _{j \in[n]} Q_{i, j}(x) \\ +=\max _{i_{1}, i_{2} \in[m]}\left(\min _{j \in[n]} P_{i_{1}, j}(x)+\min _{j \in[n]} Q_{i_{2}, j}(x)\right)=\max _{i_{1}, i_{2} \in[m]} \min _{j_{1}, j_{2} \in[n]}\left(P_{i_{1}, j_{1}}(x)+Q_{i_{2}, j_{2}}(x)\right), +\end{gathered} +$$ + +and hence $f(x)+g(x)$ is a metapolynomial. + +We proved that $\mathcal{M}$ is closed under sums, maxima and minima, in particular any function that can be expressed by sums, max, min, polynomials or even metapolynomials is in $\mathcal{M}$. + +We would like to proceed with multiplication along the same lines like with addition, but there is an essential difference. In general the product of the maxima of two sets is not equal +to the maximum of the product of the sets. We need to deal with the fact that $ay$ and $x$ is to the left of $y$, and replaces the pair $(x, y)$ by either $(y+1, x)$ or $(x-1, x)$. Prove that she can perform only finitely many such iterations. + +Solution 1. Note first that the allowed operation does not change the maximum $M$ of the initial sequence. Let $a_{1}, a_{2}, \ldots, a_{n}$ be the numbers obtained at some point of the process. Consider the sum + +$$ +S=a_{1}+2 a_{2}+\cdots+n a_{n} +$$ + +We claim that $S$ increases by a positive integer amount with every operation. Let the operation replace the pair ( $\left.a_{i}, a_{i+1}\right)$ by a pair $\left(c, a_{i}\right)$, where $a_{i}>a_{i+1}$ and $c=a_{i+1}+1$ or $c=a_{i}-1$. Then the new and the old value of $S$ differ by $d=\left(i c+(i+1) a_{i}\right)-\left(i a_{i}+(i+1) a_{i+1}\right)=a_{i}-a_{i+1}+i\left(c-a_{i+1}\right)$. The integer $d$ is positive since $a_{i}-a_{i+1} \geq 1$ and $c-a_{i+1} \geq 0$. + +On the other hand $S \leq(1+2+\cdots+n) M$ as $a_{i} \leq M$ for all $i=1, \ldots, n$. Since $S$ increases by at least 1 at each step and never exceeds the constant $(1+2+\cdots+n) M$, the process stops after a finite number of iterations. + +Solution 2. Like in the first solution note that the operations do not change the maximum $M$ of the initial sequence. Now consider the reverse lexicographical order for $n$-tuples of integers. We say that $\left(x_{1}, \ldots, x_{n}\right)<\left(y_{1}, \ldots, y_{n}\right)$ if $x_{n} y$ and $y \leq a \leq x$, we see that $s_{i}$ decreases by at least 1 . This concludes the proof. + +Comment. All three proofs work if $x$ and $y$ are not necessarily adjacent, and if the pair $(x, y)$ is replaced by any pair $(a, x)$, with $a$ an integer satisfying $y \leq a \leq x$. There is nothing special about the "weights" $1,2, \ldots, n$ in the definition of $S=\sum_{i=1}^{n} i a_{i}$ from the first solution. For any sequence $w_{1} 2^{k}$ we show how Ben can find a number $y \in T$ that is different from $x$. By performing this step repeatedly he can reduce $T$ to be of size $2^{k} \leq n$ and thus win. + +Since only the size $m>2^{k}$ of $T$ is relevant, assume that $T=\left\{0,1, \ldots, 2^{k}, \ldots, m-1\right\}$. Ben begins by asking repeatedly whether $x$ is $2^{k}$. If Amy answers no $k+1$ times in a row, one of these answers is truthful, and so $x \neq 2^{k}$. Otherwise Ben stops asking about $2^{k}$ at the first answer yes. He then asks, for each $i=1, \ldots, k$, if the binary representation of $x$ has a 0 in the $i$ th digit. Regardless of what the $k$ answers are, they are all inconsistent with a certain number $y \in\left\{0,1, \ldots, 2^{k}-1\right\}$. The preceding answer yes about $2^{k}$ is also inconsistent with $y$. Hence $y \neq x$. Otherwise the last $k+1$ answers are not truthful, which is impossible. + +Either way, Ben finds a number in $T$ that is different from $x$, and the claim is proven. + +b) We prove that if $1<\lambda<2$ and $n=\left\lfloor(2-\lambda) \lambda^{k+1}\right\rfloor-1$ then Ben cannot guarantee a win. To complete the proof, then it suffices to take $\lambda$ such that $1.99<\lambda<2$ and $k$ large enough so that + +$$ +n=\left\lfloor(2-\lambda) \lambda^{k+1}\right\rfloor-1 \geq 1.99^{k} +$$ + +Consider the following strategy for Amy. First she chooses $N=n+1$ and $x \in\{1,2, \ldots, n+1\}$ arbitrarily. After every answer of hers Amy determines, for each $i=1,2, \ldots, n+1$, the number $m_{i}$ of consecutive answers she has given by that point that are inconsistent with $i$. To decide on her next answer, she then uses the quantity + +$$ +\phi=\sum_{i=1}^{n+1} \lambda^{m_{i}} +$$ + +No matter what Ben's next question is, Amy chooses the answer which minimizes $\phi$. + +We claim that with this strategy $\phi$ will always stay less than $\lambda^{k+1}$. Consequently no exponent $m_{i}$ in $\phi$ will ever exceed $k$, hence Amy will never give more than $k$ consecutive answers inconsistent with some $i$. In particular this applies to the target number $x$, so she will never lie more than $k$ times in a row. Thus, given the claim, Amy's strategy is legal. Since the strategy does not depend on $x$ in any way, Ben can make no deductions about $x$, and therefore he cannot guarantee a win. + +It remains to show that $\phi<\lambda^{k+1}$ at all times. Initially each $m_{i}$ is 0 , so this condition holds in the beginning due to $1<\lambda<2$ and $n=\left\lfloor(2-\lambda) \lambda^{k+1}\right\rfloor-1$. Suppose that $\phi<\lambda^{k+1}$ at some point, and Ben has just asked if $x \in S$ for some set $S$. According as Amy answers yes or no, the new value of $\phi$ becomes + +$$ +\phi_{1}=\sum_{i \in S} 1+\sum_{i \notin S} \lambda^{m_{i}+1} \quad \text { or } \quad \phi_{2}=\sum_{i \in S} \lambda^{m_{i}+1}+\sum_{i \notin S} 1 +$$ + +Since Amy chooses the option minimizing $\phi$, the new $\phi$ will equal $\min \left(\phi_{1}, \phi_{2}\right)$. Now we have + +$$ +\min \left(\phi_{1}, \phi_{2}\right) \leq \frac{1}{2}\left(\phi_{1}+\phi_{2}\right)=\frac{1}{2}\left(\sum_{i \in S}\left(1+\lambda^{m_{i}+1}\right)+\sum_{i \notin S}\left(\lambda^{m_{i}+1}+1\right)\right)=\frac{1}{2}(\lambda \phi+n+1) +$$ + +Because $\phi<\lambda^{k+1}$, the assumptions $\lambda<2$ and $n=\left\lfloor(2-\lambda) \lambda^{k+1}\right\rfloor-1$ lead to + +$$ +\min \left(\phi_{1}, \phi_{2}\right)<\frac{1}{2}\left(\lambda^{k+2}+(2-\lambda) \lambda^{k+1}\right)=\lambda^{k+1} +$$ + +The claim follows, which completes the solution. + +Comment. Given a fixed $k$, let $f(k)$ denote the minimum value of $n$ for which Ben can guarantee a victory. The problem asks for a proof that for large $k$ + +$$ +1.99^{k} \leq f(k) \leq 2^{k} +$$ + +A computer search shows that $f(k)=2,3,4,7,11,17$ for $k=1,2,3,4,5,6$. + +C7. There are given $2^{500}$ points on a circle labeled $1,2, \ldots, 2^{500}$ in some order. Prove that one can choose 100 pairwise disjoint chords joining some of these points so that the 100 sums of the pairs of numbers at the endpoints of the chosen chords are equal. + +Solution. The proof is based on the following general fact. + +Lemma. In a graph $G$ each vertex $v$ has degree $d_{v}$. Then $G$ contains an independent set $S$ of vertices such that $|S| \geq f(G)$ where + +$$ +f(G)=\sum_{v \in G} \frac{1}{d_{v}+1} +$$ + +Proof. Induction on $n=|G|$. The base $n=1$ is clear. For the inductive step choose a vertex $v_{0}$ in $G$ of minimum degree $d$. Delete $v_{0}$ and all of its neighbors $v_{1}, \ldots, v_{d}$ and also all edges with endpoints $v_{0}, v_{1}, \ldots, v_{d}$. This gives a new graph $G^{\prime}$. By the inductive assumption $G^{\prime}$ contains an independent set $S^{\prime}$ of vertices such that $\left|S^{\prime}\right| \geq f\left(G^{\prime}\right)$. Since no vertex in $S^{\prime}$ is a neighbor of $v_{0}$ in $G$, the set $S=S^{\prime} \cup\left\{v_{0}\right\}$ is independent in $G$. + +Let $d_{v}^{\prime}$ be the degree of a vertex $v$ in $G^{\prime}$. Clearly $d_{v}^{\prime} \leq d_{v}$ for every such vertex $v$, and also $d_{v_{i}} \geq d$ for all $i=0,1, \ldots, d$ by the minimal choice of $v_{0}$. Therefore + +$$ +f\left(G^{\prime}\right)=\sum_{v \in G^{\prime}} \frac{1}{d_{v}^{\prime}+1} \geq \sum_{v \in G^{\prime}} \frac{1}{d_{v}+1}=f(G)-\sum_{i=0}^{d} \frac{1}{d_{v_{i}}+1} \geq f(G)-\frac{d+1}{d+1}=f(G)-1 . +$$ + +Hence $|S|=\left|S^{\prime}\right|+1 \geq f\left(G^{\prime}\right)+1 \geq f(G)$, and the induction is complete. + +We pass on to our problem. For clarity denote $n=2^{499}$ and draw all chords determined by the given $2 n$ points. Color each chord with one of the colors $3,4, \ldots, 4 n-1$ according to the sum of the numbers at its endpoints. Chords with a common endpoint have different colors. For each color $c$ consider the following graph $G_{c}$. Its vertices are the chords of color $c$, and two chords are neighbors in $G_{c}$ if they intersect. Let $f\left(G_{c}\right)$ have the same meaning as in the lemma for all graphs $G_{c}$. + +Every chord $\ell$ divides the circle into two arcs, and one of them contains $m(\ell) \leq n-1$ given points. (In particular $m(\ell)=0$ if $\ell$ joins two consecutive points.) For each $i=0,1, \ldots, n-2$ there are $2 n$ chords $\ell$ with $m(\ell)=i$. Such a chord has degree at most $i$ in the respective graph. Indeed let $A_{1}, \ldots, A_{i}$ be all points on either arc determined by a chord $\ell$ with $m(\ell)=i$ and color $c$. Every $A_{j}$ is an endpoint of at most 1 chord colored $c, j=1, \ldots, i$. Hence at most $i$ chords of color $c$ intersect $\ell$. + +It follows that for each $i=0,1, \ldots, n-2$ the $2 n$ chords $\ell$ with $m(\ell)=i$ contribute at least $\frac{2 n}{i+1}$ to the sum $\sum_{c} f\left(G_{c}\right)$. Summation over $i=0,1, \ldots, n-2$ gives + +$$ +\sum_{c} f\left(G_{c}\right) \geq 2 n \sum_{i=1}^{n-1} \frac{1}{i} +$$ + +Because there are $4 n-3$ colors in all, averaging yields a color $c$ such that + +$$ +f\left(G_{c}\right) \geq \frac{2 n}{4 n-3} \sum_{i=1}^{n-1} \frac{1}{i}>\frac{1}{2} \sum_{i=1}^{n-1} \frac{1}{i} +$$ + +By the lemma there are at least $\frac{1}{2} \sum_{i=1}^{n-1} \frac{1}{i}$ pairwise disjoint chords of color $c$, i. e. with the same sum $c$ of the pairs of numbers at their endpoints. It remains to show that $\frac{1}{2} \sum_{i=1}^{n-1} \frac{1}{i} \geq 100$ for $n=2^{499}$. Indeed we have + +$$ +\sum_{i=1}^{n-1} \frac{1}{i}>\sum_{i=1}^{2^{400}} \frac{1}{i}=1+\sum_{k=1}^{400} \sum_{i=2^{k-1+1}}^{2^{k}} \frac{1}{i}>1+\sum_{k=1}^{400} \frac{2^{k-1}}{2^{k}}=201>200 +$$ + +This completes the solution. + +## Geometry + +G1. In the triangle $A B C$ the point $J$ is the center of the excircle opposite to $A$. This excircle is tangent to the side $B C$ at $M$, and to the lines $A B$ and $A C$ at $K$ and $L$ respectively. The lines $L M$ and $B J$ meet at $F$, and the lines $K M$ and $C J$ meet at $G$. Let $S$ be the point of intersection of the lines $A F$ and $B C$, and let $T$ be the point of intersection of the lines $A G$ and $B C$. Prove that $M$ is the midpoint of $S T$. + +Solution. Let $\alpha=\angle C A B, \beta=\angle A B C$ and $\gamma=\angle B C A$. The line $A J$ is the bisector of $\angle C A B$, so $\angle J A K=\angle J A L=\frac{\alpha}{2}$. By $\angle A K J=\angle A L J=90^{\circ}$ the points $K$ and $L$ lie on the circle $\omega$ with diameter $A J$. + +The triangle $K B M$ is isosceles as $B K$ and $B M$ are tangents to the excircle. Since $B J$ is the bisector of $\angle K B M$, we have $\angle M B J=90^{\circ}-\frac{\beta}{2}$ and $\angle B M K=\frac{\beta}{2}$. Likewise $\angle M C J=90^{\circ}-\frac{\gamma}{2}$ and $\angle C M L=\frac{\gamma}{2}$. Also $\angle B M F=\angle C M L$, therefore + +$$ +\angle L F J=\angle M B J-\angle B M F=\left(90^{\circ}-\frac{\beta}{2}\right)-\frac{\gamma}{2}=\frac{\alpha}{2}=\angle L A J . +$$ + +Hence $F$ lies on the circle $\omega$. (By the angle computation, $F$ and $A$ are on the same side of $B C$.) Analogously, $G$ also lies on $\omega$. Since $A J$ is a diameter of $\omega$, we obtain $\angle A F J=\angle A G J=90^{\circ}$. + + + +The lines $A B$ and $B C$ are symmetric with respect to the external bisector $B F$. Because $A F \perp B F$ and $K M \perp B F$, the segments $S M$ and $A K$ are symmetric with respect to $B F$, hence $S M=A K$. By symmetry $T M=A L$. Since $A K$ and $A L$ are equal as tangents to the excircle, it follows that $S M=T M$, and the proof is complete. + +Comment. After discovering the circle $A F K J L G$, there are many other ways to complete the solution. For instance, from the cyclic quadrilaterals $J M F S$ and $J M G T$ one can find $\angle T S J=\angle S T J=\frac{\alpha}{2}$. Another possibility is to use the fact that the lines $A S$ and $G M$ are parallel (both are perpendicular to the external angle bisector $B J$ ), so $\frac{M S}{M T}=\frac{A G}{G T}=1$. + +G2. Let $A B C D$ be a cyclic quadrilateral whose diagonals $A C$ and $B D$ meet at $E$. The extensions of the sides $A D$ and $B C$ beyond $A$ and $B$ meet at $F$. Let $G$ be the point such that $E C G D$ is a parallelogram, and let $H$ be the image of $E$ under reflection in $A D$. Prove that $D, H, F, G$ are concyclic. + +Solution. We show first that the triangles $F D G$ and $F B E$ are similar. Since $A B C D$ is cyclic, the triangles $E A B$ and $E D C$ are similar, as well as $F A B$ and $F C D$. The parallelogram $E C G D$ yields $G D=E C$ and $\angle C D G=\angle D C E$; also $\angle D C E=\angle D C A=\angle D B A$ by inscribed angles. Therefore + +$$ +\begin{gathered} +\angle F D G=\angle F D C+\angle C D G=\angle F B A+\angle A B D=\angle F B E, \\ +\frac{G D}{E B}=\frac{C E}{E B}=\frac{C D}{A B}=\frac{F D}{F B} . +\end{gathered} +$$ + +It follows that $F D G$ and $F B E$ are similar, and so $\angle F G D=\angle F E B$. + + + +Since $H$ is the reflection of $E$ with respect to $F D$, we conclude that + +$$ +\angle F H D=\angle F E D=180^{\circ}-\angle F E B=180^{\circ}-\angle F G D . +$$ + +This proves that $D, H, F, G$ are concyclic. + +Comment. Points $E$ and $G$ are always in the half-plane determined by the line $F D$ that contains $B$ and $C$, but $H$ is always in the other half-plane. In particular, $D H F G$ is cyclic if and only if $\angle F H D+\angle F G D=180^{\circ}$. + +G3. In an acute triangle $A B C$ the points $D, E$ and $F$ are the feet of the altitudes through $A$, $B$ and $C$ respectively. The incenters of the triangles $A E F$ and $B D F$ are $I_{1}$ and $I_{2}$ respectively; the circumcenters of the triangles $A C I_{1}$ and $B C I_{2}$ are $O_{1}$ and $O_{2}$ respectively. Prove that $I_{1} I_{2}$ and $O_{1} O_{2}$ are parallel. + +Solution. Let $\angle C A B=\alpha, \angle A B C=\beta, \angle B C A=\gamma$. We start by showing that $A, B, I_{1}$ and $I_{2}$ are concyclic. Since $A I_{1}$ and $B I_{2}$ bisect $\angle C A B$ and $\angle A B C$, their extensions beyond $I_{1}$ and $I_{2}$ meet at the incenter $I$ of the triangle. The points $E$ and $F$ are on the circle with diameter $B C$, so $\angle A E F=\angle A B C$ and $\angle A F E=\angle A C B$. Hence the triangles $A E F$ and $A B C$ are similar with ratio of similitude $\frac{A E}{A B}=\cos \alpha$. Because $I_{1}$ and $I$ are their incenters, we obtain $I_{1} A=I A \cos \alpha$ and $I I_{1}=I A-I_{1} A=2 I A \sin ^{2} \frac{\alpha}{2}$. By symmetry $I I_{2}=2 I B \sin ^{2} \frac{\beta}{2}$. The law of sines in the triangle $A B I$ gives $I A \sin \frac{\alpha}{2}=I B \sin \frac{\beta}{2}$. Hence + +$$ +I I_{1} \cdot I A=2\left(I A \sin \frac{\alpha}{2}\right)^{2}=2\left(I B \sin \frac{\beta}{2}\right)^{2}=I I_{2} \cdot I B +$$ + +Therefore $A, B, I_{1}$ and $I_{2}$ are concyclic, as claimed. + + + +In addition $I I_{1} \cdot I A=I I_{2} \cdot I B$ implies that $I$ has the same power with respect to the circles $\left(A C I_{1}\right),\left(B C I_{2}\right)$ and $\left(A B I_{1} I_{2}\right)$. Then $C I$ is the radical axis of $\left(A C I_{1}\right)$ and $\left(B C I_{2}\right)$; in particular $C I$ is perpendicular to the line of centers $O_{1} O_{2}$. + +Now it suffices to prove that $C I \perp I_{1} I_{2}$. Let $C I$ meet $I_{1} I_{2}$ at $Q$, then it is enough to check that $\angle I I_{1} Q+\angle I_{1} I Q=90^{\circ}$. Since $\angle I_{1} I Q$ is external for the triangle $A C I$, we have + +$$ +\angle I I_{1} Q+\angle I_{1} I Q=\angle I I_{1} Q+(\angle A C I+\angle C A I)=\angle I I_{1} I_{2}+\angle A C I+\angle C A I . +$$ + +It remains to note that $\angle I I_{1} I_{2}=\frac{\beta}{2}$ from the cyclic quadrilateral $A B I_{1} I_{2}$, and $\angle A C I=\frac{\gamma}{2}$, $\angle C A I=\frac{\alpha}{2}$. Therefore $\angle I I_{1} Q+\angle I_{1} I Q=\frac{\alpha}{2}+\frac{\beta}{2}+\frac{\gamma}{2}=90^{\circ}$, completing the proof. + +Comment. It follows from the first part of the solution that the common point $I_{3} \neq C$ of the circles $\left(A C I_{1}\right)$ and $\left(B C I_{2}\right)$ is the incenter of the triangle $C D E$. + +G4. Let $A B C$ be a triangle with $A B \neq A C$ and circumcenter $O$. The bisector of $\angle B A C$ intersects $B C$ at $D$. Let $E$ be the reflection of $D$ with respect to the midpoint of $B C$. The lines through $D$ and $E$ perpendicular to $B C$ intersect the lines $A O$ and $A D$ at $X$ and $Y$ respectively. Prove that the quadrilateral $B X C Y$ is cyclic. + +Solution. The bisector of $\angle B A C$ and the perpendicular bisector of $B C$ meet at $P$, the midpoint of the minor arc $\widehat{B C}$ (they are different lines as $A B \neq A C$ ). In particular $O P$ is perpendicular to $B C$ and intersects it at $M$, the midpoint of $B C$. + +Denote by $Y^{\prime}$ the reflexion of $Y$ with respect to $O P$. Since $\angle B Y C=\angle B Y^{\prime} C$, it suffices to prove that $B X C Y^{\prime}$ is cyclic. + + + +We have + +$$ +\angle X A P=\angle O P A=\angle E Y P \text {. } +$$ + +The first equality holds because $O A=O P$, and the second one because $E Y$ and $O P$ are both perpendicular to $B C$ and hence parallel. But $\left\{Y, Y^{\prime}\right\}$ and $\{E, D\}$ are pairs of symmetric points with respect to $O P$, it follows that $\angle E Y P=\angle D Y^{\prime} P$ and hence + +$$ +\angle X A P=\angle D Y^{\prime} P=\angle X Y^{\prime} P . +$$ + +The last equation implies that $X A Y^{\prime} P$ is cyclic. By the powers of $D$ with respect to the circles $\left(X A Y^{\prime} P\right)$ and $(A B P C)$ we obtain + +$$ +X D \cdot D Y^{\prime}=A D \cdot D P=B D \cdot D C +$$ + +It follows that $B X C Y^{\prime}$ is cyclic, as desired. + +G5. Let $A B C$ be a triangle with $\angle B C A=90^{\circ}$, and let $C_{0}$ be the foot of the altitude from $C$. Choose a point $X$ in the interior of the segment $C C_{0}$, and let $K, L$ be the points on the segments $A X, B X$ for which $B K=B C$ and $A L=A C$ respectively. Denote by $M$ the intersection of $A L$ and $B K$. Show that $M K=M L$. + +Solution. Let $C^{\prime}$ be the reflection of $C$ in the line $A B$, and let $\omega_{1}$ and $\omega_{2}$ be the circles with centers $A$ and $B$, passing through $L$ and $K$ respectively. Since $A C^{\prime}=A C=A L$ and $B C^{\prime}=B C=B K$, both $\omega_{1}$ and $\omega_{2}$ pass through $C$ and $C^{\prime}$. By $\angle B C A=90^{\circ}, A C$ is tangent to $\omega_{2}$ at $C$, and $B C$ is tangent to $\omega_{1}$ at $C$. Let $K_{1} \neq K$ be the second intersection of $A X$ and $\omega_{2}$, and let $L_{1} \neq L$ be the second intersection of $B X$ and $\omega_{1}$. + + + +By the powers of $X$ with respect to $\omega_{2}$ and $\omega_{1}$, + +$$ +X K \cdot X K_{1}=X C \cdot X C^{\prime}=X L \cdot X L_{1}, +$$ + +so the points $K_{1}, L, K, L_{1}$ lie on a circle $\omega_{3}$. + +The power of $A$ with respect to $\omega_{2}$ gives + +$$ +A L^{2}=A C^{2}=A K \cdot A K_{1}, +$$ + +indicating that $A L$ is tangent to $\omega_{3}$ at $L$. Analogously, $B K$ is tangent to $\omega_{3}$ at $K$. Hence $M K$ and $M L$ are the two tangents from $M$ to $\omega_{3}$ and therefore $M K=M L$. + +G6. Let $A B C$ be a triangle with circumcenter $O$ and incenter $I$. The points $D, E$ and $F$ on the sides $B C, C A$ and $A B$ respectively are such that $B D+B F=C A$ and $C D+C E=A B$. The circumcircles of the triangles $B F D$ and $C D E$ intersect at $P \neq D$. Prove that $O P=O I$. + +Solution. By Miquel's theorem the circles $(A E F)=\omega_{A},(B F D)=\omega_{B}$ and $(C D E)=\omega_{C}$ have a common point, for arbitrary points $D, E$ and $F$ on $B C, C A$ and $A B$. So $\omega_{A}$ passes through the common point $P \neq D$ of $\omega_{B}$ and $\omega_{C}$. + +Let $\omega_{A}, \omega_{B}$ and $\omega_{C}$ meet the bisectors $A I, B I$ and $C I$ at $A \neq A^{\prime}, B \neq B^{\prime}$ and $C \neq C^{\prime}$ respectively. The key observation is that $A^{\prime}, B^{\prime}$ and $C^{\prime}$ do not depend on the particular choice of $D, E$ and $F$, provided that $B D+B F=C A, C D+C E=A B$ and $A E+A F=B C$ hold true (the last equality follows from the other two). For a proof we need the following fact. + +Lemma. Given is an angle with vertex $A$ and measure $\alpha$. A circle $\omega$ through $A$ intersects the angle bisector at $L$ and sides of the angle at $X$ and $Y$. Then $A X+A Y=2 A L \cos \frac{\alpha}{2}$. + +Proof. Note that $L$ is the midpoint of $\operatorname{arc} \widehat{X L Y}$ in $\omega$ and set $X L=Y L=u, X Y=v$. By PtOLEMY's theorem $A X \cdot Y L+A Y \cdot X L=A L \cdot X Y$, which rewrites as $(A X+A Y) u=A L \cdot v$. Since $\angle L X Y=\frac{\alpha}{2}$ and $\angle X L Y=180^{\circ}-\alpha$, we have $v=2 \cos \frac{\alpha}{2} u$ by the law of sines, and the claim follows. + + + +Apply the lemma to $\angle B A C=\alpha$ and the circle $\omega=\omega_{A}$, which intersects $A I$ at $A^{\prime}$. This gives $2 A A^{\prime} \cos \frac{\alpha}{2}=A E+A F=B C$; by symmetry analogous relations hold for $B B^{\prime}$ and $C C^{\prime}$. It follows that $A^{\prime}, B^{\prime}$ and $C^{\prime}$ are independent of the choice of $D, E$ and $F$, as stated. + +We use the lemma two more times with $\angle B A C=\alpha$. Let $\omega$ be the circle with diameter $A I$. Then $X$ and $Y$ are the tangency points of the incircle of $A B C$ with $A B$ and $A C$, and hence $A X=A Y=\frac{1}{2}(A B+A C-B C)$. So the lemma yields $2 A I \cos \frac{\alpha}{2}=A B+A C-B C$. Next, if $\omega$ is the circumcircle of $A B C$ and $A I$ intersects $\omega$ at $M \neq A$ then $\{X, Y\}=\{B, C\}$, and so $2 A M \cos \frac{\alpha}{2}=A B+A C$ by the lemma. To summarize, + +$$ +2 A A^{\prime} \cos \frac{\alpha}{2}=B C, \quad 2 A I \cos \frac{\alpha}{2}=A B+A C-B C, \quad 2 A M \cos \frac{\alpha}{2}=A B+A C +$$ + +These equalities imply $A A^{\prime}+A I=A M$, hence the segments $A M$ and $I A^{\prime}$ have a common midpoint. It follows that $I$ and $A^{\prime}$ are equidistant from the circumcenter $O$. By symmetry $O I=O A^{\prime}=O B^{\prime}=O C^{\prime}$, so $I, A^{\prime}, B^{\prime}, C^{\prime}$ are on a circle centered at $O$. + +To prove $O P=O I$, now it suffices to show that $I, A^{\prime}, B^{\prime}, C^{\prime}$ and $P$ are concyclic. Clearly one can assume $P \neq I, A^{\prime}, B^{\prime}, C^{\prime}$. + +We use oriented angles to avoid heavy case distinction. The oriented angle between the lines $l$ and $m$ is denoted by $\angle(l, m)$. We have $\angle(l, m)=-\angle(m, l)$ and $\angle(l, m)+\angle(m, n)=\angle(l, n)$ for arbitrary lines $l, m$ and $n$. Four distinct non-collinear points $U, V, X, Y$ are concyclic if and only if $\angle(U X, V X)=\angle(U Y, V Y)$. + + + +Suppose for the moment that $A^{\prime}, B^{\prime}, P, I$ are distinct and noncollinear; then it is enough to check the equality $\angle\left(A^{\prime} P, B^{\prime} P\right)=\angle\left(A^{\prime} I, B^{\prime} I\right)$. Because $A, F, P, A^{\prime}$ are on the circle $\omega_{A}$, we have $\angle\left(A^{\prime} P, F P\right)=\angle\left(A^{\prime} A, F A\right)=\angle\left(A^{\prime} I, A B\right)$. Likewise $\angle\left(B^{\prime} P, F P\right)=\angle\left(B^{\prime} I, A B\right)$. Therefore + +$$ +\angle\left(A^{\prime} P, B^{\prime} P\right)=\angle\left(A^{\prime} P, F P\right)+\angle\left(F P, B^{\prime} P\right)=\angle\left(A^{\prime} I, A B\right)-\angle\left(B^{\prime} I, A B\right)=\angle\left(A^{\prime} I, B^{\prime} I\right) \text {. } +$$ + +Here we assumed that $P \neq F$. If $P=F$ then $P \neq D, E$ and the conclusion follows similarly (use $\angle\left(A^{\prime} F, B^{\prime} F\right)=\angle\left(A^{\prime} F, E F\right)+\angle(E F, D F)+\angle\left(D F, B^{\prime} F\right)$ and inscribed angles in $\left.\omega_{A}, \omega_{B}, \omega_{C}\right)$. + +There is no loss of generality in assuming $A^{\prime}, B^{\prime}, P, I$ distinct and noncollinear. If $A B C$ is an equilateral triangle then the equalities $\left(^{*}\right)$ imply that $A^{\prime}, B^{\prime}, C^{\prime}, I, O$ and $P$ coincide, so $O P=O I$. Otherwise at most one of $A^{\prime}, B^{\prime}, C^{\prime}$ coincides with $I$. If say $C^{\prime}=I$ then $O I \perp C I$ by the previous reasoning. It follows that $A^{\prime}, B^{\prime} \neq I$ and hence $A^{\prime} \neq B^{\prime}$. Finally $A^{\prime}, B^{\prime}$ and $I$ are noncollinear because $I, A^{\prime}, B^{\prime}, C^{\prime}$ are concyclic. + +Comment. The proposer remarks that the locus $\gamma$ of the points $P$ is an arc of the circle $\left(A^{\prime} B^{\prime} C^{\prime} I\right)$. The reflection $I^{\prime}$ of $I$ in $O$ belongs to $\gamma$; it is obtained by choosing $D, E$ and $F$ to be the tangency points of the three excircles with their respective sides. The rest of the circle $\left(A^{\prime} B^{\prime} C^{\prime} I\right)$, except $I$, can be included in $\gamma$ by letting $D, E$ and $F$ vary on the extensions of the sides and assuming signed lengths. For instance if $B$ is between $C$ and $D$ then the length $B D$ must be taken with a negative sign. The incenter $I$ corresponds to the limit case where $D$ tends to infinity. + +G7. Let $A B C D$ be a convex quadrilateral with non-parallel sides $B C$ and $A D$. Assume that there is a point $E$ on the side $B C$ such that the quadrilaterals $A B E D$ and $A E C D$ are circumscribed. Prove that there is a point $F$ on the side $A D$ such that the quadrilaterals $A B C F$ and $B C D F$ are circumscribed if and only if $A B$ is parallel to $C D$. + +Solution. Let $\omega_{1}$ and $\omega_{2}$ be the incircles and $O_{1}$ and $O_{2}$ the incenters of the quadrilaterals $A B E D$ and $A E C D$ respectively. A point $F$ with the stated property exists only if $\omega_{1}$ and $\omega_{2}$ are also the incircles of the quadrilaterals $A B C F$ and $B C D F$. + + + +Let the tangents from $B$ to $\omega_{2}$ and from $C$ to $\omega_{1}$ (other than $B C$ ) meet $A D$ at $F_{1}$ and $F_{2}$ respectively. We need to prove that $F_{1}=F_{2}$ if and only if $A B \| C D$. + +Lemma. The circles $\omega_{1}$ and $\omega_{2}$ with centers $O_{1}$ and $O_{2}$ are inscribed in an angle with vertex $O$. The points $P, S$ on one side of the angle and $Q, R$ on the other side are such that $\omega_{1}$ is the incircle of the triangle $P Q O$, and $\omega_{2}$ is the excircle of the triangle $R S O$ opposite to $O$. Denote $p=O O_{1} \cdot O O_{2}$. Then exactly one of the following relations holds: + +$$ +O P \cdot O R p>O Q \cdot O S, \quad O P \cdot O R=p=O Q \cdot O S +$$ + +Proof. Denote $\angle O P O_{1}=u, \angle O Q O_{1}=v, \angle O O_{2} R=x, \angle O O_{2} S=y, \angle P O Q=2 \varphi$. Because $P O_{1}, Q O_{1}, R O_{2}, S O_{2}$ are internal or external bisectors in the triangles $P Q O$ and $R S O$, we have + +$$ +u+v=x+y\left(=90^{\circ}-\varphi\right) . +$$ + +By the law of sines + + + +$$ +\frac{O P}{O O_{1}}=\frac{\sin (u+\varphi)}{\sin u} \quad \text { and } \quad \frac{O O_{2}}{O R}=\frac{\sin (x+\varphi)}{\sin x} +$$ + +Therefore, since $x, u$ and $\varphi$ are acute, + +$O P \cdot O R \geq p \Leftrightarrow \frac{O P}{O O_{1}} \geq \frac{O O_{2}}{O R} \Leftrightarrow \sin x \sin (u+\varphi) \geq \sin u \sin (x+\varphi) \Leftrightarrow \sin (x-u) \geq 0 \Leftrightarrow x \geq u$. + +Thus $O P \cdot O R \geq p$ is equivalent to $x \geq u$, with $O P \cdot O R=p$ if and only if $x=u$. + +Analogously, $p \geq O Q \cdot O S$ is equivalent to $v \geq y$, with $p=O Q \cdot O S$ if and only if $v=y$. On the other hand $x \geq u$ and $v \geq y$ are equivalent by (1), with $x=u$ if and only if $v=y$. The conclusion of the lemma follows from here. + +Going back to the problem, apply the lemma to the quadruples $\left\{B, E, D, F_{1}\right\},\{A, B, C, D\}$ and $\left\{A, E, C, F_{2}\right\}$. Assuming $O E \cdot O F_{1}>p$, we obtain + +$$ +O E \cdot O F_{1}>p \Rightarrow O B \cdot O D
p \Rightarrow O E \cdot O F_{2}
p$ implies + +$$ +O B \cdot O D
p>O E \cdot O F_{2} \text {. } +$$ + +Similarly, $O E \cdot O F_{1}
p>O A \cdot O C \text { and } O E \cdot O F_{1}
s>O^{\prime \prime} Q+O^{\prime} S, \quad O^{\prime} P+O^{\prime \prime} R=s=O^{\prime \prime} Q+O^{\prime} S . +$$ + + + +Once this is established, the proof of the original statement for $B C \| A D$ is analogous to the one in the intersecting case. One replaces products by sums of relevant segments. + +G8. Let $A B C$ be a triangle with circumcircle $\omega$ and $\ell$ a line without common points with $\omega$. Denote by $P$ the foot of the perpendicular from the center of $\omega$ to $\ell$. The side-lines $B C, C A, A B$ intersect $\ell$ at the points $X, Y, Z$ different from $P$. Prove that the circumcircles of the triangles $A X P, B Y P$ and $C Z P$ have a common point different from $P$ or are mutually tangent at $P$. + +Solution 1. Let $\omega_{A}, \omega_{B}, \omega_{C}$ and $\omega$ be the circumcircles of triangles $A X P, B Y P, C Z P$ and $A B C$ respectively. The strategy of the proof is to construct a point $Q$ with the same power with respect to the four circles. Then each of $P$ and $Q$ has the same power with respect to $\omega_{A}, \omega_{B}, \omega_{C}$ and hence the three circles are coaxial. In other words they have another common point $P^{\prime}$ or the three of them are tangent at $P$. + +We first give a description of the point $Q$. Let $A^{\prime} \neq A$ be the second intersection of $\omega$ and $\omega_{A}$; define $B^{\prime}$ and $C^{\prime}$ analogously. We claim that $A A^{\prime}, B B^{\prime}$ and $C C^{\prime}$ have a common point. Once this claim is established, the point just constructed will be on the radical axes of the three pairs of circles $\left\{\omega, \omega_{A}\right\},\left\{\omega, \omega_{B}\right\},\left\{\omega, \omega_{C}\right\}$. Hence it will have the same power with respect to $\omega, \omega_{A}, \omega_{B}, \omega_{C}$. + + + +We proceed to prove that $A A^{\prime}, B B^{\prime}$ and $C C^{\prime}$ intersect at one point. Let $r$ be the circumradius of triangle $A B C$. Define the points $X^{\prime}, Y^{\prime}, Z^{\prime}$ as the intersections of $A A^{\prime}, B B^{\prime}, C C^{\prime}$ with $\ell$. Observe that $X^{\prime}, Y^{\prime}, Z^{\prime}$ do exist. If $A A^{\prime}$ is parallel to $\ell$ then $\omega_{A}$ is tangent to $\ell$; hence $X=P$ which is a contradiction. Similarly, $B B^{\prime}$ and $C C^{\prime}$ are not parallel to $\ell$. + +From the powers of the point $X^{\prime}$ with respect to the circles $\omega_{A}$ and $\omega$ we get + +$$ +X^{\prime} P \cdot\left(X^{\prime} P+P X\right)=X^{\prime} P \cdot X^{\prime} X=X^{\prime} A^{\prime} \cdot X^{\prime} A=X^{\prime} O^{2}-r^{2} +$$ + +hence + +$$ +X^{\prime} P \cdot P X=X^{\prime} O^{2}-r^{2}-X^{\prime} P^{2}=O P^{2}-r^{2} . +$$ + +We argue analogously for the points $Y^{\prime}$ and $Z^{\prime}$, obtaining + +$$ +X^{\prime} P \cdot P X=Y^{\prime} P \cdot P Y=Z^{\prime} P \cdot P Z=O P^{2}-r^{2}=k^{2} +$$ + +In these computations all segments are regarded as directed segments. We keep the same convention for the sequel. + +We prove that the lines $A A^{\prime}, B B^{\prime}, C C^{\prime}$ intersect at one point by CEVA's theorem. To avoid distracting remarks we interpret everything projectively, i. e. whenever two lines are parallel they meet at a point on the line at infinity. + +Let $U, V, W$ be the intersections of $A A^{\prime}, B B^{\prime}, C C^{\prime}$ with $B C, C A, A B$ respectively. The idea is that although it is difficult to calculate the ratio $\frac{B U}{C U}$, it is easier to deal with the cross-ratio $\frac{B U}{C U} / \frac{B X}{C X}$ because we can send it to the line $\ell$. With this in mind we apply MEnELaus' theorem to the triangle $A B C$ and obtain $\frac{B X}{C X} \cdot \frac{C Y}{A Y} \cdot \frac{A Z}{B Z}=1$. Hence Ceva's ratio can be expressed as + +$$ +\frac{B U}{C U} \cdot \frac{C V}{A V} \cdot \frac{A W}{B W}=\frac{B U}{C U} / \frac{B X}{C X} \cdot \frac{C V}{A V} / \frac{C Y}{A Y} \cdot \frac{A W}{B W} / \frac{A Z}{B Z} +$$ + + + +Project the line $B C$ to $\ell$ from $A$. The cross-ratio between $B C$ and $U X$ equals the cross-ratio between $Z Y$ and $X^{\prime} X$. Repeating the same argument with the lines $C A$ and $A B$ gives + +$$ +\frac{B U}{C U} \cdot \frac{C V}{A V} \cdot \frac{A W}{B W}=\frac{Z X^{\prime}}{Y X^{\prime}} / \frac{Z X}{Y X} \cdot \frac{X Y^{\prime}}{Z Y^{\prime}} / \frac{X Y}{Z Y} \cdot \frac{Y Z^{\prime}}{X Z^{\prime}} / \frac{Y Z}{X Z} +$$ + +and hence + +$$ +\frac{B U}{C U} \cdot \frac{C V}{A V} \cdot \frac{A W}{B W}=(-1) \cdot \frac{Z X^{\prime}}{Y X^{\prime}} \cdot \frac{X Y^{\prime}}{Z Y^{\prime}} \cdot \frac{Y Z^{\prime}}{X Z^{\prime}} +$$ + +The equations (1) reduce the problem to a straightforward computation on the line $\ell$. For instance, the transformation $t \mapsto-k^{2} / t$ preserves cross-ratio and interchanges the points $X, Y, Z$ with the points $X^{\prime}, Y^{\prime}, Z^{\prime}$. Then + +$$ +\frac{B U}{C U} \cdot \frac{C V}{A V} \cdot \frac{A W}{B W}=(-1) \cdot \frac{Z X^{\prime}}{Y X^{\prime}} / \frac{Z Z^{\prime}}{Y Z^{\prime}} \cdot \frac{X Y^{\prime}}{Z Y^{\prime}} / \frac{X Z^{\prime}}{Z Z^{\prime}}=-1 +$$ + +We proved that CEvA's ratio equals -1 , so $A A^{\prime}, B B^{\prime}, C C^{\prime}$ intersect at one point $Q$. + +Comment 1. There is a nice projective argument to prove that $A X^{\prime}, B Y^{\prime}, C Z^{\prime}$ intersect at one point. Suppose that $\ell$ and $\omega$ intersect at a pair of complex conjugate points $D$ and $E$. Consider a projective transformation that takes $D$ and $E$ to $[i ; 1,0]$ and $[-i, 1,0]$. Then $\ell$ is the line at infinity, and $\omega$ is a conic through the special points $[i ; 1,0]$ and $[-i, 1,0]$, hence it is a circle. So one can assume that $A X, B Y, C Z$ are parallel to $B C, C A, A B$. The involution on $\ell$ taking $X, Y, Z$ to $X^{\prime}, Y^{\prime}, Z^{\prime}$ and leaving $D, E$ fixed is the involution changing each direction to its perpendicular one. Hence $A X, B Y, C Z$ are also perpendicular to $A X^{\prime}, B Y^{\prime}, C Z^{\prime}$. + +It follows from the above that $A X^{\prime}, B Y^{\prime}, C Z^{\prime}$ intersect at the orthocenter of triangle $A B C$. + +Comment 2. The restriction that the line $\ell$ does not intersect the circumcricle $\omega$ is unnecessary. The proof above works in general. In case $\ell$ intersects $\omega$ at $D$ and $E$ point $P$ is the midpoint of $D E$, and some equations can be interpreted differently. For instance + +$$ +X^{\prime} P \cdot X^{\prime} X=X^{\prime} A^{\prime} \cdot X^{\prime} A=X^{\prime} D \cdot X^{\prime} E +$$ + +and hence the pairs $X^{\prime} X$ and $D E$ are harmonic conjugates. This means that $X^{\prime}, Y^{\prime}, Z^{\prime}$ are the harmonic conjugates of $X, Y, Z$ with respect to the segment $D E$. + +Solution 2. First we prove that there is an inversion in space that takes $\ell$ and $\omega$ to parallel circles on a sphere. Let $Q R$ be the diameter of $\omega$ whose extension beyond $Q$ passes through $P$. Let $\Pi$ be the plane carrying our objects. In space, choose a point $O$ such that the line $Q O$ is perpendicular to $\Pi$ and $\angle P O R=90^{\circ}$, and apply an inversion with pole $O$ (the radius of the inversion does not matter). For any object $\mathcal{T}$ denote by $\mathcal{T}^{\prime}$ the image of $\mathcal{T}$ under this inversion. + +The inversion takes the plane $\Pi$ to a sphere $\Pi^{\prime}$. The lines in $\Pi$ are taken to circles through $O$, and the circles in $\Pi$ also are taken to circles on $\Pi^{\prime}$. + + + +Since the line $\ell$ and the circle $\omega$ are perpendicular to the plane $O P Q$, the circles $\ell^{\prime}$ and $\omega^{\prime}$ also are perpendicular to this plane. Hence, the planes of the circles $\ell^{\prime}$ and $\omega^{\prime}$ are parallel. + +Now consider the circles $A^{\prime} X^{\prime} P^{\prime}, B^{\prime} Y^{\prime} P^{\prime}$ and $C^{\prime} Z^{\prime} P^{\prime}$. We want to prove that either they have a common point (on $\Pi^{\prime}$ ), different from $P^{\prime}$, or they are tangent to each other. + + + +The point $X^{\prime}$ is the second intersection of the circles $B^{\prime} C^{\prime} O$ and $\ell^{\prime}$, other than $O$. Hence, the lines $O X^{\prime}$ and $B^{\prime} C^{\prime}$ are coplanar. Moreover, they lie in the parallel planes of $\ell^{\prime}$ and $\omega^{\prime}$. Therefore, $O X^{\prime}$ and $B^{\prime} C^{\prime}$ are parallel. Analogously, $O Y^{\prime}$ and $O Z^{\prime}$ are parallel to $A^{\prime} C^{\prime}$ and $A^{\prime} B^{\prime}$. + +Let $A_{1}$ be the second intersection of the circles $A^{\prime} X^{\prime} P^{\prime}$ and $\omega^{\prime}$, other than $A^{\prime}$. The segments $A^{\prime} A_{1}$ and $P^{\prime} X^{\prime}$ are coplanar, and therefore parallel. Now we know that $B^{\prime} C^{\prime}$ and $A^{\prime} A_{1}$ are parallel to $O X^{\prime}$ and $X^{\prime} P^{\prime}$ respectively, but these two segments are perpendicular because $O P^{\prime}$ is a diameter in $\ell^{\prime}$. We found that $A^{\prime} A_{1}$ and $B^{\prime} C^{\prime}$ are perpendicular, hence $A^{\prime} A_{1}$ is the altitude in the triangle $A^{\prime} B^{\prime} C^{\prime}$, starting from $A$. + +Analogously, let $B_{1}$ and $C_{1}$ be the second intersections of $\omega^{\prime}$ with the circles $B^{\prime} P^{\prime} Y^{\prime}$ and $C^{\prime} P^{\prime} Z^{\prime}$, other than $B^{\prime}$ and $C^{\prime}$ respectively. Then $B^{\prime} B_{1}$ and $C^{\prime} C_{1}$ are the other two altitudes in the triangle $A^{\prime} B^{\prime} C^{\prime}$. + +Let $H$ be the orthocenter of the triangle $A^{\prime} B^{\prime} C^{\prime}$. Let $W$ be the second intersection of the line $P^{\prime} H$ with the sphere $\Pi^{\prime}$, other than $P^{\prime}$. The point $W$ lies on the sphere $\Pi^{\prime}$, in the plane of the circle $A^{\prime} P^{\prime} X^{\prime}$, so $W$ lies on the circle $A^{\prime} P^{\prime} X^{\prime}$. Similarly, $W$ lies on the circles $B^{\prime} P^{\prime} Y^{\prime}$ and $C^{\prime} P^{\prime} Z^{\prime}$ as well; indeed $W$ is the second common point of the three circles. + +If the line $P^{\prime} H$ is tangent to the sphere then $W$ coincides with $P^{\prime}$, and $P^{\prime} H$ is the common tangent of the three circles. + +## Number Theory + +N1. Call admissible a set $A$ of integers that has the following property: + +$$ +\text { If } x, y \in A \text { (possibly } x=y \text { ) then } x^{2}+k x y+y^{2} \in A \text { for every integer } k \text {. } +$$ + +Determine all pairs $m, n$ of nonzero integers such that the only admissible set containing both $m$ and $n$ is the set of all integers. + +Solution. A pair of integers $m, n$ fulfills the condition if and only if $\operatorname{gcd}(m, n)=1$. Suppose that $\operatorname{gcd}(m, n)=d>1$. The set + +$$ +A=\{\ldots,-2 d,-d, 0, d, 2 d, \ldots\} +$$ + +is admissible, because if $d$ divides $x$ and $y$ then it divides $x^{2}+k x y+y^{2}$ for every integer $k$. Also $m, n \in A$ and $A \neq \mathbb{Z}$. + +Now let $\operatorname{gcd}(m, n)=1$, and let $A$ be an admissible set containing $m$ and $n$. We use the following observations to prove that $A=\mathbb{Z}$ : + +(i) $k x^{2} \in A$ for every $x \in A$ and every integer $k$. + +(ii) $(x+y)^{2} \in A$ for all $x, y \in A$. + +To justify (i) let $y=x$ in the definition of an admissible set; to justify (ii) let $k=2$. + +Since $\operatorname{gcd}(m, n)=1$, we also have $\operatorname{gcd}\left(m^{2}, n^{2}\right)=1$. Hence one can find integers $a, b$ such that $a m^{2}+b n^{2}=1$. It follows from (i) that $a m^{2} \in A$ and $b n^{2} \in A$. Now we deduce from (ii) that $1=\left(a m^{2}+b n^{2}\right)^{2} \in A$. But if $1 \in A$ then (i) implies $k \in A$ for every integer $k$. + +N2. Find all triples $(x, y, z)$ of positive integers such that $x \leq y \leq z$ and + +$$ +x^{3}\left(y^{3}+z^{3}\right)=2012(x y z+2) \text {. } +$$ + +Solution. First note that $x$ divides $2012 \cdot 2=2^{3} \cdot 503$. If $503 \mid x$ then the right-hand side of the equation is divisible by $503^{3}$, and it follows that $503^{2} \mid x y z+2$. This is false as $503 \mid x$. Hence $x=2^{m}$ with $m \in\{0,1,2,3\}$. If $m \geq 2$ then $2^{6} \mid 2012(x y z+2)$. However the highest powers of 2 dividing 2012 and $x y z+2=2^{m} y z+2$ are $2^{2}$ and $2^{1}$ respectively. So $x=1$ or $x=2$, yielding the two equations + +$$ +y^{3}+z^{3}=2012(y z+2), \quad \text { and } \quad y^{3}+z^{3}=503(y z+1) \text {. } +$$ + +In both cases the prime $503=3 \cdot 167+2$ divides $y^{3}+z^{3}$. We claim that $503 \mid y+z$. This is clear if $503 \mid y$, so let $503 \nmid y$ and $503 \nmid z$. Then $y^{502} \equiv z^{502}(\bmod 503)$ by FeRmat's little theorem. On the other hand $y^{3} \equiv-z^{3}(\bmod 503)$ implies $y^{3 \cdot 167} \equiv-z^{3 \cdot 167}(\bmod 503)$, i. e. $y^{501} \equiv-z^{501}(\bmod 503)$. It follows that $y \equiv-z(\bmod 503)$ as claimed. + +Therefore $y+z=503 k$ with $k \geq 1$. In view of $y^{3}+z^{3}=(y+z)\left((y-z)^{2}+y z\right)$ the two equations take the form + +$$ +\begin{aligned} +& k(y-z)^{2}+(k-4) y z=8 \\ +& k(y-z)^{2}+(k-1) y z=1 . +\end{aligned} +$$ + +In (1) we have $(k-4) y z \leq 8$, which implies $k \leq 4$. Indeed if $k>4$ then $1 \leq(k-4) y z \leq 8$, so that $y \leq 8$ and $z \leq 8$. This is impossible as $y+z=503 k \geq 503$. Note next that $y^{3}+z^{3}$ is even in the first equation. Hence $y+z=503 k$ is even too, meaning that $k$ is even. Thus $k=2$ or $k=4$. Clearly (1) has no integer solutions for $k=4$. If $k=2$ then (1) takes the form $(y+z)^{2}-5 y z=4$. Since $y+z=503 k=503 \cdot 2$, this leads to $5 y z=503^{2} \cdot 2^{2}-4$. However $503^{2} \cdot 2^{2}-4$ is not a multiple of 5 . Therefore (1) has no integer solutions. + +Equation (2) implies $0 \leq(k-1) y z \leq 1$, so that $k=1$ or $k=2$. Also $0 \leq k(y-z)^{2} \leq 1$, hence $k=2$ only if $y=z$. However then $y=z=1$, which is false in view of $y+z \geq 503$. Therefore $k=1$ and (2) takes the form $(y-z)^{2}=1$, yielding $z-y=|y-z|=1$. Combined with $k=1$ and $y+z=503 k$, this leads to $y=251, z=252$. + +In summary the triple $(2,251,252)$ is the only solution. + +N3. Determine all integers $m \geq 2$ such that every $n$ with $\frac{m}{3} \leq n \leq \frac{m}{2}$ divides the binomial coefficient $\left(\begin{array}{c}n \\ m-2 n\end{array}\right)$. + +Solution. The integers in question are all prime numbers. + +First we check that all primes satisfy the condition, and even a stronger one. Namely, if $p$ is a prime then every $n$ with $1 \leq n \leq \frac{p}{2}$ divides $\left(\begin{array}{c}n \\ p-2 n\end{array}\right)$. This is true for $p=2$ where $n=1$ is the only possibility. For an odd prime $p$ take $n \in\left[1, \frac{p}{2}\right]$ and consider the following identity of binomial coefficients: + +$$ +(p-2 n) \cdot\left(\begin{array}{c} +n \\ +p-2 n +\end{array}\right)=n \cdot\left(\begin{array}{c} +n-1 \\ +p-2 n-1 +\end{array}\right) +$$ + +Since $p \geq 2 n$ and $p$ is odd, all factors are non-zero. If $d=\operatorname{gcd}(p-2 n, n)$ then $d$ divides $p$, but $d \leq n
1$, pick $n=k$. Then $\frac{m}{3} \leq n \leq \frac{m}{2}$ but $\left(\begin{array}{c}n \\ m-2 n\end{array}\right)=\left(\begin{array}{l}k \\ 0\end{array}\right)=1$ is not divisible by $k>1$. +- If $m$ is odd then there exist an odd prime $p$ and an integer $k \geq 1$ with $m=p(2 k+1)$. Pick $n=p k$, then $\frac{m}{3} \leq n \leq \frac{m}{2}$ by $k \geq 1$. However + +$$ +\frac{1}{n}\left(\begin{array}{c} +n \\ +m-2 n +\end{array}\right)=\frac{1}{p k}\left(\begin{array}{c} +p k \\ +p +\end{array}\right)=\frac{(p k-1)(p k-2) \cdots(p k-(p-1))}{p !} +$$ + +is not an integer, because $p$ divides the denominator but not the numerator. + +N4. An integer $a$ is called friendly if the equation $\left(m^{2}+n\right)\left(n^{2}+m\right)=a(m-n)^{3}$ has a solution over the positive integers. + +a) Prove that there are at least 500 friendly integers in the set $\{1,2, \ldots, 2012\}$. + +b) Decide whether $a=2$ is friendly. + +Solution. a) Every $a$ of the form $a=4 k-3$ with $k \geq 2$ is friendly. Indeed the numbers $m=2 k-1>0$ and $n=k-1>0$ satisfy the given equation with $a=4 k-3$ : + +$$ +\left(m^{2}+n\right)\left(n^{2}+m\right)=\left((2 k-1)^{2}+(k-1)\right)\left((k-1)^{2}+(2 k-1)\right)=(4 k-3) k^{3}=a(m-n)^{3} \text {. } +$$ + +Hence $5,9, \ldots, 2009$ are friendly and so $\{1,2, \ldots, 2012\}$ contains at least 502 friendly numbers. + +b) We show that $a=2$ is not friendly. Consider the equation with $a=2$ and rewrite its left-hand side as a difference of squares: + +$$ +\frac{1}{4}\left(\left(m^{2}+n+n^{2}+m\right)^{2}-\left(m^{2}+n-n^{2}-m\right)^{2}\right)=2(m-n)^{3} +$$ + +Since $m^{2}+n-n^{2}-m=(m-n)(m+n-1)$, we can further reformulate the equation as + +$$ +\left(m^{2}+n+n^{2}+m\right)^{2}=(m-n)^{2}\left(8(m-n)+(m+n-1)^{2}\right) . +$$ + +It follows that $8(m-n)+(m+n-1)^{2}$ is a perfect square. Clearly $m>n$, hence there is an integer $s \geq 1$ such that + +$$ +(m+n-1+2 s)^{2}=8(m-n)+(m+n-1)^{2} . +$$ + +Subtracting the squares gives $s(m+n-1+s)=2(m-n)$. Since $m+n-1+s>m-n$, we conclude that $s<2$. Therefore the only possibility is $s=1$ and $m=3 n$. However then the left-hand side of the given equation (with $a=2$ ) is greater than $m^{3}=27 n^{3}$, whereas its right-hand side equals $16 n^{3}$. The contradiction proves that $a=2$ is not friendly. + +Comment. A computer search shows that there are 561 friendly numbers in $\{1,2, \ldots, 2012\}$. + +N5. For a nonnegative integer $n$ define $\operatorname{rad}(n)=1$ if $n=0$ or $n=1$, and $\operatorname{rad}(n)=p_{1} p_{2} \cdots p_{k}$ where $p_{1}
0$. + +Let $p$ be a prime number. The condition is that $f(n) \equiv 0(\bmod p)$ implies + +$$ +f\left(n^{\operatorname{rad}(n)}\right) \equiv 0 \quad(\bmod p) +$$ + +Since $\operatorname{rad}\left(n^{\operatorname{rad}(n)^{k}}\right)=\operatorname{rad}(n)$ for all $k$, repeated applications of the preceding implication show that if $p$ divides $f(n)$ then + +$$ +f\left(n^{\operatorname{rad}(n)^{k}}\right) \equiv 0 \quad(\bmod p) \quad \text { for all } k . +$$ + +The idea is to construct a prime $p$ and a positive integer $n$ such that $p-1$ divides $n$ and $p$ divides $f(n)$. In this case, for $k$ large enough $p-1$ divides $\operatorname{rad}(n)^{k}$. Hence if $(p, n)=1$ then $n^{r a d(n)^{k}} \equiv 1(\bmod p)$ by FERMAT's little theorem, so that + +$$ +f(1) \equiv f\left(n^{\operatorname{rad}(n)^{k}}\right) \equiv 0 \quad(\bmod p) . +$$ + +Suppose that $f(x)=g(x) x^{m}$ with $g(0) \neq 0$. Let $t$ be a positive integer, $p$ any prime factor of $g(-t)$ and $n=(p-1) t$. So $p-1$ divides $n$ and $f(n)=f((p-1) t) \equiv f(-t) \equiv 0(\bmod p)$, hence either $(p, n)>1$ or $(2)$ holds. If $(p,(p-1) t)>1$ then $p$ divides $t$ and $g(0) \equiv g(-t) \equiv 0(\bmod p)$, meaning that $p$ divides $g(0)$. + +In conclusion we proved that each prime factor of $g(-t)$ divides $g(0) f(1) \neq 0$, and thus the set of prime factors of $g(-t)$ when $t$ ranges through the positive integers is finite. This is known to imply that $g(x)$ is a constant polynomial, and so $f(x)=a x^{m}$. + +Solution 2. Let $f(x)$ be a polynomial with integer coefficients (not necessarily nonnegative) such that $\operatorname{rad}(f(n))$ divides $\operatorname{rad}\left(f\left(n^{\operatorname{rad}(n)}\right)\right)$ for any nonnegative integer $n$. We give a complete description of all polynomials with this property. More precisely, we claim that if $f(x)$ is such a polynomial and $\xi$ is a root of $f(x)$ then so is $\xi^{d}$ for every positive integer $d$. + +Therefore each root of $f(x)$ is zero or a root of unity. In particular, if a root of unity $\xi$ is a root of $f(x)$ then $1=\xi^{d}$ is a root too (for some positive integer $d$ ). In the original problem $f(x)$ has nonnegative coefficients. Then either $f(x)$ is the zero polynomial or $f(1)>0$ and $\xi=0$ is the only possible root. In either case $f(x)=a x^{m}$ with $a$ and $m$ nonnegative integers. + +To prove the claim let $\xi$ be a root of $f(x)$, and let $g(x)$ be an irreducible factor of $f(x)$ such that $g(\xi)=0$. If 0 or 1 are roots of $g(x)$ then either $\xi=0$ or $\xi=1$ (because $g(x)$ is irreducible) and we are done. So assume that $g(0), g(1) \neq 0$. By decomposing $d$ as a product of prime numbers, it is enough to consider the case $d=p$ prime. We argue for $p=2$. Since $\operatorname{rad}\left(2^{k}\right)=2$ for every $k$, we have + +$$ +\operatorname{rad}\left(f\left(2^{k}\right)\right) \mid \operatorname{rad}\left(f\left(2^{2 k}\right)\right) . +$$ + +Now we prove that $g(x)$ divides $f\left(x^{2}\right)$. Suppose that this is not the case. Then, since $g(x)$ is irreducible, there are integer-coefficient polynomials $a(x), b(x)$ and an integer $N$ such that + +$$ +a(x) g(x)+b(x) f\left(x^{2}\right)=N +$$ + +Each prime factor $p$ of $g\left(2^{k}\right)$ divides $f\left(2^{k}\right)$, so by $\operatorname{rad}\left(f\left(2^{k}\right)\right) \mid \operatorname{rad}\left(f\left(2^{2 k}\right)\right)$ it also divides $f\left(2^{2 k}\right)$. From the equation above with $x=2^{k}$ it follows that $p$ divides $N$. + +In summary, each prime divisor of $g\left(2^{k}\right)$ divides $N$, for all $k \geq 0$. Let $p_{1}, \ldots, p_{n}$ be the odd primes dividing $N$, and suppose that + +$$ +g(1)=2^{\alpha} p_{1}^{\alpha_{1}} \cdots p_{n}^{\alpha_{n}} +$$ + +If $k$ is divisible by $\varphi\left(p_{1}^{\alpha_{1}+1} \cdots p_{n}^{\alpha_{n}+1}\right)$ then + +$$ +2^{k} \equiv 1 \quad\left(\bmod p_{1}^{\alpha_{1}+1} \cdots p_{n}^{\alpha_{n}+1}\right) +$$ + +yielding + +$$ +g\left(2^{k}\right) \equiv g(1) \quad\left(\bmod p_{1}^{\alpha_{1}+1} \cdots p_{n}^{\alpha_{n}+1}\right) +$$ + +It follows that for each $i$ the maximal power of $p_{i}$ dividing $g\left(2^{k}\right)$ and $g(1)$ is the same, namely $p_{i}^{\alpha_{i}}$. On the other hand, for large enough $k$, the maximal power of 2 dividing $g\left(2^{k}\right)$ and $g(0) \neq 0$ is the same. From the above, for $k$ divisible by $\varphi\left(p_{1}^{\alpha_{1}+1} \cdots p_{n}^{\alpha_{n}+1}\right)$ and large enough, we obtain that $g\left(2^{k}\right)$ divides $g(0) \cdot g(1)$. This is impossible because $g(0), g(1) \neq 0$ are fixed and $g\left(2^{k}\right)$ is arbitrarily large. + +In conclusion, $g(x)$ divides $f\left(x^{2}\right)$. Recall that $\xi$ is a root of $f(x)$ such that $g(\xi)=0$; then $f\left(\xi^{2}\right)=0$, i. e. $\xi^{2}$ is a root of $f(x)$. + +Likewise if $\xi$ is a root of $f(x)$ and $p$ an arbitrary prime then $\xi^{p}$ is a root too. The argument is completely analogous, in the proof above just replace 2 by $p$ and "odd prime" by "prime different from $p . "$ + +Comment. The claim in the second solution can be proved by varying $n(\bmod p)$ in $(1)$. For instance, we obtain + +$$ +f\left(n^{\operatorname{rad}(n+p k)}\right) \equiv 0 \quad(\bmod p) +$$ + +for every positive integer $k$. One can prove that if $(n, p)=1$ then $\operatorname{rad}(n+p k)$ runs through all residue classes $r(\bmod p-1)$ with $(r, p-1)$ squarefree. Hence if $f(n) \equiv 0(\bmod p)$ then $f\left(n^{r}\right) \equiv 0(\bmod p)$ for all integers $r$. This implies the claim by an argument leading to the identity (3). + +N6. Let $x$ and $y$ be positive integers. If $x^{2^{n}}-1$ is divisible by $2^{n} y+1$ for every positive integer $n$, prove that $x=1$. + +Solution. First we prove the following fact: For every positive integer $y$ there exist infinitely many primes $p \equiv 3(\bmod 4)$ such that $p$ divides some number of the form $2^{n} y+1$. + +Clearly it is enough to consider the case $y$ odd. Let + +$$ +2 y+1=p_{1}^{e_{1}} \cdots p_{r}^{e_{r}} +$$ + +be the prime factorization of $2 y+1$. Suppose on the contrary that there are finitely many primes $p_{r+1}, \ldots, p_{r+s} \equiv 3(\bmod 4)$ that divide some number of the form $2^{n} y+1$ but do not divide $2 y+1$. + +We want to find an $n$ such that $p_{i}^{e_{i}} \| 2^{n} y+1$ for $1 \leq i \leq r$ and $p_{i} \nmid 2^{n} y+1$ for $r+1 \leq i \leq r+s$. For this it suffices to take + +$$ +n=1+\varphi\left(p_{1}^{e_{1}+1} \cdots p_{r}^{e_{r}+1} p_{r+1}^{1} \cdots p_{r+s}^{1}\right) +$$ + +because then + +$$ +2^{n} y+1 \equiv 2 y+1 \quad\left(\bmod p_{1}^{e_{1}+1} \cdots p_{r}^{e_{r}+1} p_{r+1}^{1} \cdots p_{r+s}^{1}\right) +$$ + +The last congruence means that $p_{1}^{e_{1}}, \ldots, p_{r}^{e_{r}}$ divide exactly $2^{n} y+1$ and no prime $p_{r+1}, \ldots, p_{r+s}$ divides $2^{n} y+1$. It follows that the prime factorization of $2^{n} y+1$ consists of the prime powers $p_{1}^{e_{1}}, \ldots, p_{r}^{e_{r}}$ and powers of primes $\equiv 1(\bmod 4)$. Because $y$ is odd, we obtain + +$$ +2^{n} y+1 \equiv p_{1}^{e_{1}} \cdots p_{r}^{e_{r}} \equiv 2 y+1 \equiv 3 \quad(\bmod 4) +$$ + +This is a contradiction since $n>1$, and so $2^{n} y+1 \equiv 1(\bmod 4)$. + +Now we proceed to the problem. If $p$ is a prime divisor of $2^{n} y+1$ the problem statement implies that $x^{d} \equiv 1(\bmod p)$ for $d=2^{n}$. By FERMAT's little theorem the same congruence holds for $d=p-1$, so it must also hold for $d=\left(2^{n}, p-1\right)$. For $p \equiv 3(\bmod 4)$ we have $\left(2^{n}, p-1\right)=2$, therefore in this case $x^{2} \equiv 1(\bmod p)$. + +In summary, we proved that every prime $p \equiv 3(\bmod 4)$ that divides some number of the form $2^{n} y+1$ also divides $x^{2}-1$. This is possible only if $x=1$, otherwise by the above $x^{2}-1$ would be a positive integer with infinitely many prime factors. + +Comment. For each $x$ and each odd prime $p$ the maximal power of $p$ dividing $x^{2^{n}}-1$ for some $n$ is bounded and hence the same must be true for the numbers $2^{n} y+1$. We infer that $p^{2}$ divides $2^{p-1}-1$ for each prime divisor $p$ of $2^{n} y+1$. However trying to reach a contradiction with this conclusion alone seems hopeless, since it is not even known if there are infinitely many primes $p$ without this property. + +N7. Find all $n \in \mathbb{N}$ for which there exist nonnegative integers $a_{1}, a_{2}, \ldots, a_{n}$ such that + +$$ +\frac{1}{2^{a_{1}}}+\frac{1}{2^{a_{2}}}+\cdots+\frac{1}{2^{a_{n}}}=\frac{1}{3^{a_{1}}}+\frac{2}{3^{a_{2}}}+\cdots+\frac{n}{3^{a_{n}}}=1 . +$$ + +Solution. Such numbers $a_{1}, a_{2}, \ldots, a_{n}$ exist if and only if $n \equiv 1(\bmod 4)$ or $n \equiv 2(\bmod 4)$. + +Let $\sum_{k=1}^{n} \frac{k}{3^{a} k}=1$ with $a_{1}, a_{2}, \ldots, a_{n}$ nonnegative integers. Then $1 \cdot x_{1}+2 \cdot x_{2}+\cdots+n \cdot x_{n}=3^{a}$ with $x_{1}, \ldots, x_{n}$ powers of 3 and $a \geq 0$. The right-hand side is odd, and the left-hand side has the same parity as $1+2+\cdots+n$. Hence the latter sum is odd, which implies $n \equiv 1,2(\bmod 4)$. Now we prove the converse. + +Call feasible a sequence $b_{1}, b_{2}, \ldots, b_{n}$ if there are nonnegative integers $a_{1}, a_{2}, \ldots, a_{n}$ such that + +$$ +\frac{1}{2^{a_{1}}}+\frac{1}{2^{a_{2}}}+\cdots+\frac{1}{2^{a_{n}}}=\frac{b_{1}}{3^{a_{1}}}+\frac{b_{2}}{3^{a_{2}}}+\cdots+\frac{b_{n}}{3^{a_{n}}}=1 +$$ + +Let $b_{k}$ be a term of a feasible sequence $b_{1}, b_{2}, \ldots, b_{n}$ with exponents $a_{1}, a_{2}, \ldots, a_{n}$ like above, and let $u, v$ be nonnegative integers with sum $3 b_{k}$. Observe that + +$$ +\frac{1}{2^{a_{k}+1}}+\frac{1}{2^{a_{k}+1}}=\frac{1}{2^{a_{k}}} \quad \text { and } \quad \frac{u}{3^{a_{k}+1}}+\frac{v}{3^{a_{k}+1}}=\frac{b_{k}}{3^{a_{k}}} +$$ + +It follows that the sequence $b_{1}, \ldots, b_{k-1}, u, v, b_{k+1}, \ldots, b_{n}$ is feasible. The exponents $a_{i}$ are the same for the unchanged terms $b_{i}, i \neq k$; the new terms $u, v$ have exponents $a_{k}+1$. + +We state the conclusion in reverse. If two terms $u, v$ of a sequence are replaced by one term $\frac{u+v}{3}$ and the obtained sequence is feasible, then the original sequence is feasible too. Denote by $\alpha_{n}$ the sequence $1,2, \ldots, n$. To show that $\alpha_{n}$ is feasible for $n \equiv 1,2(\bmod 4)$, we transform it by $n-1$ replacements $\{u, v\} \mapsto \frac{u+v}{3}$ to the one-term sequence $\alpha_{1}$. The latter is feasible, with $a_{1}=0$. Note that if $m$ and $2 m$ are terms of a sequence then $\{m, 2 m\} \mapsto m$, so $2 m$ can be ignored if necessary. + +Let $n \geq 16$. We prove that $\alpha_{n}$ can be reduced to $\alpha_{n-12}$ by 12 operations. Write $n=12 k+r$ where $k \geq 1$ and $0 \leq r \leq 11$. If $0 \leq r \leq 5$ then the last 12 terms of $\alpha_{n}$ can be partitioned into 2 singletons $\{12 k-6\},\{12 k\}$ and the following 5 pairs: + +$$ +\{12 k-6-i, 12 k-6+i\}, i=1, \ldots, 5-r ; \quad\{12 k-j, 12 k+j\}, j=1, \ldots, r . +$$ + +(There is only one kind of pairs if $r \in\{0,5\}$.) One can ignore $12 k-6$ and $12 k$ since $\alpha_{n}$ contains $6 k-3$ and $6 k$. Furthermore the 5 operations $\{12 k-6-i, 12 k-6+i\} \mapsto 8 k-4$ and $\{12 k-j, 12 k+j\} \mapsto 8 k$ remove the 10 terms in the pairs and bring in 5 new terms equal to $8 k-4$ or $8 k$. All of these can be ignored too as $4 k-2$ and $4 k$ are still present in the sequence. Indeed $4 k \leq n-12$ is equivalent to $8 k \geq 12-r$, which is true for $r \in\{4,5\}$. And if $r \in\{0,1,2,3\}$ then $n \geq 16$ implies $k \geq 2$, so $8 k \geq 12-r$ also holds. Thus $\alpha_{n}$ reduces to $\alpha_{n-12}$. + +The case $6 \leq r \leq 11$ is analogous. Consider the singletons $\{12 k\},\{12 k+6\}$ and the 5 pairs + +$$ +\{12 k-i, 12 k+i\}, i=1, \ldots, 11-r ; \quad\{12 k+6-j, 12 k+6+j\}, j=1, \ldots, r-6 +$$ + +Ignore the singletons like before, then remove the pairs via operations $\{12 k-i, 12 k+i\} \mapsto 8 k$ and $\{12 k+6-j, 12 k+6+j\} \mapsto 8 k+4$. The 5 newly-appeared terms $8 k$ and $8 k+4$ can be ignored too since $4 k+2 \leq n-12$ (this follows from $k \geq 1$ and $r \geq 6$ ). We obtain $\alpha_{n-12}$ again. + +The problem reduces to $2 \leq n \leq 15$. In fact $n \in\{2,5,6,9,10,13,14\}$ by $n \equiv 1,2(\bmod 4)$. The cases $n=2,6,10,14$ reduce to $n=1,5,9,13$ respectively because the last even term of $\alpha_{n}$ can be ignored. For $n=5$ apply $\{4,5\} \mapsto 3$, then $\{3,3\} \mapsto 2$, then ignore the 2 occurrences of 2 . For $n=9$ ignore 6 first, then apply $\{5,7\} \mapsto 4,\{4,8\} \mapsto 4,\{3,9\} \mapsto 4$. Now ignore the 3 occurrences of 4 , then ignore 2. Finally $n=13$ reduces to $n=10$ by $\{11,13\} \mapsto 8$ and ignoring 8 and 12 . The proof is complete. + +N8. Prove that for every prime $p>100$ and every integer $r$ there exist two integers $a$ and $b$ such that $p$ divides $a^{2}+b^{5}-r$. + +Solution 1. Throughout the solution, all congruence relations are meant modulo $p$. + +Fix $p$, and let $\mathcal{P}=\{0,1, \ldots, p-1\}$ be the set of residue classes modulo $p$. For every $r \in \mathcal{P}$, let $S_{r}=\left\{(a, b) \in \mathcal{P} \times \mathcal{P}: a^{2}+b^{5} \equiv r\right\}$, and let $s_{r}=\left|S_{r}\right|$. Our aim is to prove $s_{r}>0$ for all $r \in \mathcal{P}$. + +We will use the well-known fact that for every residue class $r \in \mathcal{P}$ and every positive integer $k$, there are at most $k$ values $x \in \mathcal{P}$ such that $x^{k} \equiv r$. + +Lemma. Let $N$ be the number of quadruples $(a, b, c, d) \in \mathcal{P}^{4}$ for which $a^{2}+b^{5} \equiv c^{2}+d^{5}$. Then + +$$ +N=\sum_{r \in \mathcal{P}} s_{r}^{2} +$$ + +and + +$$ +N \leq p\left(p^{2}+4 p-4\right) +$$ + +Proof. (a) For each residue class $r$ there exist exactly $s_{r}$ pairs $(a, b)$ with $a^{2}+b^{5} \equiv r$ and $s_{r}$ pairs $(c, d)$ with $c^{2}+d^{5} \equiv r$. So there are $s_{r}^{2}$ quadruples with $a^{2}+b^{5} \equiv c^{2}+d^{5} \equiv r$. Taking the sum over all $r \in \mathcal{P}$, the statement follows. + +(b) Choose an arbitrary pair $(b, d) \in \mathcal{P}$ and look for the possible values of $a, c$. + +1. Suppose that $b^{5} \equiv d^{5}$, and let $k$ be the number of such pairs $(b, d)$. The value $b$ can be chosen in $p$ different ways. For $b \equiv 0$ only $d=0$ has this property; for the nonzero values of $b$ there are at most 5 possible values for $d$. So we have $k \leq 1+5(p-1)=5 p-4$. + +The values $a$ and $c$ must satisfy $a^{2} \equiv c^{2}$, so $a \equiv \pm c$, and there are exactly $2 p-1$ such pairs $(a, c)$. + +2. Now suppose $b^{5} \not \equiv d^{5}$. In this case $a$ and $c$ must be distinct. By $(a-c)(a+c)=d^{5}-b^{5}$, the value of $a-c$ uniquely determines $a+c$ and thus $a$ and $c$ as well. Hence, there are $p-1$ suitable pairs $(a, c)$. + +Thus, for each of the $k$ pairs $(b, d)$ with $b^{5} \equiv d^{5}$ there are $2 p-1$ pairs $(a, c)$, and for each of the other $p^{2}-k$ pairs $(b, d)$ there are $p-1$ pairs $(a, c)$. Hence, + +$$ +N=k(2 p-1)+\left(p^{2}-k\right)(p-1)=p^{2}(p-1)+k p \leq p^{2}(p-1)+(5 p-4) p=p\left(p^{2}+4 p-4\right) +$$ + +To prove the statement of the problem, suppose that $S_{r}=\emptyset$ for some $r \in \mathcal{P}$; obviously $r \not \equiv 0$. Let $T=\left\{x^{10}: x \in \mathcal{P} \backslash\{0\}\right\}$ be the set of nonzero 10th powers modulo $p$. Since each residue class is the 10 th power of at most 10 elements in $\mathcal{P}$, we have $|T| \geq \frac{p-1}{10} \geq 4$ by $p>100$. + +For every $t \in T$, we have $S_{t r}=\emptyset$. Indeed, if $(x, y) \in S_{t r}$ and $t \equiv z^{10}$ then + +$$ +\left(z^{-5} x\right)^{2}+\left(z^{-2} y\right)^{5} \equiv t^{-1}\left(x^{2}+y^{5}\right) \equiv r +$$ + +so $\left(z^{-5} x, z^{-2} y\right) \in S_{r}$. So, there are at least $\frac{p-1}{10} \geq 4$ empty sets among $S_{1}, \ldots, S_{p-1}$, and there are at most $p-4$ nonzero values among $s_{0}, s_{2}, \ldots, s_{p-1}$. Then by the AM-QM inequality we obtain + +$$ +N=\sum_{r \in \mathcal{P} \backslash r T} s_{r}^{2} \geq \frac{1}{p-4}\left(\sum_{r \in \mathcal{P} \backslash r T} s_{r}\right)^{2}=\frac{|\mathcal{P} \times \mathcal{P}|^{2}}{p-4}=\frac{p^{4}}{p-4}>p\left(p^{2}+4 p-4\right), +$$ + +which is impossible by the lemma. + +Solution 2. If $5 \nmid p-1$, then all modulo $p$ residue classes are complete fifth powers and the statement is trivial. So assume that $p=10 k+1$ where $k \geq 10$. Let $g$ be a primitive root modulo $p$. + +We will use the following facts: + +(F1) If some residue class $x$ is not quadratic then $x^{(p-1) / 2} \equiv-1(\bmod p)$. + +(F2) For every integer $d$, as a simple corollary of the summation formula for geometric progressions, + +$$ +\sum_{i=0}^{2 k-1} g^{5 d i} \equiv\left\{\begin{array}{ll} +2 k & \text { if } 2 k \mid d \\ +0 & \text { if } 2 k \not \nless d +\end{array} \quad(\bmod p)\right. +$$ + +Suppose that, contrary to the statement, some modulo $p$ residue class $r$ cannot be expressed as $a^{2}+b^{5}$. Of course $r \not \equiv 0(\bmod p)$. By $(\mathrm{F} 1)$ we have $\left(r-b^{5}\right)^{(p-1) / 2}=\left(r-b^{5}\right)^{5 k} \equiv-1(\bmod p)$ for all residue classes $b$. + +For $t=1,2 \ldots, k-1$ consider the sums + +$$ +S(t)=\sum_{i=0}^{2 k-1}\left(r-g^{5 i}\right)^{5 k} g^{5 t i} +$$ + +By the indirect assumption and (F2), + +$$ +S(t)=\sum_{i=0}^{2 k-1}\left(r-\left(g^{i}\right)^{5}\right)^{5 k} g^{5 t i} \equiv \sum_{i=0}^{2 k-1}(-1) g^{5 t i} \equiv-\sum_{i=0}^{2 k-1} g^{5 t i} \equiv 0 \quad(\bmod p) +$$ + +because $2 k$ cannot divide $t$. + +On the other hand, by the binomial theorem, + +$$ +\begin{aligned} +S(t) & =\sum_{i=0}^{2 k-1}\left(\sum_{j=0}^{5 k}\left(\begin{array}{c} +5 k \\ +j +\end{array}\right) r^{5 k-j}\left(-g^{5 i}\right)^{j}\right) g^{5 t i}=\sum_{j=0}^{5 k}(-1)^{j}\left(\begin{array}{c} +5 k \\ +j +\end{array}\right) r^{5 k-j}\left(\sum_{i=0}^{2 k-1} g^{5(j+t) i}\right) \equiv \\ +& \equiv \sum_{j=0}^{5 k}(-1)^{j}\left(\begin{array}{c} +5 k \\ +j +\end{array}\right) r^{5 k-j}\left\{\begin{array}{ll} +2 k & \text { if } 2 k \mid j+t \\ +0 & \text { if } 2 k \not j j+t +\end{array}(\bmod p) .\right. +\end{aligned} +$$ + +Since $1 \leq j+t<6 k$, the number $2 k$ divides $j+t$ only for $j=2 k-t$ and $j=4 k-t$. Hence, + +$$ +\begin{gathered} +0 \equiv S(t) \equiv(-1)^{t}\left(\left(\begin{array}{c} +5 k \\ +2 k-t +\end{array}\right) r^{3 k+t}+\left(\begin{array}{c} +5 k \\ +4 k-t +\end{array}\right) r^{k+t}\right) \cdot 2 k \quad(\bmod p), \\ +\left(\begin{array}{c} +5 k \\ +2 k-t +\end{array}\right) r^{2 k}+\left(\begin{array}{c} +5 k \\ +4 k-t +\end{array}\right) \equiv 0 \quad(\bmod p) . +\end{gathered} +$$ + +Taking this for $t=1,2$ and eliminating $r$, we get + +$$ +\begin{aligned} +0 & \equiv\left(\begin{array}{c} +5 k \\ +2 k-2 +\end{array}\right)\left(\left(\begin{array}{c} +5 k \\ +2 k-1 +\end{array}\right) r^{2 k}+\left(\begin{array}{c} +5 k \\ +4 k-1 +\end{array}\right)\right)-\left(\begin{array}{c} +5 k \\ +2 k-1 +\end{array}\right)\left(\left(\begin{array}{c} +5 k \\ +2 k-2 +\end{array}\right) r^{2 k}+\left(\begin{array}{c} +5 k \\ +4 k-2 +\end{array}\right)\right) \\ +& =\left(\begin{array}{c} +5 k \\ +2 k-2 +\end{array}\right)\left(\begin{array}{c} +5 k \\ +4 k-1 +\end{array}\right)-\left(\begin{array}{c} +5 k \\ +2 k-1 +\end{array}\right)\left(\begin{array}{c} +5 k \\ +4 k-2 +\end{array}\right) \\ +& =\frac{(5 k) !^{2}}{(2 k-1) !(3 k+2) !(4 k-1) !(k+2) !}((2 k-1)(k+2)-(3 k+2)(4 k-1)) \\ +& =\frac{-(5 k) !^{2} \cdot 2 k(5 k+1)}{(2 k-1) !(3 k+2) !(4 k-1) !(k+2) !}(\bmod p) . +\end{aligned} +$$ + +But in the last expression none of the numbers is divisible by $p=10 k+1$, a contradiction. + +Comment 1. The argument in the second solution is valid whenever $k \geq 3$, that is for all primes $p=10 k+1$ except $p=11$. This is an exceptional case when the statement is not true; $r=7$ cannot be expressed as desired. + +Comment 2. The statement is true in a more general setting: for every positive integer $n$, for all sufficiently large $p$, each residue class modulo $p$ can be expressed as $a^{2}+b^{n}$. Choosing $t=3$ would allow using the Cauchy-Davenport theorem (together with some analysis on the case of equality). + +In the literature more general results are known. For instance, the statement easily follows from the Hasse-Weil bound. + diff --git a/IMO/md/en-IMO2013SL.md b/IMO/md/en-IMO2013SL.md new file mode 100644 index 0000000000000000000000000000000000000000..7c879da69fb4509dc9e92ead17d2e100f1f29f82 --- /dev/null +++ b/IMO/md/en-IMO2013SL.md @@ -0,0 +1,2442 @@ +# Shortlisted Problems with Solutions + +$54^{\text {th }}$ International Mathematical Olympiad + +Santa Marta, Colombia 2013 + +## Note of Confidentiality + +## The Shortlisted Problems should be kept strictly confidential until IMO 2014. + +## Contributing Countries + +The Organizing Committee and the Problem Selection Committee of IMO 2013 thank the following 50 countries for contributing 149 problem proposals. + +Argentina, Armenia, Australia, Austria, Belgium, Belarus, Brazil, Bulgaria, Croatia, Cyprus, Czech Republic, Denmark, El Salvador, Estonia, Finland, France, Georgia, Germany, Greece, Hungary, India, Indonesia, Iran, Ireland, Israel, Italy, Japan, Latvia, Lithuania, Luxembourg, Malaysia, Mexico, Netherlands, Nicaragua, Pakistan, Panama, Poland, Romania, Russia, Saudi Arabia, Serbia, Slovenia, Sweden, Switzerland, Tajikistan, Thailand, Turkey, U.S.A., Ukraine, United Kingdom + +## Problem Selection Committee + +Federico Ardila (chairman) + +Ilya I. Bogdanov + +Géza Kós + +Carlos Gustavo Tamm de Araújo Moreira (Gugu) + +Christian Reiher + +## Problems + +## Algebra + +A1. Let $n$ be a positive integer and let $a_{1}, \ldots, a_{n-1}$ be arbitrary real numbers. Define the sequences $u_{0}, \ldots, u_{n}$ and $v_{0}, \ldots, v_{n}$ inductively by $u_{0}=u_{1}=v_{0}=v_{1}=1$, and + +$$ +u_{k+1}=u_{k}+a_{k} u_{k-1}, \quad v_{k+1}=v_{k}+a_{n-k} v_{k-1} \quad \text { for } k=1, \ldots, n-1 . +$$ + +Prove that $u_{n}=v_{n}$. + +(France) + +A2. Prove that in any set of 2000 distinct real numbers there exist two pairs $a>b$ and $c>d$ with $a \neq c$ or $b \neq d$, such that + +$$ +\left|\frac{a-b}{c-d}-1\right|<\frac{1}{100000} +$$ + +(Lithuania) + +A3. Let $\mathbb{Q}_{>0}$ be the set of positive rational numbers. Let $f: \mathbb{Q}_{>0} \rightarrow \mathbb{R}$ be a function satisfying the conditions + +$$ +f(x) f(y) \geqslant f(x y) \text { and } f(x+y) \geqslant f(x)+f(y) +$$ + +for all $x, y \in \mathbb{Q}_{>0}$. Given that $f(a)=a$ for some rational $a>1$, prove that $f(x)=x$ for all $x \in \mathbb{Q}_{>0}$. + +(Bulgaria) + +A4. Let $n$ be a positive integer, and consider a sequence $a_{1}, a_{2}, \ldots, a_{n}$ of positive integers. Extend it periodically to an infinite sequence $a_{1}, a_{2}, \ldots$ by defining $a_{n+i}=a_{i}$ for all $i \geqslant 1$. If + +$$ +a_{1} \leqslant a_{2} \leqslant \cdots \leqslant a_{n} \leqslant a_{1}+n +$$ + +and + +$$ +a_{a_{i}} \leqslant n+i-1 \quad \text { for } i=1,2, \ldots, n +$$ + +prove that + +$$ +a_{1}+\cdots+a_{n} \leqslant n^{2} . +$$ + +(Germany) + +A5. Let $\mathbb{Z}_{\geqslant 0}$ be the set of all nonnegative integers. Find all the functions $f: \mathbb{Z}_{\geqslant 0} \rightarrow \mathbb{Z}_{\geqslant 0}$ satisfying the relation + +$$ +f(f(f(n)))=f(n+1)+1 +$$ + +for all $n \in \mathbb{Z}_{\geqslant 0}$. + +(Serbia) + +A6. Let $m \neq 0$ be an integer. Find all polynomials $P(x)$ with real coefficients such that + +$$ +\left(x^{3}-m x^{2}+1\right) P(x+1)+\left(x^{3}+m x^{2}+1\right) P(x-1)=2\left(x^{3}-m x+1\right) P(x) +$$ + +for all real numbers $x$. + +## Combinatorics + +C1. Let $n$ be a positive integer. Find the smallest integer $k$ with the following property: Given any real numbers $a_{1}, \ldots, a_{d}$ such that $a_{1}+a_{2}+\cdots+a_{d}=n$ and $0 \leqslant a_{i} \leqslant 1$ for $i=1,2, \ldots, d$, it is possible to partition these numbers into $k$ groups (some of which may be empty) such that the sum of the numbers in each group is at most 1 . + +(Poland) + +C2. In the plane, 2013 red points and 2014 blue points are marked so that no three of the marked points are collinear. One needs to draw $k$ lines not passing through the marked points and dividing the plane into several regions. The goal is to do it in such a way that no region contains points of both colors. + +Find the minimal value of $k$ such that the goal is attainable for every possible configuration of 4027 points. + +(Australia) + +C3. A crazy physicist discovered a new kind of particle which he called an imon, after some of them mysteriously appeared in his lab. Some pairs of imons in the lab can be entangled, and each imon can participate in many entanglement relations. The physicist has found a way to perform the following two kinds of operations with these particles, one operation at a time. + +(i) If some imon is entangled with an odd number of other imons in the lab, then the physicist can destroy it. + +(ii) At any moment, he may double the whole family of imons in his lab by creating a copy $I^{\prime}$ of each imon $I$. During this procedure, the two copies $I^{\prime}$ and $J^{\prime}$ become entangled if and only if the original imons $I$ and $J$ are entangled, and each copy $I^{\prime}$ becomes entangled with its original imon $I$; no other entanglements occur or disappear at this moment. + +Prove that the physicist may apply a sequence of such operations resulting in a family of imons, no two of which are entangled. + +(Japan) + +C4. Let $n$ be a positive integer, and let $A$ be a subset of $\{1, \ldots, n\}$. An $A$-partition of $n$ into $k$ parts is a representation of $n$ as a sum $n=a_{1}+\cdots+a_{k}$, where the parts $a_{1}, \ldots, a_{k}$ belong to $A$ and are not necessarily distinct. The number of different parts in such a partition is the number of (distinct) elements in the set $\left\{a_{1}, a_{2}, \ldots, a_{k}\right\}$. + +We say that an $A$-partition of $n$ into $k$ parts is optimal if there is no $A$-partition of $n$ into $r$ parts with $r \angle C$. Let $P$ and $Q$ be two different points on line $A C$ such that $\angle P B A=\angle Q B A=\angle A C B$ and $A$ is located between $P$ and $C$. Suppose that there exists an interior point $D$ of segment $B Q$ for which $P D=P B$. Let the ray $A D$ intersect the circle $A B C$ at $R \neq A$. Prove that $Q B=Q R$. + +(Georgia) + +G5. Let $A B C D E F$ be a convex hexagon with $A B=D E, B C=E F, C D=F A$, and $\angle A-\angle D=\angle C-\angle F=\angle E-\angle B$. Prove that the diagonals $A D, B E$, and $C F$ are concurrent. + +(Ukraine) + +G6. Let the excircle of the triangle $A B C$ lying opposite to $A$ touch its side $B C$ at the point $A_{1}$. Define the points $B_{1}$ and $C_{1}$ analogously. Suppose that the circumcentre of the triangle $A_{1} B_{1} C_{1}$ lies on the circumcircle of the triangle $A B C$. Prove that the triangle $A B C$ is right-angled. + +(Russia) + +## Number Theory + +N1. Let $\mathbb{Z}_{>0}$ be the set of positive integers. Find all functions $f: \mathbb{Z}_{>0} \rightarrow \mathbb{Z}_{>0}$ such that + +$$ +m^{2}+f(n) \mid m f(m)+n +$$ + +for all positive integers $m$ and $n$. + +(Malaysia) + +N2. Prove that for any pair of positive integers $k$ and $n$ there exist $k$ positive integers $m_{1}, m_{2}, \ldots, m_{k}$ such that + +$$ +1+\frac{2^{k}-1}{n}=\left(1+\frac{1}{m_{1}}\right)\left(1+\frac{1}{m_{2}}\right) \cdots\left(1+\frac{1}{m_{k}}\right) . +$$ + +(Japan) + +N3. Prove that there exist infinitely many positive integers $n$ such that the largest prime divisor of $n^{4}+n^{2}+1$ is equal to the largest prime divisor of $(n+1)^{4}+(n+1)^{2}+1$. + +(Belgium) + +N4. Determine whether there exists an infinite sequence of nonzero digits $a_{1}, a_{2}, a_{3}, \ldots$ and a positive integer $N$ such that for every integer $k>N$, the number $\overline{a_{k} a_{k-1} \ldots a_{1}}$ is a perfect square. + +(Iran) + +N5. Fix an integer $k \geqslant 2$. Two players, called Ana and Banana, play the following game of numbers: Initially, some integer $n \geqslant k$ gets written on the blackboard. Then they take moves in turn, with Ana beginning. A player making a move erases the number $m$ just written on the blackboard and replaces it by some number $m^{\prime}$ with $k \leqslant m^{\prime} 0}$. (Here, $\mathbb{Z}_{>0}$ denotes the set of positive integers.) + +(Israel) + +N7. Let $\nu$ be an irrational positive number, and let $m$ be a positive integer. A pair $(a, b)$ of positive integers is called good if + +$$ +a\lceil b \nu\rceil-b\lfloor a \nu\rfloor=m . +$$ + +A good pair $(a, b)$ is called excellent if neither of the pairs $(a-b, b)$ and $(a, b-a)$ is good. (As usual, by $\lfloor x\rfloor$ and $\lceil x\rceil$ we denote the integer numbers such that $x-1<\lfloor x\rfloor \leqslant x$ and $x \leqslant\lceil x\rceil i_{1}>\ldots>i_{t}>n-k \\ i_{j}-i_{j+1} \geqslant 2}} a_{i_{1}} \ldots a_{i_{t}} +$$ + +For $k=n$ the expressions (1) and (2) coincide, so indeed $u_{n}=v_{n}$. + +Solution 2. Define recursively a sequence of multivariate polynomials by + +$$ +P_{0}=P_{1}=1, \quad P_{k+1}\left(x_{1}, \ldots, x_{k}\right)=P_{k}\left(x_{1}, \ldots, x_{k-1}\right)+x_{k} P_{k-1}\left(x_{1}, \ldots, x_{k-2}\right), +$$ + +so $P_{n}$ is a polynomial in $n-1$ variables for each $n \geqslant 1$. Two easy inductive arguments show that + +$$ +u_{n}=P_{n}\left(a_{1}, \ldots, a_{n-1}\right), \quad v_{n}=P_{n}\left(a_{n-1}, \ldots, a_{1}\right) +$$ + +so we need to prove $P_{n}\left(x_{1}, \ldots, x_{n-1}\right)=P_{n}\left(x_{n-1}, \ldots, x_{1}\right)$ for every positive integer $n$. The cases $n=1,2$ are trivial, and the cases $n=3,4$ follow from $P_{3}(x, y)=1+x+y$ and $P_{4}(x, y, z)=$ $1+x+y+z+x z$. + +Now we proceed by induction, assuming that $n \geqslant 5$ and the claim hold for all smaller cases. Using $F(a, b)$ as an abbreviation for $P_{|a-b|+1}\left(x_{a}, \ldots, x_{b}\right)$ (where the indices $a, \ldots, b$ can be either in increasing or decreasing order), + +$$ +\begin{aligned} +F(n, 1) & =F(n, 2)+x_{1} F(n, 3)=F(2, n)+x_{1} F(3, n) \\ +& =\left(F(2, n-1)+x_{n} F(2, n-2)\right)+x_{1}\left(F(3, n-1)+x_{n} F(3, n-2)\right) \\ +& =\left(F(n-1,2)+x_{1} F(n-1,3)\right)+x_{n}\left(F(n-2,2)+x_{1} F(n-2,3)\right) \\ +& =F(n-1,1)+x_{n} F(n-2,1)=F(1, n-1)+x_{n} F(1, n-2) \\ +& =F(1, n), +\end{aligned} +$$ + +as we wished to show. + +Solution 3. Using matrix notation, we can rewrite the recurrence relation as + +$$ +\left(\begin{array}{c} +u_{k+1} \\ +u_{k+1}-u_{k} +\end{array}\right)=\left(\begin{array}{c} +u_{k}+a_{k} u_{k-1} \\ +a_{k} u_{k-1} +\end{array}\right)=\left(\begin{array}{cc} +1+a_{k} & -a_{k} \\ +a_{k} & -a_{k} +\end{array}\right)\left(\begin{array}{c} +u_{k} \\ +u_{k}-u_{k-1} +\end{array}\right) +$$ + +for $1 \leqslant k \leqslant n-1$, and similarly + +$$ +\left(v_{k+1} ; v_{k}-v_{k+1}\right)=\left(v_{k}+a_{n-k} v_{k-1} ;-a_{n-k} v_{k-1}\right)=\left(v_{k} ; v_{k-1}-v_{k}\right)\left(\begin{array}{cc} +1+a_{n-k} & -a_{n-k} \\ +a_{n-k} & -a_{n-k} +\end{array}\right) +$$ + +for $1 \leqslant k \leqslant n-1$. Hence, introducing the $2 \times 2$ matrices $A_{k}=\left(\begin{array}{cc}1+a_{k} & -a_{k} \\ a_{k} & -a_{k}\end{array}\right)$ we have + +$$ +\left(\begin{array}{c} +u_{k+1} \\ +u_{k+1}-u_{k} +\end{array}\right)=A_{k}\left(\begin{array}{c} +u_{k} \\ +u_{k}-u_{k-1} +\end{array}\right) \quad \text { and } \quad\left(v_{k+1} ; v_{k}-v_{k+1}\right)=\left(v_{k} ; v_{k-1}-v_{k}\right) A_{n-k} . +$$ + +for $1 \leqslant k \leqslant n-1$. Since $\left(\begin{array}{c}u_{1} \\ u_{1}-u_{0}\end{array}\right)=\left(\begin{array}{l}1 \\ 0\end{array}\right)$ and $\left(v_{1} ; v_{0}-v_{1}\right)=(1 ; 0)$, we get + +$$ +\left(\begin{array}{c} +u_{n} \\ +u_{n}-u_{n-1} +\end{array}\right)=A_{n-1} A_{n-2} \cdots A_{1} \cdot\left(\begin{array}{l} +1 \\ +0 +\end{array}\right) \quad \text { and } \quad\left(v_{n} ; v_{n-1}-v_{n}\right)=(1 ; 0) \cdot A_{n-1} A_{n-2} \cdots A_{1} \text {. } +$$ + +It follows that + +$$ +\left(u_{n}\right)=(1 ; 0)\left(\begin{array}{c} +u_{n} \\ +u_{n}-u_{n-1} +\end{array}\right)=(1 ; 0) \cdot A_{n-1} A_{n-2} \cdots A_{1} \cdot\left(\begin{array}{l} +1 \\ +0 +\end{array}\right)=\left(v_{n} ; v_{n-1}-v_{n}\right)\left(\begin{array}{l} +1 \\ +0 +\end{array}\right)=\left(v_{n}\right) . +$$ + +Comment 1. These sequences are related to the Fibonacci sequence; when $a_{1}=\cdots=a_{n-1}=1$, we have $u_{k}=v_{k}=F_{k+1}$, the $(k+1)$ st Fibonacci number. Also, for every positive integer $k$, the polynomial $P_{k}\left(x_{1}, \ldots, x_{k-1}\right)$ from Solution 2 is the sum of $F_{k+1}$ monomials. + +Comment 2. One may notice that the condition is equivalent to + +$$ +\frac{u_{k+1}}{u_{k}}=1+\frac{a_{k}}{1+\frac{a_{k-1}}{1+\ldots+\frac{a_{2}}{1+a_{1}}}} \quad \text { and } \quad \frac{v_{k+1}}{v_{k}}=1+\frac{a_{n-k}}{1+\frac{a_{n-k+1}}{1+\ldots+\frac{a_{n-2}}{1+a_{n-1}}}} +$$ + +so the problem claims that the corresponding continued fractions for $u_{n} / u_{n-1}$ and $v_{n} / v_{n-1}$ have the same numerator. + +Comment 3. An alternative variant of the problem is the following. + +Let $n$ be a positive integer and let $a_{1}, \ldots, a_{n-1}$ be arbitrary real numbers. Define the sequences $u_{0}, \ldots, u_{n}$ and $v_{0}, \ldots, v_{n}$ inductively by $u_{0}=v_{0}=0, u_{1}=v_{1}=1$, and + +$$ +u_{k+1}=a_{k} u_{k}+u_{k-1}, \quad v_{k+1}=a_{n-k} v_{k}+v_{k-1} \quad \text { for } k=1, \ldots, n-1 +$$ + +Prove that $u_{n}=v_{n}$. + +All three solutions above can be reformulated to prove this statement; one may prove + +$$ +u_{n}=v_{n}=\sum_{\substack{0=i_{0} 0 +$$ + +or observe that + +$$ +\left(\begin{array}{c} +u_{k+1} \\ +u_{k} +\end{array}\right)=\left(\begin{array}{cc} +a_{k} & 1 \\ +1 & 0 +\end{array}\right)\left(\begin{array}{c} +u_{k} \\ +u_{k-1} +\end{array}\right) \quad \text { and } \quad\left(v_{k+1} ; v_{k}\right)=\left(v_{k} ; v_{k-1}\right)\left(\begin{array}{cc} +a_{k} & 1 \\ +1 & 0 +\end{array}\right) . +$$ + +Here we have + +$$ +\frac{u_{k+1}}{u_{k}}=a_{k}+\frac{1}{a_{k-1}+\frac{1}{a_{k-2}+\ldots+\frac{1}{a_{1}}}}=\left[a_{k} ; a_{k-1}, \ldots, a_{1}\right] +$$ + +and + +$$ +\frac{v_{k+1}}{v_{k}}=a_{n-k}+\frac{1}{a_{n-k+1}+\frac{1}{a_{n-k+2}+\ldots+\frac{1}{a_{n-1}}}}=\left[a_{n-k} ; a_{n-k+1}, \ldots, a_{n-1}\right] +$$ + +so this alternative statement is equivalent to the known fact that the continued fractions $\left[a_{n-1} ; a_{n-2}, \ldots, a_{1}\right]$ and $\left[a_{1} ; a_{2}, \ldots, a_{n-1}\right]$ have the same numerator. + +A2. Prove that in any set of 2000 distinct real numbers there exist two pairs $a>b$ and $c>d$ with $a \neq c$ or $b \neq d$, such that + +$$ +\left|\frac{a-b}{c-d}-1\right|<\frac{1}{100000} +$$ + +(Lithuania) + +Solution. For any set $S$ of $n=2000$ distinct real numbers, let $D_{1} \leqslant D_{2} \leqslant \cdots \leqslant D_{m}$ be the distances between them, displayed with their multiplicities. Here $m=n(n-1) / 2$. By rescaling the numbers, we may assume that the smallest distance $D_{1}$ between two elements of $S$ is $D_{1}=1$. Let $D_{1}=1=y-x$ for $x, y \in S$. Evidently $D_{m}=v-u$ is the difference between the largest element $v$ and the smallest element $u$ of $S$. + +If $D_{i+1} / D_{i}<1+10^{-5}$ for some $i=1,2, \ldots, m-1$ then the required inequality holds, because $0 \leqslant D_{i+1} / D_{i}-1<10^{-5}$. Otherwise, the reverse inequality + +$$ +\frac{D_{i+1}}{D_{i}} \geqslant 1+\frac{1}{10^{5}} +$$ + +holds for each $i=1,2, \ldots, m-1$, and therefore + +$$ +v-u=D_{m}=\frac{D_{m}}{D_{1}}=\frac{D_{m}}{D_{m-1}} \cdots \frac{D_{3}}{D_{2}} \cdot \frac{D_{2}}{D_{1}} \geqslant\left(1+\frac{1}{10^{5}}\right)^{m-1} . +$$ + +From $m-1=n(n-1) / 2-1=1000 \cdot 1999-1>19 \cdot 10^{5}$, together with the fact that for all $n \geqslant 1$, $\left(1+\frac{1}{n}\right)^{n} \geqslant 1+\left(\begin{array}{l}n \\ 1\end{array}\right) \cdot \frac{1}{n}=2$, we get + +$$ +\left(1+\frac{1}{10^{5}}\right)^{19 \cdot 10^{5}}=\left(\left(1+\frac{1}{10^{5}}\right)^{10^{5}}\right)^{19} \geqslant 2^{19}=2^{9} \cdot 2^{10}>500 \cdot 1000>2 \cdot 10^{5}, +$$ + +and so $v-u=D_{m}>2 \cdot 10^{5}$. + +Since the distance of $x$ to at least one of the numbers $u, v$ is at least $(u-v) / 2>10^{5}$, we have + +$$ +|x-z|>10^{5} . +$$ + +for some $z \in\{u, v\}$. Since $y-x=1$, we have either $z>y>x$ (if $z=v$ ) or $y>x>z$ (if $z=u$ ). If $z>y>x$, selecting $a=z, b=y, c=z$ and $d=x$ (so that $b \neq d$ ), we obtain + +$$ +\left|\frac{a-b}{c-d}-1\right|=\left|\frac{z-y}{z-x}-1\right|=\left|\frac{x-y}{z-x}\right|=\frac{1}{z-x}<10^{-5} . +$$ + +Otherwise, if $y>x>z$, we may choose $a=y, b=z, c=x$ and $d=z$ (so that $a \neq c$ ), and obtain + +$$ +\left|\frac{a-b}{c-d}-1\right|=\left|\frac{y-z}{x-z}-1\right|=\left|\frac{y-x}{x-z}\right|=\frac{1}{x-z}<10^{-5} +$$ + +The desired result follows. + +Comment. As the solution shows, the numbers 2000 and $\frac{1}{100000}$ appearing in the statement of the problem may be replaced by any $n \in \mathbb{Z}_{>0}$ and $\delta>0$ satisfying + +$$ +\delta(1+\delta)^{n(n-1) / 2-1}>2 +$$ + +A3. Let $\mathbb{Q}_{>0}$ be the set of positive rational numbers. Let $f: \mathbb{Q}_{>0} \rightarrow \mathbb{R}$ be a function satisfying the conditions + +$$ +\begin{aligned} +& f(x) f(y) \geqslant f(x y) \\ +& f(x+y) \geqslant f(x)+f(y) +\end{aligned} +$$ + +for all $x, y \in \mathbb{Q}_{>0}$. Given that $f(a)=a$ for some rational $a>1$, prove that $f(x)=x$ for all $x \in \mathbb{Q}_{>0}$. + +(Bulgaria) + +Solution. Denote by $\mathbb{Z}_{>0}$ the set of positive integers. + +Plugging $x=1, y=a$ into (1) we get $f(1) \geqslant 1$. Next, by an easy induction on $n$ we get from (2) that + +$$ +f(n x) \geqslant n f(x) \text { for all } n \in \mathbb{Z}_{>0} \text { and } x \in \mathbb{Q}_{>0} +$$ + +In particular, we have + +$$ +f(n) \geqslant n f(1) \geqslant n \quad \text { for all } n \in \mathbb{Z}_{>0} +$$ + +From (1) again we have $f(m / n) f(n) \geqslant f(m)$, so $f(q)>0$ for all $q \in \mathbb{Q}_{>0}$. + +Now, (2) implies that $f$ is strictly increasing; this fact together with (4) yields + +$$ +f(x) \geqslant f(\lfloor x\rfloor) \geqslant\lfloor x\rfloor>x-1 \quad \text { for all } x \geqslant 1 +$$ + +By an easy induction we get from (1) that $f(x)^{n} \geqslant f\left(x^{n}\right)$, so + +$$ +f(x)^{n} \geqslant f\left(x^{n}\right)>x^{n}-1 \quad \Longrightarrow \quad f(x) \geqslant \sqrt[n]{x^{n}-1} \text { for all } x>1 \text { and } n \in \mathbb{Z}_{>0} +$$ + +This yields + +$$ +f(x) \geqslant x \text { for every } x>1 \text {. } +$$ + +(Indeed, if $x>y>1$ then $x^{n}-y^{n}=(x-y)\left(x^{n-1}+x^{n-2} y+\cdots+y^{n}\right)>n(x-y)$, so for a large $n$ we have $x^{n}-1>y^{n}$ and thus $f(x)>y$.) + +Now, (1) and (5) give $a^{n}=f(a)^{n} \geqslant f\left(a^{n}\right) \geqslant a^{n}$, so $f\left(a^{n}\right)=a^{n}$. Now, for $x>1$ let us choose $n \in \mathbb{Z}_{>0}$ such that $a^{n}-x>1$. Then by (2) and (5) we get + +$$ +a^{n}=f\left(a^{n}\right) \geqslant f(x)+f\left(a^{n}-x\right) \geqslant x+\left(a^{n}-x\right)=a^{n} +$$ + +and therefore $f(x)=x$ for $x>1$. Finally, for every $x \in \mathbb{Q}_{>0}$ and every $n \in \mathbb{Z}_{>0}$, from (1) and (3) we get + +$$ +n f(x)=f(n) f(x) \geqslant f(n x) \geqslant n f(x) +$$ + +which gives $f(n x)=n f(x)$. Therefore $f(m / n)=f(m) / n=m / n$ for all $m, n \in \mathbb{Z}_{>0}$. + +Comment. The condition $f(a)=a>1$ is essential. Indeed, for $b \geqslant 1$ the function $f(x)=b x^{2}$ satisfies (1) and (2) for all $x, y \in \mathbb{Q}_{>0}$, and it has a unique fixed point $1 / b \leqslant 1$. + +A4. Let $n$ be a positive integer, and consider a sequence $a_{1}, a_{2}, \ldots, a_{n}$ of positive integers. Extend it periodically to an infinite sequence $a_{1}, a_{2}, \ldots$ by defining $a_{n+i}=a_{i}$ for all $i \geqslant 1$. If + +$$ +a_{1} \leqslant a_{2} \leqslant \cdots \leqslant a_{n} \leqslant a_{1}+n +$$ + +and + +$$ +a_{a_{i}} \leqslant n+i-1 \quad \text { for } i=1,2, \ldots, n +$$ + +prove that + +$$ +a_{1}+\cdots+a_{n} \leqslant n^{2} . +$$ + +(Germany) + +Solution 1. First, we claim that + +$$ +a_{i} \leqslant n+i-1 \quad \text { for } i=1,2, \ldots, n \text {. } +$$ + +Assume contrariwise that $i$ is the smallest counterexample. From $a_{n} \geqslant a_{n-1} \geqslant \cdots \geqslant a_{i} \geqslant n+i$ and $a_{a_{i}} \leqslant n+i-1$, taking into account the periodicity of our sequence, it follows that + +$$ +a_{i} \text { cannot be congruent to } i, i+1, \ldots, n-1 \text {, or } n(\bmod n) \text {. } +$$ + +Thus our assumption that $a_{i} \geqslant n+i$ implies the stronger statement that $a_{i} \geqslant 2 n+1$, which by $a_{1}+n \geqslant a_{n} \geqslant a_{i}$ gives $a_{1} \geqslant n+1$. The minimality of $i$ then yields $i=1$, and (4) becomes contradictory. This establishes our first claim. + +In particular we now know that $a_{1} \leqslant n$. If $a_{n} \leqslant n$, then $a_{1} \leqslant \cdots \leqslant \cdots a_{n} \leqslant n$ and the desired inequality holds trivially. Otherwise, consider the number $t$ with $1 \leqslant t \leqslant n-1$ such that + +$$ +a_{1} \leqslant a_{2} \leqslant \ldots \leqslant a_{t} \leqslant n a_{a_{i}}$ ) belongs to $\left\{a_{i}+1, \ldots, n\right\}$, and for this reason $b_{i} \leqslant n-a_{i}$. + +It follows from the definition of the $b_{i} \mathrm{~s}$ and (5) that + +$$ +a_{t+1}+\ldots+a_{n} \leqslant n(n-t)+b_{1}+\ldots+b_{t} . +$$ + +Adding $a_{1}+\ldots+a_{t}$ to both sides and using that $a_{i}+b_{i} \leqslant n$ for $1 \leqslant i \leqslant t$, we get + +$$ +a_{1}+a_{2}+\cdots+a_{n} \leqslant n(n-t)+n t=n^{2} +$$ + +as we wished to prove. + +Solution 2. In the first quadrant of an infinite grid, consider the increasing "staircase" obtained by shading in dark the bottom $a_{i}$ cells of the $i$ th column for $1 \leqslant i \leqslant n$. We will prove that there are at most $n^{2}$ dark cells. + +To do it, consider the $n \times n$ square $S$ in the first quadrant with a vertex at the origin. Also consider the $n \times n$ square directly to the left of $S$. Starting from its lower left corner, shade in light the leftmost $a_{j}$ cells of the $j$ th row for $1 \leqslant j \leqslant n$. Equivalently, the light shading is obtained by reflecting the dark shading across the line $x=y$ and translating it $n$ units to the left. The figure below illustrates this construction for the sequence $6,6,6,7,7,7,8,12,12,14$. + + + +We claim that there is no cell in $S$ which is both dark and light. Assume, contrariwise, that there is such a cell in column $i$. Consider the highest dark cell in column $i$ which is inside $S$. Since it is above a light cell and inside $S$, it must be light as well. There are two cases: + +Case 1. $a_{i} \leqslant n$ + +If $a_{i} \leqslant n$ then this dark and light cell is $\left(i, a_{i}\right)$, as highlighted in the figure. However, this is the $(n+i)$-th cell in row $a_{i}$, and we only shaded $a_{a_{i}} 0$ such that $f(n)=b-1$; but then $f^{3}(n-1)=f(n)+1=b$, so $b \in R_{3}$. + +This yields + +$$ +3 k=\left|S_{1} \cup S_{2} \cup S_{3}\right| \leqslant 1+1+\left|S_{1}\right|=k+2, +$$ + +or $k \leqslant 1$. Therefore $k=1$, and the inequality above comes to equality. So we have $S_{1}=\{a\}$, $S_{2}=\{f(a)\}$, and $S_{3}=\left\{f^{2}(a)\right\}$ for some $a \in \mathbb{Z}_{\geqslant 0}$, and each one of the three options (i), (ii), and (iii) should be realized exactly once, which means that + +$$ +\left\{a, f(a), f^{2}(a)\right\}=\{0, a+1, f(0)+1\} . +$$ + +III. From (3), we get $a+1 \in\left\{f(a), f^{2}(a)\right\}$ (the case $a+1=a$ is impossible). If $a+1=f^{2}(a)$ then we have $f(a+1)=f^{3}(a)=f(a+1)+1$ which is absurd. Therefore + +$$ +f(a)=a+1 +$$ + +Next, again from (3) we have $0 \in\left\{a, f^{2}(a)\right\}$. Let us consider these two cases separately. Case 1. Assume that $a=0$, then $f(0)=f(a)=a+1=1$. Also from (3) we get $f(1)=f^{2}(a)=$ $f(0)+1=2$. Now, let us show that $f(n)=n+1$ by induction on $n$; the base cases $n \leqslant 1$ are established. Next, if $n \geqslant 2$ then the induction hypothesis implies + +$$ +n+1=f(n-1)+1=f^{3}(n-2)=f^{2}(n-1)=f(n), +$$ + +establishing the step. In this case we have obtained the first of two answers; checking that is satisfies (*) is straightforward. + +Case 2. Assume now that $f^{2}(a)=0$; then by (3) we get $a=f(0)+1$. By (4) we get $f(a+1)=$ $f^{2}(a)=0$, then $f(0)=f^{3}(a)=f(a+1)+1=1$, hence $a=f(0)+1=2$ and $f(2)=3$ by (4). To summarize, + +$$ +f(0)=1, \quad f(2)=3, \quad f(3)=0 . +$$ + +Now let us prove by induction on $m$ that (1) holds for all $n=4 k, 4 k+2,4 k+3$ with $k \leqslant m$ and for all $n=4 k+1$ with $k 0$ and $B(1)=m+2>0$ since $n=2 m$. + +Therefore $B(x)=A(x+a+b)$. Writing $c=a+b \geqslant 1$ we compute + +$$ +0=A(x+c)-B(x)=(3 c-2 m) x^{2}+c(3 c-2 m) x+c^{2}(c-m) . +$$ + +Then we must have $3 c-2 m=c-m=0$, which gives $m=0$, a contradiction. We conclude that $f(x)=t x$ is the only solution. + +Solution 2. Multiplying (1) by $x$, we rewrite it as + +$$ +x\left(x^{3}-m x^{2}+1\right) P(x+1)+x\left(x^{3}+m x^{2}+1\right) P(x-1)=[(x+1)+(x-1)]\left(x^{3}-m x+1\right) P(x) . +$$ + +After regrouping, it becomes + +$$ +\left(x^{3}-m x^{2}+1\right) Q(x)=\left(x^{3}+m x^{2}+1\right) Q(x-1) \text {, } +$$ + +where $Q(x)=x P(x+1)-(x+1) P(x)$. If $\operatorname{deg} P \geqslant 2$ then $\operatorname{deg} Q=\operatorname{deg} P$, so $Q(x)$ has a finite multiset of complex roots, which we denote $R_{Q}$. Each root is taken with its multiplicity. Then the multiset of complex roots of $Q(x-1)$ is $R_{Q}+1=\left\{z+1: z \in R_{Q}\right\}$. + +Let $\left\{x_{1}, x_{2}, x_{3}\right\}$ and $\left\{y_{1}, y_{2}, y_{3}\right\}$ be the multisets of roots of the polynomials $A(x)=x^{3}-m x^{2}+1$ and $B(x)=x^{3}+m x^{2}+1$, respectively. From (2) we get the equality of multisets + +$$ +\left\{x_{1}, x_{2}, x_{3}\right\} \cup R_{Q}=\left\{y_{1}, y_{2}, y_{3}\right\} \cup\left(R_{Q}+1\right) . +$$ + +For every $r \in R_{Q}$, since $r+1$ is in the set of the right hand side, we must have $r+1 \in R_{Q}$ or $r+1=x_{i}$ for some $i$. Similarly, since $r$ is in the set of the left hand side, either $r-1 \in R_{Q}$ or $r=y_{i}$ for some $i$. This implies that, possibly after relabelling $y_{1}, y_{2}, y_{3}$, all the roots of (2) may be partitioned into three chains of the form $\left\{y_{i}, y_{i}+1, \ldots, y_{i}+k_{i}=x_{i}\right\}$ for $i=1,2,3$ and some integers $k_{1}, k_{2}, k_{3} \geqslant 0$. + +Now we analyze the roots of the polynomial $A_{a}(x)=x^{3}+a x^{2}+1$. Using calculus or elementary methods, we find that the local extrema of $A_{a}(x)$ occur at $x=0$ and $x=-2 a / 3$; their values are $A_{a}(0)=1>0$ and $A_{a}(-2 a / 3)=1+4 a^{3} / 27$, which is positive for integers $a \geqslant-1$ and negative for integers $a \leqslant-2$. So when $a \in \mathbb{Z}, A_{a}$ has three real roots if $a \leqslant-2$ and one if $a \geqslant-1$. + +Now, since $y_{i}-x_{i} \in \mathbb{Z}$ for $i=1,2,3$, the cubics $A_{m}$ and $A_{-m}$ must have the same number of real roots. The previous analysis then implies that $m=1$ or $m=-1$. Therefore the real root $\alpha$ of $A_{1}(x)=x^{3}+x^{2}+1$ and the real root $\beta$ of $A_{-1}(x)=x^{3}-x^{2}+1$ must differ by an integer. But this is impossible, because $A_{1}\left(-\frac{3}{2}\right)=-\frac{1}{8}$ and $A_{1}(-1)=1$ so $-1.5<\alpha<-1$, while $A_{-1}(-1)=-1$ and $A_{-1}\left(-\frac{1}{2}\right)=\frac{5}{8}$, so $-1<\beta<-0.5$. + +It follows that $\operatorname{deg} P \leqslant 1$. Then, as shown in Solution 1, we conclude that the solutions are $P(x)=t x$ for all real numbers $t$. + +## Combinatorics + +C1. Let $n$ be a positive integer. Find the smallest integer $k$ with the following property: Given any real numbers $a_{1}, \ldots, a_{d}$ such that $a_{1}+a_{2}+\cdots+a_{d}=n$ and $0 \leqslant a_{i} \leqslant 1$ for $i=1,2, \ldots, d$, it is possible to partition these numbers into $k$ groups (some of which may be empty) such that the sum of the numbers in each group is at most 1 . + +(Poland) + +Answer. $k=2 n-1$. + +Solution 1. If $d=2 n-1$ and $a_{1}=\cdots=a_{2 n-1}=n /(2 n-1)$, then each group in such a partition can contain at most one number, since $2 n /(2 n-1)>1$. Therefore $k \geqslant 2 n-1$. It remains to show that a suitable partition into $2 n-1$ groups always exists. + +We proceed by induction on $d$. For $d \leqslant 2 n-1$ the result is trivial. If $d \geqslant 2 n$, then since + +$$ +\left(a_{1}+a_{2}\right)+\ldots+\left(a_{2 n-1}+a_{2 n}\right) \leqslant n +$$ + +we may find two numbers $a_{i}, a_{i+1}$ such that $a_{i}+a_{i+1} \leqslant 1$. We "merge" these two numbers into one new number $a_{i}+a_{i+1}$. By the induction hypothesis, a suitable partition exists for the $d-1$ numbers $a_{1}, \ldots, a_{i-1}, a_{i}+a_{i+1}, a_{i+2}, \ldots, a_{d}$. This induces a suitable partition for $a_{1}, \ldots, a_{d}$. + +Solution 2. We will show that it is even possible to split the sequence $a_{1}, \ldots, a_{d}$ into $2 n-1$ contiguous groups so that the sum of the numbers in each groups does not exceed 1. Consider a segment $S$ of length $n$, and partition it into segments $S_{1}, \ldots, S_{d}$ of lengths $a_{1}, \ldots, a_{d}$, respectively, as shown below. Consider a second partition of $S$ into $n$ equal parts by $n-1$ "empty dots". + +| $a_{1}$ | $a_{2}$ | $a_{3}$ | $a_{4}$ | $a_{5}$ | $a_{6}$ | $a_{7}$ | $a_{8}, a_{9}, a_{10}$ | +| :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | +| | | | | | | | | + +Assume that the $n-1$ empty dots are in segments $S_{i_{1}}, \ldots, S_{i_{n-1}}$. (If a dot is on the boundary of two segments, we choose the right segment). These $n-1$ segments are distinct because they have length at most 1. Consider the partition: + +$$ +\left\{a_{1}, \ldots, a_{i_{1}-1}\right\},\left\{a_{i_{1}}\right\},\left\{a_{i_{1}+1}, \ldots, a_{i_{2}-1}\right\},\left\{a_{i_{2}}\right\}, \ldots\left\{a_{i_{n-1}}\right\},\left\{a_{i_{n-1}+1}, \ldots, a_{d}\right\} +$$ + +In the example above, this partition is $\left\{a_{1}, a_{2}\right\},\left\{a_{3}\right\},\left\{a_{4}, a_{5}\right\},\left\{a_{6}\right\}, \varnothing,\left\{a_{7}\right\},\left\{a_{8}, a_{9}, a_{10}\right\}$. We claim that in this partition, the sum of the numbers in this group is at most 1 . + +For the sets $\left\{a_{i_{t}}\right\}$ this is obvious since $a_{i_{t}} \leqslant 1$. For the sets $\left\{a_{i_{t}}+1, \ldots, a_{i_{t+1}-1}\right\}$ this follows from the fact that the corresponding segments lie between two neighboring empty dots, or between an endpoint of $S$ and its nearest empty dot. Therefore the sum of their lengths cannot exceed 1. + +Solution 3. First put all numbers greater than $\frac{1}{2}$ in their own groups. Then, form the remaining groups as follows: For each group, add new $a_{i} \mathrm{~S}$ one at a time until their sum exceeds $\frac{1}{2}$. Since the last summand is at most $\frac{1}{2}$, this group has sum at most 1 . Continue this procedure until we have used all the $a_{i}$ s. Notice that the last group may have sum less than $\frac{1}{2}$. If the sum of the numbers in the last two groups is less than or equal to 1, we merge them into one group. In the end we are left with $m$ groups. If $m=1$ we are done. Otherwise the first $m-2$ have sums greater than $\frac{1}{2}$ and the last two have total sum greater than 1 . Therefore $n>(m-2) / 2+1$ so $m \leqslant 2 n-1$ as desired. + +Comment 1. The original proposal asked for the minimal value of $k$ when $n=2$. + +Comment 2. More generally, one may ask the same question for real numbers between 0 and 1 whose sum is a real number $r$. In this case the smallest value of $k$ is $k=\lceil 2 r\rceil-1$, as Solution 3 shows. + +Solutions 1 and 2 lead to the slightly weaker bound $k \leqslant 2\lceil r\rceil-1$. This is actually the optimal bound for partitions into consecutive groups, which are the ones contemplated in these two solutions. To see this, assume that $r$ is not an integer and let $c=(r+1-\lceil r\rceil) /(1+\lceil r\rceil)$. One easily checks that $0 N$. + +C3. A crazy physicist discovered a new kind of particle which he called an imon, after some of them mysteriously appeared in his lab. Some pairs of imons in the lab can be entangled, and each imon can participate in many entanglement relations. The physicist has found a way to perform the following two kinds of operations with these particles, one operation at a time. + +(i) If some imon is entangled with an odd number of other imons in the lab, then the physicist can destroy it. + +(ii) At any moment, he may double the whole family of imons in his lab by creating a copy $I^{\prime}$ of each imon $I$. During this procedure, the two copies $I^{\prime}$ and $J^{\prime}$ become entangled if and only if the original imons $I$ and $J$ are entangled, and each copy $I^{\prime}$ becomes entangled with its original imon $I$; no other entanglements occur or disappear at this moment. + +Prove that the physicist may apply a sequence of such operations resulting in a family of imons, no two of which are entangled. + +(Japan) + +Solution 1. Let us consider a graph with the imons as vertices, and two imons being connected if and only if they are entangled. Recall that a proper coloring of a graph $G$ is a coloring of its vertices in several colors so that every two connected vertices have different colors. + +Lemma. Assume that a graph $G$ admits a proper coloring in $n$ colors $(n>1)$. Then one may perform a sequence of operations resulting in a graph which admits a proper coloring in $n-1$ colors. + +Proof. Let us apply repeatedly operation $(i)$ to any appropriate vertices while it is possible. Since the number of vertices decreases, this process finally results in a graph where all the degrees are even. Surely this graph also admits a proper coloring in $n$ colors $1, \ldots, n$; let us fix this coloring. + +Now apply the operation (ii) to this graph. A proper coloring of the resulting graph in $n$ colors still exists: one may preserve the colors of the original vertices and color the vertex $I^{\prime}$ in a color $k+1(\bmod n)$ if the vertex $I$ has color $k$. Then two connected original vertices still have different colors, and so do their two connected copies. On the other hand, the vertices $I$ and $I^{\prime}$ have different colors since $n>1$. + +All the degrees of the vertices in the resulting graph are odd, so one may apply operation $(i)$ to delete consecutively all the vertices of color $n$ one by one; no two of them are connected by an edge, so their degrees do not change during the process. Thus, we obtain a graph admitting a proper coloring in $n-1$ colors, as required. The lemma is proved. + +Now, assume that a graph $G$ has $n$ vertices; then it admits a proper coloring in $n$ colors. Applying repeatedly the lemma we finally obtain a graph admitting a proper coloring in one color, that is - a graph with no edges, as required. + +Solution 2. Again, we will use the graph language. + +I. We start with the following observation. + +Lemma. Assume that a graph $G$ contains an isolated vertex $A$, and a graph $G^{\circ}$ is obtained from $G$ by deleting this vertex. Then, if one can apply a sequence of operations which makes a graph with no edges from $G^{\circ}$, then such a sequence also exists for $G$. + +Proof. Consider any operation applicable to $G^{\circ}$ resulting in a graph $G_{1}^{\circ}$; then there exists a sequence of operations applicable to $G$ and resulting in a graph $G_{1}$ differing from $G_{1}^{\circ}$ by an addition of an isolated vertex $A$. Indeed, if this operation is of type $(i)$, then one may simply repeat it in $G$. + +Otherwise, the operation is of type (ii), and one may apply it to $G$ and then delete the vertex $A^{\prime}$ (it will have degree 1 ). + +Thus one may change the process for $G^{\circ}$ into a corresponding process for $G$ step by step. + +In view of this lemma, if at some moment a graph contains some isolated vertex, then we may simply delete it; let us call this operation (iii). + +II. Let $V=\left\{A_{1}^{0}, \ldots, A_{n}^{0}\right\}$ be the vertices of the initial graph. Let us describe which graphs can appear during our operations. Assume that operation (ii) was applied $m$ times. If these were the only operations applied, then the resulting graph $G_{n}^{m}$ has the set of vertices which can be enumerated as + +$$ +V_{n}^{m}=\left\{A_{i}^{j}: 1 \leqslant i \leqslant n, 0 \leqslant j \leqslant 2^{m}-1\right\} +$$ + +where $A_{i}^{0}$ is the common "ancestor" of all the vertices $A_{i}^{j}$, and the binary expansion of $j$ (adjoined with some zeroes at the left to have $m$ digits) "keeps the history" of this vertex: the $d$ th digit from the right is 0 if at the $d$ th doubling the ancestor of $A_{i}^{j}$ was in the original part, and this digit is 1 if it was in the copy. + +Next, the two vertices $A_{i}^{j}$ and $A_{k}^{\ell}$ in $G_{n}^{m}$ are connected with an edge exactly if either (1) $j=\ell$ and there was an edge between $A_{i}^{0}$ and $A_{k}^{0}$ (so these vertices appeared at the same application of operation (ii)); or (2) $i=k$ and the binary expansions of $j$ and $\ell$ differ in exactly one digit (so their ancestors became connected as a copy and the original vertex at some application of (ii)). + +Now, if some operations $(i)$ were applied during the process, then simply some vertices in $G_{n}^{m}$ disappeared. So, in any case the resulting graph is some induced subgraph of $G_{n}^{m}$. + +III. Finally, we will show that from each (not necessarily induced) subgraph of $G_{n}^{m}$ one can obtain a graph with no vertices by applying operations $(i),(i i)$ and $(i i i)$. We proceed by induction on $n$; the base case $n=0$ is trivial. + +For the induction step, let us show how to apply several operations so as to obtain a graph containing no vertices of the form $A_{n}^{j}$ for $j \in \mathbb{Z}$. We will do this in three steps. + +Step 1. We apply repeatedly operation (i) to any appropriate vertices while it is possible. In the resulting graph, all vertices have even degrees. + +Step 2. Apply operation (ii) obtaining a subgraph of $G_{n}^{m+1}$ with all degrees being odd. In this graph, we delete one by one all the vertices $A_{n}^{j}$ where the sum of the binary digits of $j$ is even; it is possible since there are no edges between such vertices, so all their degrees remain odd. After that, we delete all isolated vertices. + +Step 3. Finally, consider any remaining vertex $A_{n}^{j}$ (then the sum of digits of $j$ is odd). If its degree is odd, then we simply delete it. Otherwise, since $A_{n}^{j}$ is not isolated, we consider any vertex adjacent to it. It has the form $A_{k}^{j}$ for some $k \sqrt[3]{6 n}$, we will prove that there exist subsets $X$ and $Y$ of $S$ such that $|X|<|Y|$ and $\sum_{x \in X} x=\sum_{y \in Y} y$. Then, deleting the elements of $Y$ from our partition and adding the elements of $X$ to it, we obtain an $A$-partition of $n$ into less than $k_{\text {min }}$ parts, which is the desired contradiction. + +For each positive integer $k \leqslant s$, we consider the $k$-element subset + +$$ +S_{1,0}^{k}:=\left\{b_{1}, \ldots, b_{k}\right\} +$$ + +as well as the following $k$-element subsets $S_{i, j}^{k}$ of $S$ : + +$$ +S_{i, j}^{k}:=\left\{b_{1}, \ldots, b_{k-i}, b_{k-i+j+1}, b_{s-i+2}, \ldots, b_{s}\right\}, \quad i=1, \ldots, k, \quad j=1, \ldots, s-k +$$ + +Pictorially, if we represent the elements of $S$ by a sequence of dots in increasing order, and represent a subset of $S$ by shading in the appropriate dots, we have: + + + +Denote by $\Sigma_{i, j}^{k}$ the sum of elements in $S_{i, j}^{k}$. Clearly, $\Sigma_{1,0}^{k}$ is the minimum sum of a $k$-element subset of $S$. Next, for all appropriate indices $i$ and $j$ we have + +$$ +\Sigma_{i, j}^{k}=\Sigma_{i, j+1}^{k}+b_{k-i+j+1}-b_{k-i+j+2}<\Sigma_{i, j+1}^{k} \quad \text { and } \quad \sum_{i, s-k}^{k}=\sum_{i+1,1}^{k}+b_{k-i}-b_{k-i+1}<\Sigma_{i+1,1}^{k} \text {. } +$$ + +Therefore + +$$ +1 \leqslant \Sigma_{1,0}^{k}<\Sigma_{1,1}^{k}<\Sigma_{1,2}^{k}<\cdots<\Sigma_{1, s-k}^{k}<\Sigma_{2,1}^{k}<\cdots<\Sigma_{2, s-k}^{k}<\Sigma_{3,1}^{k}<\cdots<\Sigma_{k, s-k}^{k} \leqslant n . +$$ + +To see this in the picture, we start with the $k$ leftmost points marked. At each step, we look for the rightmost point which can move to the right, and move it one unit to the right. We continue until the $k$ rightmost points are marked. As we do this, the corresponding sums clearly increase. + +For each $k$ we have found $k(s-k)+1$ different integers of the form $\Sigma_{i, j}^{k}$ between 1 and $n$. As we vary $k$, the total number of integers we are considering is + +$$ +\sum_{k=1}^{s}(k(s-k)+1)=s \cdot \frac{s(s+1)}{2}-\frac{s(s+1)(2 s+1)}{6}+s=\frac{s\left(s^{2}+5\right)}{6}>\frac{s^{3}}{6}>n . +$$ + +Since they are between 1 and $n$, at least two of these integers are equal. Consequently, there exist $1 \leqslant k \sqrt[3]{6 n}>1$. Without loss of generality we assume that $a_{k_{\min }}=b_{s}$. Let us distinguish two cases. + +Case 1. $b_{s} \geqslant \frac{s(s-1)}{2}+1$. + +Consider the partition $n-b_{s}=a_{1}+\cdots+a_{k_{\min }-1}$, which is clearly a minimum $A$-partition of $n-b_{s}$ with at least $s-1 \geqslant 1$ different parts. Now, from $n<\frac{s^{3}}{6}$ we obtain + +$$ +n-b_{s} \leqslant n-\frac{s(s-1)}{2}-1<\frac{s^{3}}{6}-\frac{s(s-1)}{2}-1<\frac{(s-1)^{3}}{6} +$$ + +so $s-1>\sqrt[3]{6\left(n-b_{s}\right)}$, which contradicts the choice of $n$. + +Case 2. $b_{s} \leqslant \frac{s(s-1)}{2}$. + +Set $b_{0}=0, \Sigma_{0,0}=0$, and $\Sigma_{i, j}=b_{1}+\cdots+b_{i-1}+b_{j}$ for $1 \leqslant i \leqslant j b_{s}$ such sums; so at least two of them, say $\Sigma_{i, j}$ and $\Sigma_{i^{\prime}, j^{\prime}}$, are congruent modulo $b_{s}$ (where $(i, j) \neq\left(i^{\prime}, j^{\prime}\right)$ ). This means that $\Sigma_{i, j}-\Sigma_{i^{\prime}, j^{\prime}}=r b_{s}$ for some integer $r$. Notice that for $i \leqslant ji^{\prime}$. Next, we observe that $\Sigma_{i, j}-\Sigma_{i^{\prime}, j^{\prime}}=\left(b_{i^{\prime}}-b_{j^{\prime}}\right)+b_{j}+b_{i^{\prime}+1}+\cdots+b_{i-1}$ and $b_{i^{\prime}} \leqslant b_{j^{\prime}}$ imply + +$$ +-b_{s}<-b_{j^{\prime}}<\Sigma_{i, j}-\Sigma_{i^{\prime}, j^{\prime}}<\left(i-i^{\prime}\right) b_{s}, +$$ + +so $0 \leqslant r \leqslant i-i^{\prime}-1$. + +Thus, we may remove the $i$ terms of $\Sigma_{i, j}$ in our $A$-partition, and replace them by the $i^{\prime}$ terms of $\Sigma_{i^{\prime}, j^{\prime}}$ and $r$ terms equal to $b_{s}$, for a total of $r+i^{\prime}a_{k+1} \geqslant 1$, which shows that + +$$ +n=a_{1}+\ldots+a_{k+1} +$$ + +is an $A$-partition of $n$ into $k+1$ different parts. Since $k h 3$. Finally, in the sequence $d(a, y), d\left(a, b_{y}\right), d\left(a, c_{y}\right), d\left(a, d_{y}\right)$ the neighboring terms differ by at most 1 , the first term is less than 3 , and the last one is greater than 3 ; thus there exists one which is equal to 3 , as required. + +Comment 1. The upper bound 2550 is sharp. This can be seen by means of various examples; one of them is the "Roman Empire": it has one capital, called "Rome", that is connected to 51 semicapitals by internally disjoint paths of length 3. Moreover, each of these semicapitals is connected to 50 rural cities by direct flights. + +Comment 2. Observe that, under the conditions of the problem, there exists no bound for the size of $S_{1}(x)$ or $S_{2}(x)$. + +Comment 3. The numbers 100 and 2550 appearing in the statement of the problem may be replaced by $n$ and $\left\lfloor\frac{(n+1)^{2}}{4}\right\rfloor$ for any positive integer $n$. Still more generally, one can also replace the pair $(3,4)$ of distances under consideration by any pair $(r, s)$ of positive integers satisfying $r n$ is equivalent to the case $t0$ is very small. + + + +Figure 3 + +If $0 \leqslant a, b, c, d \leqslant n$ satisfy $a+c=b+d$, then $a \alpha+c \alpha=b \alpha+d \alpha$, so the chord from $a$ to $c$ is parallel to the chord from $b$ to $d$ in $A(\alpha)$. Hence in a cyclic arrangement all $k$-chords are parallel. In particular every cyclic arrangement is beautiful. + +Next we show that there are exactly $N+1$ distinct cyclic arrangements. To see this, let us see how $A(\alpha)$ changes as we increase $\alpha$ from 0 to 1 . The order of points $p$ and $q$ changes precisely when we cross a value $\alpha=f$ such that $\{p f\}=\{q f\}$; this can only happen if $f$ is one of the $N$ fractions $f_{1}, \ldots, f_{N}$. Therefore there are at most $N+1$ different cyclic arrangements. + +To show they are all distinct, recall that $f_{i}=a_{i} / b_{i}$ and let $\epsilon>0$ be a very small number. In the arrangement $A\left(f_{i}+\epsilon\right)$, point $k$ lands at $\frac{k a_{i}\left(\bmod b_{i}\right)}{b_{i}}+k \epsilon$. Therefore the points are grouped into $b_{i}$ clusters next to the points $0, \frac{1}{b_{i}}, \ldots, \frac{b_{i}-1}{b_{i}}$ of the circle. The cluster following $\frac{k}{b_{i}}$ contains the numbers congruent to $k a_{i}^{-1}$ modulo $b_{i}$, listed clockwise in increasing order. It follows that the first number after 0 in $A\left(f_{i}+\epsilon\right)$ is $b_{i}$, and the first number after 0 which is less than $b_{i}$ is $a_{i}^{-1}\left(\bmod b_{i}\right)$, which uniquely determines $a_{i}$. In this way we can recover $f_{i}$ from the cyclic arrangement. Note also that $A\left(f_{i}+\epsilon\right)$ is not the trivial arrangement where we list $0,1, \ldots, n$ in order clockwise. It follows that the $N+1$ cyclic arrangements $A(\epsilon), A\left(f_{1}+\epsilon\right), \ldots, A\left(f_{N}+\epsilon\right)$ are distinct. + +Let us record an observation which will be useful later: + +$$ +\text { if } f_{i}<\alpha 1 / 2^{m}$. + +Next, any interval blackened by $B$ before the $r$ th move which intersects $\left(x_{r}, x_{r+1}\right)$ should be contained in $\left[x_{r}, x_{r+1}\right]$; by (ii), all such intervals have different lengths not exceeding $1 / 2^{m}$, so the total amount of ink used for them is less than $2 / 2^{m}$. Thus, the amount of ink used for the segment $\left[0, x_{r+1}\right]$ does not exceed the sum of $2 / 2^{m}, 3 x_{r}$ (used for $\left[0, x_{r}\right]$ ), and $1 / 2^{m}$ used for the +segment $I_{0}^{r}$. In total it gives at most $3\left(x_{r}+1 / 2^{m}\right)<3\left(x_{r}+\alpha\right)=3 x_{r+1}$. Thus condition $(i)$ is also verified in this case. The claim is proved. + +Finally, we can perform the desired estimation. Consider any situation in the game, say after the $(r-1)$ st move; assume that the segment $[0,1]$ is not completely black. By $(i i)$, in the segment $\left[x_{r}, 1\right]$ player $B$ has colored several segments of different lengths; all these lengths are negative powers of 2 not exceeding $1-x_{r}$; thus the total amount of ink used for this interval is at most $2\left(1-x_{r}\right)$. Using $(i)$, we obtain that the total amount of ink used is at most $3 x_{r}+2\left(1-x_{r}\right)<3$. Thus the pot is not empty, and therefore $A$ never wins. + +Comment 1. Notice that this strategy works even if the pot contains initially only 3 units of ink. + +Comment 2. There exist other strategies for $B$ allowing him to prevent emptying the pot before the whole interval is colored. On the other hand, let us mention some idea which does not work. + +Player $B$ could try a strategy in which the set of blackened points in each round is an interval of the type $[0, x]$. Such a strategy cannot work (even if there is more ink available). Indeed, under the assumption that $B$ uses such a strategy, let us prove by induction on $s$ the following statement: + +For any positive integer $s$, player $A$ has a strategy picking only positive integers $m \leqslant s$ in which, if player $B$ ever paints a point $x \geqslant 1-1 / 2^{s}$ then after some move, exactly the interval $\left[0,1-1 / 2^{s}\right]$ is blackened, and the amount of ink used up to this moment is at least s/2. + +For the base case $s=1$, player $A$ just picks $m=1$ in the first round. If for some positive integer $k$ player $A$ has such a strategy, for $s+1$ he can first rescale his strategy to the interval $[0,1 / 2]$ (sending in each round half of the amount of ink he would give by the original strategy). Thus, after some round, the interval $\left[0,1 / 2-1 / 2^{s+1}\right]$ becomes blackened, and the amount of ink used is at least $s / 4$. Now player $A$ picks $m=1 / 2$, and player $B$ spends $1 / 2$ unit of ink to blacken the interval [0,1/2]. After that, player $A$ again rescales his strategy to the interval $[1 / 2,1]$, and player $B$ spends at least $s / 4$ units of ink to blacken the interval $\left[1 / 2,1-1 / 2^{s+1}\right]$, so he spends in total at least $s / 4+1 / 2+s / 4=(s+1) / 2$ units of ink. + +Comment 3. In order to avoid finiteness issues, the statement could be replaced by the following one: + +Players $A$ and $B$ play a paintful game on the real numbers. Player $A$ has a paint pot with four units of black ink. A quantity $p$ of this ink suffices to blacken a (closed) real interval of length $p$. In the beginning of the game, player $A$ chooses (and announces) a positive integer $N$. In every round, player $A$ picks some positive integer $m \leqslant N$ and provides $1 / 2^{m}$ units of ink from the pot. The player $B$ picks an integer $k$ and blackens the interval from $k / 2^{m}$ to $(k+1) / 2^{m}$ (some parts of this interval may happen to be blackened before). The goal of player $A$ is to reach a situation where the pot is empty and the interval $[0,1]$ is not completely blackened. + +Decide whether there exists a strategy for player A to win. + +However, the Problem Selection Committee believes that this version may turn out to be harder than the original one. + +## Geometry + +G1. Let $A B C$ be an acute-angled triangle with orthocenter $H$, and let $W$ be a point on side $B C$. Denote by $M$ and $N$ the feet of the altitudes from $B$ and $C$, respectively. Denote by $\omega_{1}$ the circumcircle of $B W N$, and let $X$ be the point on $\omega_{1}$ which is diametrically opposite to $W$. Analogously, denote by $\omega_{2}$ the circumcircle of $C W M$, and let $Y$ be the point on $\omega_{2}$ which is diametrically opposite to $W$. Prove that $X, Y$ and $H$ are collinear. + +(Thaliand) + +Solution. Let $L$ be the foot of the altitude from $A$, and let $Z$ be the second intersection point of circles $\omega_{1}$ and $\omega_{2}$, other than $W$. We show that $X, Y, Z$ and $H$ lie on the same line. + +Due to $\angle B N C=\angle B M C=90^{\circ}$, the points $B, C, N$ and $M$ are concyclic; denote their circle by $\omega_{3}$. Observe that the line $W Z$ is the radical axis of $\omega_{1}$ and $\omega_{2}$; similarly, $B N$ is the radical axis of $\omega_{1}$ and $\omega_{3}$, and $C M$ is the radical axis of $\omega_{2}$ and $\omega_{3}$. Hence $A=B N \cap C M$ is the radical center of the three circles, and therefore $W Z$ passes through $A$. + +Since $W X$ and $W Y$ are diameters in $\omega_{1}$ and $\omega_{2}$, respectively, we have $\angle W Z X=\angle W Z Y=90^{\circ}$, so the points $X$ and $Y$ lie on the line through $Z$, perpendicular to $W Z$. + + + +The quadrilateral $B L H N$ is cyclic, because it has two opposite right angles. From the power of $A$ with respect to the circles $\omega_{1}$ and $B L H N$ we find $A L \cdot A H=A B \cdot A N=A W \cdot A Z$. If $H$ lies on the line $A W$ then this implies $H=Z$ immediately. Otherwise, by $\frac{A Z}{A H}=\frac{A L}{A W}$ the triangles $A H Z$ and $A W L$ are similar. Then $\angle H Z A=\angle W L A=90^{\circ}$, so the point $H$ also lies on the line $X Y Z$. + +Comment. The original proposal also included a second statement: + +Let $P$ be the point on $\omega_{1}$ such that $W P$ is parallel to $C N$, and let $Q$ be the point on $\omega_{2}$ such that $W Q$ is parallel to $B M$. Prove that $P, Q$ and $H$ are collinear if and only if $B W=C W$ or $A W \perp B C$. + +The Problem Selection Committee considered the first part more suitable for the competition. + +G2. Let $\omega$ be the circumcircle of a triangle $A B C$. Denote by $M$ and $N$ the midpoints of the sides $A B$ and $A C$, respectively, and denote by $T$ the midpoint of the $\operatorname{arc} B C$ of $\omega$ not containing $A$. The circumcircles of the triangles $A M T$ and $A N T$ intersect the perpendicular bisectors of $A C$ and $A B$ at points $X$ and $Y$, respectively; assume that $X$ and $Y$ lie inside the triangle $A B C$. The lines $M N$ and $X Y$ intersect at $K$. Prove that $K A=K T$. + +(Iran) + +Solution 1. Let $O$ be the center of $\omega$, thus $O=M Y \cap N X$. Let $\ell$ be the perpendicular bisector of $A T$ (it also passes through $O$ ). Denote by $r$ the operation of reflection about $\ell$. Since $A T$ is the angle bisector of $\angle B A C$, the line $r(A B)$ is parallel to $A C$. Since $O M \perp A B$ and $O N \perp A C$, this means that the line $r(O M)$ is parallel to the line $O N$ and passes through $O$, so $r(O M)=O N$. Finally, the circumcircle $\gamma$ of the triangle $A M T$ is symmetric about $\ell$, so $r(\gamma)=\gamma$. Thus the point $M$ maps to the common point of $O N$ with the arc $A M T$ of $\gamma$ - that is, $r(M)=X$. + +Similarly, $r(N)=Y$. Thus, we get $r(M N)=X Y$, and the common point $K$ of $M N$ nd $X Y$ lies on $\ell$. This means exactly that $K A=K T$. + + + +Solution 2. Let $L$ be the second common point of the line $A C$ with the circumcircle $\gamma$ of the triangle $A M T$. From the cyclic quadrilaterals $A B T C$ and $A M T L$ we get $\angle B T C=180^{\circ}-$ $\angle B A C=\angle M T L$, which implies $\angle B T M=\angle C T L$. Since $A T$ is an angle bisector in these quadrilaterals, we have $B T=T C$ and $M T=T L$. Thus the triangles $B T M$ and $C T L$ are congruent, so $C L=B M=A M$. + +Let $X^{\prime}$ be the common point of the line $N X$ with the external bisector of $\angle B A C$; notice that it lies outside the triangle $A B C$. Then we have $\angle T A X^{\prime}=90^{\circ}$ and $X^{\prime} A=X^{\prime} C$, so we get $\angle X^{\prime} A M=90^{\circ}+\angle B A C / 2=180^{\circ}-\angle X^{\prime} A C=180^{\circ}-\angle X^{\prime} C A=\angle X^{\prime} C L$. Thus the triangles $X^{\prime} A M$ and $X^{\prime} C L$ are congruent, and therefore + +$$ +\angle M X^{\prime} L=\angle A X^{\prime} C+\left(\angle C X^{\prime} L-\angle A X^{\prime} M\right)=\angle A X^{\prime} C=180^{\circ}-2 \angle X^{\prime} A C=\angle B A C=\angle M A L . +$$ + +This means that $X^{\prime}$ lies on $\gamma$. + +Thus we have $\angle T X N=\angle T X X^{\prime}=\angle T A X^{\prime}=90^{\circ}$, so $T X \| A C$. Then $\angle X T A=\angle T A C=$ $\angle T A M$, so the cyclic quadrilateral MATX is an isosceles trapezoid. Similarly, $N A T Y$ is an isosceles trapezoid, so again the lines $M N$ and $X Y$ are the reflections of each other about the perpendicular bisector of $A T$. Thus $K$ belongs to this perpendicular bisector. + + + +Comment. There are several different ways of showing that the points $X$ and $M$ are symmetrical with respect to $\ell$. For instance, one can show that the quadrilaterals $A M O N$ and $T X O Y$ are congruent. We chose Solution 1 as a simple way of doing it. On the other hand, Solution 2 shows some other interesting properties of the configuration. + +Let us define $Y^{\prime}$, analogously to $X^{\prime}$, as the common point of $M Y$ and the external bisector of $\angle B A C$. One may easily see that in general the lines $M N$ and $X^{\prime} Y^{\prime}$ (which is the external bisector of $\angle B A C$ ) do not intersect on the perpendicular bisector of $A T$. Thus, any solution should involve some argument using the choice of the intersection points $X$ and $Y$. + +G3. In a triangle $A B C$, let $D$ and $E$ be the feet of the angle bisectors of angles $A$ and $B$, respectively. A rhombus is inscribed into the quadrilateral $A E D B$ (all vertices of the rhombus lie on different sides of $A E D B$ ). Let $\varphi$ be the non-obtuse angle of the rhombus. Prove that $\varphi \leqslant \max \{\angle B A C, \angle A B C\}$. + +(Serbia) + +Solution 1. Let $K, L, M$, and $N$ be the vertices of the rhombus lying on the sides $A E, E D, D B$, and $B A$, respectively. Denote by $d(X, Y Z)$ the distance from a point $X$ to a line $Y Z$. Since $D$ and $E$ are the feet of the bisectors, we have $d(D, A B)=d(D, A C), d(E, A B)=d(E, B C)$, and $d(D, B C)=d(E, A C)=0$, which implies + +$$ +d(D, A C)+d(D, B C)=d(D, A B) \quad \text { and } \quad d(E, A C)+d(E, B C)=d(E, A B) +$$ + +Since $L$ lies on the segment $D E$ and the relation $d(X, A C)+d(X, B C)=d(X, A B)$ is linear in $X$ inside the triangle, these two relations imply + +$$ +d(L, A C)+d(L, B C)=d(L, A B) . +$$ + +Denote the angles as in the figure below, and denote $a=K L$. Then we have $d(L, A C)=a \sin \mu$ and $d(L, B C)=a \sin \nu$. Since $K L M N$ is a parallelogram lying on one side of $A B$, we get + +$$ +d(L, A B)=d(L, A B)+d(N, A B)=d(K, A B)+d(M, A B)=a(\sin \delta+\sin \varepsilon) +$$ + +Thus the condition (1) reads + +$$ +\sin \mu+\sin \nu=\sin \delta+\sin \varepsilon +$$ + + + +If one of the angles $\alpha$ and $\beta$ is non-acute, then the desired inequality is trivial. So we assume that $\alpha, \beta<\pi / 2$. It suffices to show then that $\psi=\angle N K L \leqslant \max \{\alpha, \beta\}$. + +Assume, to the contrary, that $\psi>\max \{\alpha, \beta\}$. Since $\mu+\psi=\angle C K N=\alpha+\delta$, by our assumption we obtain $\mu=(\alpha-\psi)+\delta<\delta$. Similarly, $\nu<\varepsilon$. Next, since $K N \| M L$, we have $\beta=\delta+\nu$, so $\delta<\beta<\pi / 2$. Similarly, $\varepsilon<\pi / 2$. Finally, by $\mu<\delta<\pi / 2$ and $\nu<\varepsilon<\pi / 2$, we obtain + +$$ +\sin \mu<\sin \delta \quad \text { and } \quad \sin \nu<\sin \varepsilon +$$ + +This contradicts (2). + +Comment. One can see that the equality is achieved if $\alpha=\beta$ for every rhombus inscribed into the quadrilateral $A E D B$. + +G4. Let $A B C$ be a triangle with $\angle B>\angle C$. Let $P$ and $Q$ be two different points on line $A C$ such that $\angle P B A=\angle Q B A=\angle A C B$ and $A$ is located between $P$ and $C$. Suppose that there exists an interior point $D$ of segment $B Q$ for which $P D=P B$. Let the ray $A D$ intersect the circle $A B C$ at $R \neq A$. Prove that $Q B=Q R$. + +(Georgia) + +Solution 1. Denote by $\omega$ the circumcircle of the triangle $A B C$, and let $\angle A C B=\gamma$. Note that the condition $\gamma<\angle C B A$ implies $\gamma<90^{\circ}$. Since $\angle P B A=\gamma$, the line $P B$ is tangent to $\omega$, so $P A \cdot P C=P B^{2}=P D^{2}$. By $\frac{P A}{P D}=\frac{P D}{P C}$ the triangles $P A D$ and $P D C$ are similar, and $\angle A D P=\angle D C P$. + +Next, since $\angle A B Q=\angle A C B$, the triangles $A B C$ and $A Q B$ are also similar. Then $\angle A Q B=$ $\angle A B C=\angle A R C$, which means that the points $D, R, C$, and $Q$ are concyclic. Therefore $\angle D R Q=$ $\angle D C Q=\angle A D P$. + + + +Figure 1 + +Now from $\angle A R B=\angle A C B=\gamma$ and $\angle P D B=\angle P B D=2 \gamma$ we get + +$$ +\angle Q B R=\angle A D B-\angle A R B=\angle A D P+\angle P D B-\angle A R B=\angle D R Q+\gamma=\angle Q R B +$$ + +so the triangle $Q R B$ is isosceles, which yields $Q B=Q R$. + +Solution 2. Again, denote by $\omega$ the circumcircle of the triangle $A B C$. Denote $\angle A C B=\gamma$. Since $\angle P B A=\gamma$, the line $P B$ is tangent to $\omega$. + +Let $E$ be the second intersection point of $B Q$ with $\omega$. If $V^{\prime}$ is any point on the ray $C E$ beyond $E$, then $\angle B E V^{\prime}=180^{\circ}-\angle B E C=180^{\circ}-\angle B A C=\angle P A B$; together with $\angle A B Q=$ $\angle P B A$ this shows firstly, that the rays $B A$ and $C E$ intersect at some point $V$, and secondly that the triangle $V E B$ is similar to the triangle $P A B$. Thus we have $\angle B V E=\angle B P A$. Next, $\angle A E V=\angle B E V-\gamma=\angle P A B-\angle A B Q=\angle A Q B$; so the triangles $P B Q$ and $V A E$ are also similar. + +Let $P H$ be an altitude in the isosceles triangle $P B D$; then $B H=H D$. Let $G$ be the intersection point of $P H$ and $A B$. By the symmetry with respect to $P H$, we have $\angle B D G=\angle D B G=\gamma=$ $\angle B E A$; thus $D G \| A E$ and hence $\frac{B G}{G A}=\frac{B D}{D E}$. Thus the points $G$ and $D$ correspond to each other in the similar triangles $P A B$ and $V E B$, so $\angle D V B=\angle G P B=90^{\circ}-\angle P B Q=90^{\circ}-\angle V A E$. Thus $V D \perp A E$. + +Let $T$ be the common point of $V D$ and $A E$, and let $D S$ be an altitude in the triangle $B D R$. The points $S$ and $T$ are the feet of corresponding altitudes in the similar triangles $A D E$ and $B D R$, so $\frac{B S}{S R}=\frac{A T}{T E}$. On the other hand, the points $T$ and $H$ are feet of corresponding altitudes in the similar triangles $V A E$ and $P B Q$, so $\frac{A T}{T E}=\frac{B H}{H Q}$. Thus $\frac{B S}{S R}=\frac{A T}{T E}=\frac{B H}{H Q}$, and the triangles $B H S$ and $B Q R$ are similar. + +Finally, $S H$ is a median in the right-angled triangle $S B D$; so $B H=H S$, and hence $B Q=Q R$. + + + +Figure 2 + +Solution 3. Denote by $\omega$ and $O$ the circumcircle of the triangle $A B C$ and its center, respectively. From the condition $\angle P B A=\angle B C A$ we know that $B P$ is tangent to $\omega$. + +Let $E$ be the second point of intersection of $\omega$ and $B D$. Due to the isosceles triangle $B D P$, the tangent of $\omega$ at $E$ is parallel to $D P$ and consequently it intersects $B P$ at some point $L$. Of course, $P D \| L E$. Let $M$ be the midpoint of $B E$, and let $H$ be the midpoint of $B R$. Notice that $\angle A E B=\angle A C B=\angle A B Q=\angle A B E$, so $A$ lies on the perpendicular bisector of $B E$; thus the points $L, A, M$, and $O$ are collinear. Let $\omega_{1}$ be the circle with diameter $B O$. Let $Q^{\prime}=H O \cap B E$; since $H O$ is the perpendicular bisector of $B R$, the statement of the problem is equivalent to $Q^{\prime}=Q$. + +Consider the following sequence of projections (see Fig. 3). + +1. Project the line $B E$ to the line $L B$ through the center $A$. (This maps $Q$ to $P$.) +2. Project the line $L B$ to $B E$ in parallel direction with $L E$. $(P \mapsto D$.) +3. Project the line $B E$ to the circle $\omega$ through its point $A .(D \mapsto R$.) +4. Scale $\omega$ by the ratio $\frac{1}{2}$ from the point $B$ to the circle $\omega_{1} .(R \mapsto H$. +5. Project $\omega_{1}$ to the line $B E$ through its point $O$. $\left(H \mapsto Q^{\prime}\right.$.) + +We prove that the composition of these transforms, which maps the line $B E$ to itself, is the identity. To achieve this, it suffices to show three fixed points. An obvious fixed point is $B$ which is fixed by all the transformations above. Another fixed point is $M$, its path being $M \mapsto L \mapsto$ $E \mapsto E \mapsto M \mapsto M$. + + + +Figure 3 + + + +Figure 4 + +In order to show a third fixed point, draw a line parallel with $L E$ through $A$; let that line intersect $B E, L B$ and $\omega$ at $X, Y$ and $Z \neq A$, respectively (see Fig. 4). We show that $X$ is a fixed point. The images of $X$ at the first three transformations are $X \mapsto Y \mapsto X \mapsto Z$. From $\angle X B Z=\angle E A Z=\angle A E L=\angle L B A=\angle B Z X$ we can see that the triangle $X B Z$ is isosceles. Let $U$ be the midpoint of $B Z$; then the last two transformations do $Z \mapsto U \mapsto X$, and the point $X$ is fixed. + +Comment. Verifying that the point $E$ is fixed seems more natural at first, but it appears to be less straightforward. Here we outline a possible proof. + +Let the images of $E$ at the first three transforms above be $F, G$ and $I$. After comparing the angles depicted in Fig. 5 (noticing that the quadrilateral $A F B G$ is cyclic) we can observe that the tangent $L E$ of $\omega$ is parallel to $B I$. Then, similarly to the above reasons, the point $E$ is also fixed. + + + +Figure 5 + +G5. Let $A B C D E F$ be a convex hexagon with $A B=D E, B C=E F, C D=F A$, and $\angle A-\angle D=\angle C-\angle F=\angle E-\angle B$. Prove that the diagonals $A D, B E$, and $C F$ are concurrent. + +(Ukraine) + +In all three solutions, we denote $\theta=\angle A-\angle D=\angle C-\angle F=\angle E-\angle B$ and assume without loss of generality that $\theta \geqslant 0$. + +Solution 1. Let $x=A B=D E, y=C D=F A, z=E F=B C$. Consider the points $P, Q$, and $R$ such that the quadrilaterals $C D E P, E F A Q$, and $A B C R$ are parallelograms. We compute + +$$ +\begin{aligned} +\angle P E Q & =\angle F E Q+\angle D E P-\angle E=\left(180^{\circ}-\angle F\right)+\left(180^{\circ}-\angle D\right)-\angle E \\ +& =360^{\circ}-\angle D-\angle E-\angle F=\frac{1}{2}(\angle A+\angle B+\angle C-\angle D-\angle E-\angle F)=\theta / 2 +\end{aligned} +$$ + +Similarly, $\angle Q A R=\angle R C P=\theta / 2$. + + + +If $\theta=0$, since $\triangle R C P$ is isosceles, $R=P$. Therefore $A B\|R C=P C\| E D$, so $A B D E$ is a parallelogram. Similarly, $B C E F$ and $C D F A$ are parallelograms. It follows that $A D, B E$ and $C F$ meet at their common midpoint. + +Now assume $\theta>0$. Since $\triangle P E Q, \triangle Q A R$, and $\triangle R C P$ are isosceles and have the same angle at the apex, we have $\triangle P E Q \sim \triangle Q A R \sim \triangle R C P$ with ratios of similarity $y: z: x$. Thus + +$\triangle P Q R$ is similar to the triangle with sidelengths $y, z$, and $x$. + +Next, notice that + +$$ +\frac{R Q}{Q P}=\frac{z}{y}=\frac{R A}{A F} +$$ + +and, using directed angles between rays, + +$$ +\begin{aligned} +\not(R Q, Q P) & =\Varangle(R Q, Q E)+\Varangle(Q E, Q P) \\ +& =\Varangle(R Q, Q E)+\Varangle(R A, R Q)=\Varangle(R A, Q E)=\Varangle(R A, A F) . +\end{aligned} +$$ + +Thus $\triangle P Q R \sim \triangle F A R$. Since $F A=y$ and $A R=z$, (1) then implies that $F R=x$. Similarly $F P=x$. Therefore $C R F P$ is a rhombus. + +We conclude that $C F$ is the perpendicular bisector of $P R$. Similarly, $B E$ is the perpendicular bisector of $P Q$ and $A D$ is the perpendicular bisector of $Q R$. It follows that $A D, B E$, and $C F$ are concurrent at the circumcenter of $P Q R$. + +Solution 2. Let $X=C D \cap E F, Y=E F \cap A B, Z=A B \cap C D, X^{\prime}=F A \cap B C, Y^{\prime}=$ $B C \cap D E$, and $Z^{\prime}=D E \cap F A$. From $\angle A+\angle B+\angle C=360^{\circ}+\theta / 2$ we get $\angle A+\angle B>180^{\circ}$ and $\angle B+\angle C>180^{\circ}$, so $Z$ and $X^{\prime}$ are respectively on the opposite sides of $B C$ and $A B$ from the hexagon. Similar conclusions hold for $X, Y, Y^{\prime}$, and $Z^{\prime}$. Then + +$$ +\angle Y Z X=\angle B+\angle C-180^{\circ}=\angle E+\angle F-180^{\circ}=\angle Y^{\prime} Z^{\prime} X^{\prime}, +$$ + +and similarly $\angle Z X Y=\angle Z^{\prime} X^{\prime} Y^{\prime}$ and $\angle X Y Z=\angle X^{\prime} Y^{\prime} Z^{\prime}$, so $\triangle X Y Z \sim \triangle X^{\prime} Y^{\prime} Z^{\prime}$. Thus there is a rotation $R$ which sends $\triangle X Y Z$ to a triangle with sides parallel to $\triangle X^{\prime} Y^{\prime} Z^{\prime}$. Since $A B=D E$ we have $R(\overrightarrow{A B})=\overrightarrow{D E}$. Similarly, $R(\overrightarrow{C D})=\overrightarrow{F A}$ and $R(\overrightarrow{E F})=\overrightarrow{B C}$. Therefore + +$$ +\overrightarrow{0}=\overrightarrow{A B}+\overrightarrow{B C}+\overrightarrow{C D}+\overrightarrow{D E}+\overrightarrow{E F}+\overrightarrow{F A}=(\overrightarrow{A B}+\overrightarrow{C D}+\overrightarrow{E F})+R(\overrightarrow{A B}+\overrightarrow{C D}+\overrightarrow{E F}) +$$ + +If $R$ is a rotation by $180^{\circ}$, then any two opposite sides of our hexagon are equal and parallel, so the three diagonals meet at their common midpoint. Otherwise, we must have + +$$ +\overrightarrow{A B}+\overrightarrow{C D}+\overrightarrow{E F}=\overrightarrow{0} +$$ + +or else we would have two vectors with different directions whose sum is $\overrightarrow{0}$. + + + +This allows us to consider a triangle $L M N$ with $\overrightarrow{L M}=\overrightarrow{E F}, \overrightarrow{M N}=\overrightarrow{A B}$, and $\overrightarrow{N L}=\overrightarrow{C D}$. Let $O$ be the circumcenter of $\triangle L M N$ and consider the points $O_{1}, O_{2}, O_{3}$ such that $\triangle A O_{1} B, \triangle C O_{2} D$, and $\triangle E O_{3} F$ are translations of $\triangle M O N, \triangle N O L$, and $\triangle L O M$, respectively. Since $F O_{3}$ and $A O_{1}$ are translations of $M O$, quadrilateral $A F O_{3} O_{1}$ is a parallelogram and $O_{3} O_{1}=F A=C D=N L$. Similarly, $O_{1} O_{2}=L M$ and $O_{2} O_{3}=M N$. Therefore $\triangle O_{1} O_{2} O_{3} \cong \triangle L M N$. Moreover, by means of the rotation $R$ one may check that these triangles have the same orientation. + +Let $T$ be the circumcenter of $\triangle O_{1} O_{2} O_{3}$. We claim that $A D, B E$, and $C F$ meet at $T$. Let us show that $C, T$, and $F$ are collinear. Notice that $C O_{2}=O_{2} T=T O_{3}=O_{3} F$ since they are all equal to the circumradius of $\triangle L M N$. Therefore $\triangle T O_{3} F$ and $\triangle C O_{2} T$ are isosceles. Using directed angles between rays again, we get + +$$ +\Varangle\left(T F, T O_{3}\right)=\Varangle\left(F O_{3}, F T\right) \quad \text { and } \quad \Varangle\left(T O_{2}, T C\right)=\Varangle\left(C T, C O_{2}\right) \text {. } +$$ + +Also, $T$ and $O$ are the circumcenters of the congruent triangles $\triangle O_{1} O_{2} O_{3}$ and $\triangle L M N$ so we have $\Varangle\left(T O_{3}, T O_{2}\right)=\Varangle(O N, O M)$. Since $C_{2}$ and $F O_{3}$ are translations of $N O$ and $M O$ respectively, this implies + +$$ +\Varangle\left(T O_{3}, T O_{2}\right)=\Varangle\left(C O_{2}, F O_{3}\right) . +$$ + +Adding the three equations in (2) and (3) gives + +$$ +\Varangle(T F, T C)=\Varangle(C T, F T)=-\not(T F, T C) +$$ + +which implies that $T$ is on $C F$. Analogous arguments show that it is on $A D$ and $B E$ also. The desired result follows. + +Solution 3. Place the hexagon on the complex plane, with $A$ at the origin and vertices labelled clockwise. Now $A, B, C, D, E, F$ represent the corresponding complex numbers. Also consider the complex numbers $a, b, c, a^{\prime}, b^{\prime}, c^{\prime}$ given by $B-A=a, D-C=b, F-E=c, E-D=a^{\prime}$, $A-F=b^{\prime}$, and $C-B=c^{\prime}$. Let $k=|a| /|b|$. From $a / b^{\prime}=-k e^{i \angle A}$ and $a^{\prime} / b=-k e^{i \angle D}$ we get that $\left(a^{\prime} / a\right)\left(b^{\prime} / b\right)=e^{-i \theta}$ and similarly $\left(b^{\prime} / b\right)\left(c^{\prime} / c\right)=e^{-i \theta}$ and $\left(c^{\prime} / c\right)\left(a^{\prime} / a\right)=e^{-i \theta}$. It follows that $a^{\prime}=a r$, $b^{\prime}=b r$, and $c^{\prime}=c r$ for a complex number $r$ with $|r|=1$, as shown below. + + + +We have + +$$ +0=a+c r+b+a r+c+b r=(a+b+c)(1+r) . +$$ + +If $r=-1$, then the hexagon is centrally symmetric and its diagonals intersect at its center of symmetry. Otherwise + +$$ +a+b+c=0 \text {. } +$$ + +Therefore + +$$ +A=0, \quad B=a, \quad C=a+c r, \quad D=c(r-1), \quad E=-b r-c, \quad F=-b r . +$$ + +Now consider a point $W$ on $A D$ given by the complex number $c(r-1) \lambda$, where $\lambda$ is a real number with $0<\lambda<1$. Since $D \neq A$, we have $r \neq 1$, so we can define $s=1 /(r-1)$. From $r \bar{r}=|r|^{2}=1$ we get + +$$ +1+s=\frac{r}{r-1}=\frac{r}{r-r \bar{r}}=\frac{1}{1-\bar{r}}=-\bar{s} . +$$ + +Now, + +$$ +\begin{aligned} +W \text { is on } B E & \Longleftrightarrow c(r-1) \lambda-a\|a-(-b r-c)=b(r-1) \Longleftrightarrow c \lambda-a s\| b \\ +& \Longleftrightarrow-a \lambda-b \lambda-a s\|b \Longleftrightarrow a(\lambda+s)\| b . +\end{aligned} +$$ + +One easily checks that $r \neq \pm 1$ implies that $\lambda+s \neq 0$ since $s$ is not real. On the other hand, + +$$ +\begin{aligned} +W \text { on } C F & \Longleftrightarrow c(r-1) \lambda+b r\|-b r-(a+c r)=a(r-1) \Longleftrightarrow c \lambda+b(1+s)\| a \\ +& \Longleftrightarrow-a \lambda-b \lambda-b \bar{s}\|a \Longleftrightarrow b(\lambda+\bar{s})\| a \Longleftrightarrow b \| a(\lambda+s), +\end{aligned} +$$ + +where in the last step we use that $(\lambda+s)(\lambda+\bar{s})=|\lambda+s|^{2} \in \mathbb{R}_{>0}$. We conclude that $A D \cap B E=$ $C F \cap B E$, and the desired result follows. + +G6. Let the excircle of the triangle $A B C$ lying opposite to $A$ touch its side $B C$ at the point $A_{1}$. Define the points $B_{1}$ and $C_{1}$ analogously. Suppose that the circumcentre of the triangle $A_{1} B_{1} C_{1}$ lies on the circumcircle of the triangle $A B C$. Prove that the triangle $A B C$ is right-angled. + +(Russia) + +Solution 1. Denote the circumcircles of the triangles $A B C$ and $A_{1} B_{1} C_{1}$ by $\Omega$ and $\Gamma$, respectively. Denote the midpoint of the arc $C B$ of $\Omega$ containing $A$ by $A_{0}$, and define $B_{0}$ as well as $C_{0}$ analogously. By our hypothesis the centre $Q$ of $\Gamma$ lies on $\Omega$. + +Lemma. One has $A_{0} B_{1}=A_{0} C_{1}$. Moreover, the points $A, A_{0}, B_{1}$, and $C_{1}$ are concyclic. Finally, the points $A$ and $A_{0}$ lie on the same side of $B_{1} C_{1}$. Similar statements hold for $B$ and $C$. + +Proof. Let us consider the case $A=A_{0}$ first. Then the triangle $A B C$ is isosceles at $A$, which implies $A B_{1}=A C_{1}$ while the remaining assertions of the Lemma are obvious. So let us suppose $A \neq A_{0}$ from now on. + +By the definition of $A_{0}$, we have $A_{0} B=A_{0} C$. It is also well known and easy to show that $B C_{1}=$ $C B_{1}$. Next, we have $\angle C_{1} B A_{0}=\angle A B A_{0}=\angle A C A_{0}=\angle B_{1} C A_{0}$. Hence the triangles $A_{0} B C_{1}$ and $A_{0} C B_{1}$ are congruent. This implies $A_{0} C_{1}=A_{0} B_{1}$, establishing the first part of the Lemma. It also follows that $\angle A_{0} C_{1} A=\angle A_{0} B_{1} A$, as these are exterior angles at the corresponding vertices $C_{1}$ and $B_{1}$ of the congruent triangles $A_{0} B C_{1}$ and $A_{0} C B_{1}$. For that reason the points $A, A_{0}, B_{1}$, and $C_{1}$ are indeed the vertices of some cyclic quadrilateral two opposite sides of which are $A A_{0}$ and $B_{1} C_{1}$. + +Now we turn to the solution. Evidently the points $A_{1}, B_{1}$, and $C_{1}$ lie interior to some semicircle arc of $\Gamma$, so the triangle $A_{1} B_{1} C_{1}$ is obtuse-angled. Without loss of generality, we will assume that its angle at $B_{1}$ is obtuse. Thus $Q$ and $B_{1}$ lie on different sides of $A_{1} C_{1}$; obviously, the same holds for the points $B$ and $B_{1}$. So, the points $Q$ and $B$ are on the same side of $A_{1} C_{1}$. + +Notice that the perpendicular bisector of $A_{1} C_{1}$ intersects $\Omega$ at two points lying on different sides of $A_{1} C_{1}$. By the first statement from the Lemma, both points $B_{0}$ and $Q$ are among these points of intersection; since they share the same side of $A_{1} C_{1}$, they coincide (see Figure 1). + + + +Figure 1 + +Now, by the first part of the Lemma again, the lines $Q A_{0}$ and $Q C_{0}$ are the perpendicular bisectors of $B_{1} C_{1}$ and $A_{1} B_{1}$, respectively. Thus + +$$ +\angle C_{1} B_{0} A_{1}=\angle C_{1} B_{0} B_{1}+\angle B_{1} B_{0} A_{1}=2 \angle A_{0} B_{0} B_{1}+2 \angle B_{1} B_{0} C_{0}=2 \angle A_{0} B_{0} C_{0}=180^{\circ}-\angle A B C +$$ + +recalling that $A_{0}$ and $C_{0}$ are the midpoints of the arcs $C B$ and $B A$, respectively. + +On the other hand, by the second part of the Lemma we have + +$$ +\angle C_{1} B_{0} A_{1}=\angle C_{1} B A_{1}=\angle A B C . +$$ + +From the last two equalities, we get $\angle A B C=90^{\circ}$, whereby the problem is solved. + +Solution 2. Let $Q$ again denote the centre of the circumcircle of the triangle $A_{1} B_{1} C_{1}$, that lies on the circumcircle $\Omega$ of the triangle $A B C$. We first consider the case where $Q$ coincides with one of the vertices of $A B C$, say $Q=B$. Then $B C_{1}=B A_{1}$ and consequently the triangle $A B C$ is isosceles at $B$. Moreover we have $B C_{1}=B_{1} C$ in any triangle, and hence $B B_{1}=B C_{1}=B_{1} C$; similarly, $B B_{1}=B_{1} A$. It follows that $B_{1}$ is the centre of $\Omega$ and that the triangle $A B C$ has a right angle at $B$. + +So from now on we may suppose $Q \notin\{A, B, C\}$. We start with the following well known fact. Lemma. Let $X Y Z$ and $X^{\prime} Y^{\prime} Z^{\prime}$ be two triangles with $X Y=X^{\prime} Y^{\prime}$ and $Y Z=Y^{\prime} Z^{\prime}$. + +(i) If $X Z \neq X^{\prime} Z^{\prime}$ and $\angle Y Z X=\angle Y^{\prime} Z^{\prime} X^{\prime}$, then $\angle Z X Y+\angle Z^{\prime} X^{\prime} Y^{\prime}=180^{\circ}$. + +(ii) If $\angle Y Z X+\angle X^{\prime} Z^{\prime} Y^{\prime}=180^{\circ}$, then $\angle Z X Y=\angle Y^{\prime} X^{\prime} Z^{\prime}$. + +Proof. For both parts, we may move the triangle $X Y Z$ through the plane until $Y=Y^{\prime}$ and $Z=Z^{\prime}$. Possibly after reflecting one of the two triangles about $Y Z$, we may also suppose that $X$ and $X^{\prime}$ lie on the same side of $Y Z$ if we are in case (i) and on different sides if we are in case (ii). In both cases, the points $X, Z$, and $X^{\prime}$ are collinear due to the angle condition (see Fig. 2). Moreover we have $X \neq X^{\prime}$, because in case (i) we assumed $X Z \neq X^{\prime} Z^{\prime}$ and in case (ii) these points even lie on different sides of $Y Z$. Thus the triangle $X X^{\prime} Y$ is isosceles at $Y$. The claim now follows by considering the equal angles at its base. + + + +Figure 2(i) + + + +Figure 2(ii) + +Relabeling the vertices of the triangle $A B C$ if necessary we may suppose that $Q$ lies in the interior of the arc $A B$ of $\Omega$ not containing $C$. We will sometimes use tacitly that the six triangles $Q B A_{1}, Q A_{1} C, Q C B_{1}, Q B_{1} A, Q C_{1} A$, and $Q B C_{1}$ have the same orientation. + +As $Q$ cannot be the circumcentre of the triangle $A B C$, it is impossible that $Q A=Q B=Q C$ and thus we may also suppose that $Q C \neq Q B$. Now the above Lemma $(i)$ is applicable to the triangles $Q B_{1} C$ and $Q C_{1} B$, since $Q B_{1}=Q C_{1}$ and $B_{1} C=C_{1} B$, while $\angle B_{1} C Q=\angle C_{1} B Q$ holds as both angles appear over the same side of the chord $Q A$ in $\Omega$ (see Fig. 3). So we get + +$$ +\angle C Q B_{1}+\angle B Q C_{1}=180^{\circ} . +$$ + +We claim that $Q C=Q A$. To see this, let us assume for the sake of a contradiction that $Q C \neq Q A$. Then arguing similarly as before but now with the triangles $Q A_{1} C$ and $Q C_{1} A$ we get + +$$ +\angle A_{1} Q C+\angle C_{1} Q A=180^{\circ} \text {. } +$$ + +Adding this equation to (1), we get $\angle A_{1} Q B_{1}+\angle B Q A=360^{\circ}$, which is absurd as both summands lie in the interval $\left(0^{\circ}, 180^{\circ}\right)$. + +This proves $Q C=Q A$; so the triangles $Q A_{1} C$ and $Q C_{1} A$ are congruent their sides being equal, which in turn yields + +$$ +\angle A_{1} Q C=\angle C_{1} Q A \text {. } +$$ + +Finally our Lemma (ii) is applicable to the triangles $Q A_{1} B$ and $Q B_{1} A$. Indeed we have $Q A_{1}=Q B_{1}$ and $A_{1} B=B_{1} A$ as usual, and the angle condition $\angle A_{1} B Q+\angle Q A B_{1}=180^{\circ}$ holds as $A$ and $B$ lie on different sides of the chord $Q C$ in $\Omega$. Consequently we have + +$$ +\angle B Q A_{1}=\angle B_{1} Q A \text {. } +$$ + +From (1) and (3) we get + +$$ +\left(\angle B_{1} Q C+\angle B_{1} Q A\right)+\left(\angle C_{1} Q B-\angle B Q A_{1}\right)=180^{\circ} \text {, } +$$ + +i.e. $\angle C Q A+\angle A_{1} Q C_{1}=180^{\circ}$. In light of (2) this may be rewritten as $2 \angle C Q A=180^{\circ}$ and as $Q$ lies on $\Omega$ this implies that the triangle $A B C$ has a right angle at $B$. + + + +Figure 3 + +Comment 1. One may also check that $Q$ is in the interior of $\Omega$ if and only if the triangle $A B C$ is acute-angled. + +Comment 2. The original proposal asked to prove the converse statement as well: if the triangle $A B C$ is right-angled, then the point $Q$ lies on its circumcircle. The Problem Selection Committee thinks that the above simplified version is more suitable for the competition. + +## Number Theory + +N1. Let $\mathbb{Z}_{>0}$ be the set of positive integers. Find all functions $f: \mathbb{Z}_{>0} \rightarrow \mathbb{Z}_{>0}$ such that + +$$ +m^{2}+f(n) \mid m f(m)+n +$$ + +for all positive integers $m$ and $n$. + +(Malaysia) + +Answer. $f(n)=n$. + +Solution 1. Setting $m=n=2$ tells us that $4+f(2) \mid 2 f(2)+2$. Since $2 f(2)+2<2(4+f(2))$, we must have $2 f(2)+2=4+f(2)$, so $f(2)=2$. Plugging in $m=2$ then tells us that $4+f(n) \mid 4+n$, which implies that $f(n) \leqslant n$ for all $n$. + +Setting $m=n$ gives $n^{2}+f(n) \mid n f(n)+n$, so $n f(n)+n \geqslant n^{2}+f(n)$ which we rewrite as $(n-1)(f(n)-n) \geqslant 0$. Therefore $f(n) \geqslant n$ for all $n \geqslant 2$. This is trivially true for $n=1$ also. + +It follows that $f(n)=n$ for all $n$. This function obviously satisfies the desired property. + +Solution 2. Setting $m=f(n)$ we get $f(n)(f(n)+1) \mid f(n) f(f(n))+n$. This implies that $f(n) \mid n$ for all $n$. + +Now let $m$ be any positive integer, and let $p>2 m^{2}$ be a prime number. Note that $p>m f(m)$ also. Plugging in $n=p-m f(m)$ we learn that $m^{2}+f(n)$ divides $p$. Since $m^{2}+f(n)$ cannot equal 1, it must equal $p$. Therefore $p-m^{2}=f(n) \mid n=p-m f(m)$. But $p-m f(m) |f(n)-n|$. It follows that $f$ is the identity function. + +N2. Prove that for any pair of positive integers $k$ and $n$ there exist $k$ positive integers $m_{1}, m_{2}, \ldots, m_{k}$ such that + +$$ +1+\frac{2^{k}-1}{n}=\left(1+\frac{1}{m_{1}}\right)\left(1+\frac{1}{m_{2}}\right) \cdots\left(1+\frac{1}{m_{k}}\right) . +$$ + +(Japan) + +Solution 1. We proceed by induction on $k$. For $k=1$ the statement is trivial. Assuming we have proved it for $k=j-1$, we now prove it for $k=j$. + +Case 1. $n=2 t-1$ for some positive integer $t$. + +Observe that + +$$ +1+\frac{2^{j}-1}{2 t-1}=\frac{2\left(t+2^{j-1}-1\right)}{2 t} \cdot \frac{2 t}{2 t-1}=\left(1+\frac{2^{j-1}-1}{t}\right)\left(1+\frac{1}{2 t-1}\right) . +$$ + +By the induction hypothesis we can find $m_{1}, \ldots, m_{j-1}$ such that + +$$ +1+\frac{2^{j-1}-1}{t}=\left(1+\frac{1}{m_{1}}\right)\left(1+\frac{1}{m_{2}}\right) \cdots\left(1+\frac{1}{m_{j-1}}\right) +$$ + +so setting $m_{j}=2 t-1$ gives the desired expression. + +Case 2. $n=2 t$ for some positive integer $t$. + +Now we have + +$$ +1+\frac{2^{j}-1}{2 t}=\frac{2 t+2^{j}-1}{2 t+2^{j}-2} \cdot \frac{2 t+2^{j}-2}{2 t}=\left(1+\frac{1}{2 t+2^{j}-2}\right)\left(1+\frac{2^{j-1}-1}{t}\right) +$$ + +noting that $2 t+2^{j}-2>0$. Again, we use that + +$$ +1+\frac{2^{j-1}-1}{t}=\left(1+\frac{1}{m_{1}}\right)\left(1+\frac{1}{m_{2}}\right) \cdots\left(1+\frac{1}{m_{j-1}}\right) . +$$ + +Setting $m_{j}=2 t+2^{j}-2$ then gives the desired expression. + +Solution 2. Consider the base 2 expansions of the residues of $n-1$ and $-n$ modulo $2^{k}$ : + +$$ +\begin{aligned} +n-1 & \equiv 2^{a_{1}}+2^{a_{2}}+\cdots+2^{a_{r}}\left(\bmod 2^{k}\right) & & \text { where } 0 \leqslant a_{1}
q_{n-1} \text { and } q_{n}>q_{n+1}\right\} +$$ + +is infinite, since for each $n \in S$ one has + +$$ +p_{n}=\max \left\{q_{n}, q_{n-1}\right\}=q_{n}=\max \left\{q_{n}, q_{n+1}\right\}=p_{n+1} . +$$ + +Suppose on the contrary that $S$ is finite. Since $q_{2}=7<13=q_{3}$ and $q_{3}=13>7=q_{4}$, the set $S$ is non-empty. Since it is finite, we can consider its largest element, say $m$. + +Note that it is impossible that $q_{m}>q_{m+1}>q_{m+2}>\ldots$ because all these numbers are positive integers, so there exists a $k \geqslant m$ such that $q_{k} q_{\ell+1}$. By the minimality of $\ell$ we have $q_{\ell-1} k \geqslant m$, this contradicts the maximality of $m$, and hence $S$ is indeed infinite. + +Comment. Once the factorization of $n^{4}+n^{2}+1$ is found and the set $S$ is introduced, the problem is mainly about ruling out the case that + +$$ +q_{k} 0}$. In the above solution, this is done by observing $q_{(k+1)^{2}}=\max \left(q_{k}, q_{k+1}\right)$. Alternatively one may notice that (1) implies that $q_{j+2}-q_{j} \geqslant 6$ for $j \geqslant k+1$, since every prime greater than 3 is congruent to -1 or 1 modulo 6 . Then there is some integer $C \geqslant 0$ such that $q_{n} \geqslant 3 n-C$ for all $n \geqslant k$. + +Now let the integer $t$ be sufficiently large (e.g. $t=\max \{k+1, C+3\}$ ) and set $p=q_{t-1} \geqslant 2 t$. Then $p \mid(t-1)^{2}+(t-1)+1$ implies that $p \mid(p-t)^{2}+(p-t)+1$, so $p$ and $q_{p-t}$ are prime divisors of $(p-t)^{2}+(p-t)+1$. But $p-t>t-1 \geqslant k$, so $q_{p-t}>q_{t-1}=p$ and $p \cdot q_{p-t}>p^{2}>(p-t)^{2}+(p-t)+1$, a contradiction. + +N4. Determine whether there exists an infinite sequence of nonzero digits $a_{1}, a_{2}, a_{3}, \ldots$ and a positive integer $N$ such that for every integer $k>N$, the number $\overline{a_{k} a_{k-1} \ldots a_{1}}$ is a perfect square. + +(Iran) + +Answer. No. + +Solution. Assume that $a_{1}, a_{2}, a_{3}, \ldots$ is such a sequence. For each positive integer $k$, let $y_{k}=$ $\overline{a_{k} a_{k-1} \ldots a_{1}}$. By the assumption, for each $k>N$ there exists a positive integer $x_{k}$ such that $y_{k}=x_{k}^{2}$. + +I. For every $n$, let $5^{\gamma_{n}}$ be the greatest power of 5 dividing $x_{n}$. Let us show first that $2 \gamma_{n} \geqslant n$ for every positive integer $n>N$. + +Assume, to the contrary, that there exists a positive integer $n>N$ such that $2 \gamma_{n} N$. + +II. Consider now any integer $k>\max \{N / 2,2\}$. Since $2 \gamma_{2 k+1} \geqslant 2 k+1$ and $2 \gamma_{2 k+2} \geqslant 2 k+2$, we have $\gamma_{2 k+1} \geqslant k+1$ and $\gamma_{2 k+2} \geqslant k+1$. So, from $y_{2 k+2}=a_{2 k+2} \cdot 10^{2 k+1}+y_{2 k+1}$ we obtain $5^{2 k+2} \mid y_{2 k+2}-y_{2 k+1}=a_{2 k+2} \cdot 10^{2 k+1}$ and thus $5 \mid a_{2 k+2}$, which implies $a_{2 k+2}=5$. Therefore, + +$$ +\left(x_{2 k+2}-x_{2 k+1}\right)\left(x_{2 k+2}+x_{2 k+1}\right)=x_{2 k+2}^{2}-x_{2 k+1}^{2}=y_{2 k+2}-y_{2 k+1}=5 \cdot 10^{2 k+1}=2^{2 k+1} \cdot 5^{2 k+2} . +$$ + +Setting $A_{k}=x_{2 k+2} / 5^{k+1}$ and $B_{k}=x_{2 k+1} / 5^{k+1}$, which are integers, we obtain + +$$ +\left(A_{k}-B_{k}\right)\left(A_{k}+B_{k}\right)=2^{2 k+1} . +$$ + +Both $A_{k}$ and $B_{k}$ are odd, since otherwise $y_{2 k+2}$ or $y_{2 k+1}$ would be a multiple of 10 which is false by $a_{1} \neq 0$; so one of the numbers $A_{k}-B_{k}$ and $A_{k}+B_{k}$ is not divisible by 4 . Therefore (1) yields $A_{k}-B_{k}=2$ and $A_{k}+B_{k}=2^{2 k}$, hence $A_{k}=2^{2 k-1}+1$ and thus + +$$ +x_{2 k+2}=5^{k+1} A_{k}=10^{k+1} \cdot 2^{k-2}+5^{k+1}>10^{k+1}, +$$ + +since $k \geqslant 2$. This implies that $y_{2 k+2}>10^{2 k+2}$ which contradicts the fact that $y_{2 k+2}$ contains $2 k+2$ digits. The desired result follows. + +Solution 2. Again, we assume that a sequence $a_{1}, a_{2}, a_{3}, \ldots$ satisfies the problem conditions, introduce the numbers $x_{k}$ and $y_{k}$ as in the previous solution, and notice that + +$$ +y_{k+1}-y_{k}=\left(x_{k+1}-x_{k}\right)\left(x_{k+1}+x_{k}\right)=10^{k} a_{k+1} +$$ + +for all $k>N$. Consider any such $k$. Since $a_{1} \neq 0$, the numbers $x_{k}$ and $x_{k+1}$ are not multiples of 10 , and therefore the numbers $p_{k}=x_{k+1}-x_{k}$ and $q_{k}=x_{k+1}+x_{k}$ cannot be simultaneously multiples of 20 , and hence one of them is not divisible either by 4 or by 5 . In view of (2), this means that the other one is divisible by either $5^{k}$ or by $2^{k-1}$. Notice also that $p_{k}$ and $q_{k}$ have the same parity, so both are even. + +On the other hand, we have $x_{k+1}^{2}=x_{k}^{2}+10^{k} a_{k+1} \geqslant x_{k}^{2}+10^{k}>2 x_{k}^{2}$, so $x_{k+1} / x_{k}>\sqrt{2}$, which implies that + +$$ +1<\frac{q_{k}}{p_{k}}=1+\frac{2}{x_{k+1} / x_{k}-1}<1+\frac{2}{\sqrt{2}-1}<6 . +$$ + +Thus, if one of the numbers $p_{k}$ and $q_{k}$ is divisible by $5^{k}$, then we have + +$$ +10^{k+1}>10^{k} a_{k+1}=p_{k} q_{k} \geqslant \frac{\left(5^{k}\right)^{2}}{6} +$$ + +and hence $(5 / 2)^{k}<60$ which is false for sufficiently large $k$. So, assuming that $k$ is large, we get that $2^{k-1}$ divides one of the numbers $p_{k}$ and $q_{k}$. Hence + +$$ +\left\{p_{k}, q_{k}\right\}=\left\{2^{k-1} \cdot 5^{r_{k}} b_{k}, 2 \cdot 5^{k-r_{k}} c_{k}\right\} \quad \text { with nonnegative integers } b_{k}, c_{k}, r_{k} \text { such that } b_{k} c_{k}=a_{k+1} \text {. } +$$ + +Moreover, from (3) we get + +$$ +6>\frac{2^{k-1} \cdot 5^{r_{k}} b_{k}}{2 \cdot 5^{k-r_{k}} c_{k}} \geqslant \frac{1}{36} \cdot\left(\frac{2}{5}\right)^{k} \cdot 5^{2 r_{k}} \quad \text { and } \quad 6>\frac{2 \cdot 5^{k-r_{k}} c_{k}}{2^{k-1} \cdot 5^{r_{k}} b_{k}} \geqslant \frac{4}{9} \cdot\left(\frac{5}{2}\right)^{k} \cdot 5^{-2 r_{k}} +$$ + +SO + +$$ +\alpha k+c_{1} c_{1} \text {. } +$$ + +Consequently, for $C=c_{2}-c_{1}+1-\alpha>0$ we have + +$$ +(k+1)-r_{k+1} \leqslant k-r_{k}+C . +$$ + +Next, we will use the following easy lemma. + +Lemma. Let $s$ be a positive integer. Then $5^{s+2^{s}} \equiv 5^{s}\left(\bmod 10^{s}\right)$. + +Proof. Euler's theorem gives $5^{2^{s}} \equiv 1\left(\bmod 2^{s}\right)$, so $5^{s+2^{s}}-5^{s}=5^{s}\left(5^{2^{s}}-1\right)$ is divisible by $2^{s}$ and $5^{s}$. + +Now, for every large $k$ we have + +$$ +x_{k+1}=\frac{p_{k}+q_{k}}{2}=5^{r_{k}} \cdot 2^{k-2} b_{k}+5^{k-r_{k}} c_{k} \equiv 5^{k-r_{k}} c_{k} \quad\left(\bmod 10^{r_{k}}\right) +$$ + +since $r_{k} \leqslant k-2$ by $(4)$; hence $y_{k+1} \equiv 5^{2\left(k-r_{k}\right)} c_{k}^{2}\left(\bmod 10^{r_{k}}\right)$. Let us consider some large integer $s$, and choose the minimal $k$ such that $2\left(k-r_{k}\right) \geqslant s+2^{s}$; it exists by (4). Set $d=2\left(k-r_{k}\right)-\left(s+2^{s}\right)$. By (4) we have $2^{s}<2\left(k-r_{k}\right)<\left(\frac{2}{\alpha}-2\right) r_{k}-\frac{2 c_{1}}{\alpha}$; if $s$ is large this implies $r_{k}>s$, so (6) also holds modulo $10^{s}$. Then (6) and the lemma give + +$$ +y_{k+1} \equiv 5^{2\left(k-r_{k}\right)} c_{k}^{2}=5^{s+2^{s}} \cdot 5^{d} c_{k}^{2} \equiv 5^{s} \cdot 5^{d} c_{k}^{2} \quad\left(\bmod 10^{s}\right) . +$$ + +By (5) and the minimality of $k$ we have $d \leqslant 2 C$, so $5^{d} c_{k}^{2} \leqslant 5^{2 C} \cdot 81=D$. Using $5^{4}<10^{3}$ we obtain + +$$ +5^{s} \cdot 5^{d} c_{k}^{2}<10^{3 s / 4} D<10^{s-1} +$$ + +for sufficiently large $s$. This, together with (7), shows that the sth digit from the right in $y_{k+1}$, which is $a_{s}$, is zero. This contradicts the problem condition. + +N5. Fix an integer $k \geqslant 2$. Two players, called Ana and Banana, play the following game of numbers: Initially, some integer $n \geqslant k$ gets written on the blackboard. Then they take moves in turn, with Ana beginning. A player making a move erases the number $m$ just written on the blackboard and replaces it by some number $m^{\prime}$ with $k \leqslant m^{\prime} m \geqslant k$ and $\operatorname{gcd}(m, n)=1$, then $n$ itself is bad, for Ana has the following winning strategy in the game with initial number $n$ : She proceeds by first playing $m$ and then using Banana's strategy for the game with starting number $m$. + +Otherwise, if some integer $n \geqslant k$ has the property that every integer $m$ with $n>m \geqslant k$ and $\operatorname{gcd}(m, n)=1$ is bad, then $n$ is good. Indeed, if Ana can make a first move at all in the game with initial number $n$, then she leaves it in a position where the first player has a winning strategy, so that Banana can defeat her. + +In particular, this implies that any two good numbers have a non-trivial common divisor. Also, $k$ itself is good. + +For brevity, we say that $n \longrightarrow x$ is a move if $n$ and $x$ are two coprime integers with $n>x \geqslant k$. + +Claim 1. If $n$ is good and $n^{\prime}$ is a multiple of $n$, then $n^{\prime}$ is also good. + +Proof. If $n^{\prime}$ were bad, there would have to be some move $n^{\prime} \longrightarrow x$, where $x$ is good. As $n^{\prime}$ is a multiple of $n$ this implies that the two good numbers $n$ and $x$ are coprime, which is absurd. + +Claim 2. If $r$ and $s$ denote two positive integers for which $r s \geqslant k$ is bad, then $r^{2} s$ is also bad. + +Proof. Since $r s$ is bad, there is a move $r s \longrightarrow x$ for some good $x$. Evidently $x$ is coprime to $r^{2} s$ as well, and hence the move $r^{2} s \longrightarrow x$ shows that $r^{2} s$ is indeed bad. + +Claim 3. If $p>k$ is prime and $n \geqslant k$ is bad, then $n p$ is also bad. + +Proof. Otherwise we choose a counterexample with $n$ being as small as possible. In particular, $n p$ is good. Since $n$ is bad, there is a move $n \longrightarrow x$ for some good $x$. Now $n p \longrightarrow x$ cannot be a valid move, which tells us that $x$ has to be divisible by $p$. So we can write $x=p^{r} y$, where $r$ and $y$ denote some positive integers, the latter of which is not divisible by $p$. + +Note that $y=1$ is impossible, for then we would have $x=p^{r}$ and the move $x \longrightarrow k$ would establish that $x$ is bad. In view of this, there is a least power $y^{\alpha}$ of $y$ that is at least as large as $k$. Since the numbers $n p$ and $y^{\alpha}$ are coprime and the former is good, the latter has to be bad. Moreover, the minimality of $\alpha$ implies $y^{\alpha} k$, but now we get the same contradiction using Claim 3 instead of Claim 2 . Thereby the problem is solved. + +Solution 2. We use the same analysis of the game of numbers as in the first five paragraphs of the first solution. Let us call a prime number $p$ small in case $p \leqslant k$ and big otherwise. We again call two integers similar if their sets of small prime factors coincide. + +Claim 4. For each integer $b \geqslant k$ having some small prime factor, there exists an integer $x$ similar to it with $b \geqslant x \geqslant k$ and having no big prime factors. + +Proof. Unless $b$ has a big prime factor we may simply choose $x=b$. Now let $p$ and $q$ denote a small and a big prime factor of $b$, respectively. Let $a$ be the product of all small prime factors of $b$. Further define $n$ to be the least non-negative integer for which the number $x=p^{n} a$ is at least as large as $k$. It suffices to show that $b>x$. This is clear in case $n=0$, so let us assume $n>0$ from now on. Then we have $x b$. Applying Claim 4 to $b$ we get an integer $x$ with $b \geqslant x \geqslant k$ that is similar to $b$ and has no big prime divisors at all. By our assumption, $b^{\prime}$ and $x$ are coprime, and as $b^{\prime}$ is good this implies that $x$ is bad. Consequently there has to be some move $x \longrightarrow b^{*}$ such that $b^{*}$ is good. But now all the small prime factors of $b$ also appear in $x$ and thus they cannot divide $b^{*}$. Therefore the pair $\left(b^{*}, b\right)$ contradicts the supposed minimality of $b^{\prime}$. + +From that point, it is easy to complete the solution: assume that there are two similar integers $a$ and $b$ such that $a$ is bad and $b$ is good. Since $a$ is bad, there is a move $a \longrightarrow b^{\prime}$ for some good $b^{\prime}$. By Claim 5, there is a small prime $p$ dividing $b$ and $b^{\prime}$. Due to the similarity of $a$ and $b$, the prime $p$ has to divide $a$ as well, but this contradicts the fact that $a \longrightarrow b^{\prime}$ is a valid move. Thereby the problem is solved. + +Comment 2. There are infinitely many good numbers, e.g. all multiples of $k$. The increasing sequence $b_{0}, b_{1}, \ldots$, of all good numbers may be constructed recursively as follows: + +- Start with $b_{0}=k$. +- If $b_{n}$ has just been defined for some $n \geqslant 0$, then $b_{n+1}$ is the smallest number $b>b_{n}$ that is coprime to none of $b_{0}, \ldots, b_{n}$. + +This construction can be used to determine the set of good numbers for any specific $k$ as explained in the next comment. It is already clear that if $k=p^{\alpha}$ is a prime power, then a number $b \geqslant k$ is good if and only if it is divisible by $p$. + +Comment 3. Let $P>1$ denote the product of all small prime numbers. Then any two integers $a, b \geqslant k$ that are congruent modulo $P$ are similar. Thus the infinite word $W_{k}=\left(X_{k}, X_{k+1}, \ldots\right)$ defined by + +$$ +X_{i}= \begin{cases}A & \text { if } i \text { is bad } \\ B & \text { if } i \text { is good }\end{cases} +$$ + +for all $i \geqslant k$ is periodic and the length of its period divides $P$. As the prime power example shows, the true period can sometimes be much smaller than $P$. On the other hand, there are cases where the period is rather large; e.g., if $k=15$, the sequence of good numbers begins with 15,18,20,24,30,36,40,42, 45 and the period of $W_{15}$ is 30 . + +Comment 4. The original proposal contained two questions about the game of numbers, namely $(a)$ to show that if two numbers have the same prime factors then either both are good or both are bad, and (b) to show that the word $W_{k}$ introduced in the previous comment is indeed periodic. The Problem Selection Committee thinks that the above version of the problem is somewhat easier, even though it demands to prove a stronger result. + +N6. Determine all functions $f: \mathbb{Q} \longrightarrow \mathbb{Z}$ satisfying + +$$ +f\left(\frac{f(x)+a}{b}\right)=f\left(\frac{x+a}{b}\right) +$$ + +for all $x \in \mathbb{Q}, a \in \mathbb{Z}$, and $b \in \mathbb{Z}_{>0}$. (Here, $\mathbb{Z}_{>0}$ denotes the set of positive integers.) + +(Israel) + +Answer. There are three kinds of such functions, which are: all constant functions, the floor function, and the ceiling function. + +Solution 1. I. We start by verifying that these functions do indeed satisfy (1). This is clear for all constant functions. Now consider any triple $(x, a, b) \in \mathbb{Q} \times \mathbb{Z} \times \mathbb{Z}_{>0}$ and set + +$$ +q=\left\lfloor\frac{x+a}{b}\right\rfloor . +$$ + +This means that $q$ is an integer and $b q \leqslant x+a0}$. According to the behaviour of the restriction of $f$ to the integers we distinguish two cases. + +Case 1: There is some $m \in \mathbb{Z}$ such that $f(m) \neq m$. + +Write $f(m)=C$ and let $\eta \in\{-1,+1\}$ and $b$ denote the sign and absolute value of $f(m)-m$, respectively. Given any integer $r$, we may plug the triple $(m, r b-C, b)$ into (1), thus getting $f(r)=f(r-\eta)$. Starting with $m$ and using induction in both directions, we deduce from this that the equation $f(r)=C$ holds for all integers $r$. Now any rational number $y$ can be written in the form $y=\frac{p}{q}$ with $(p, q) \in \mathbb{Z} \times \mathbb{Z}_{>0}$, and substituting $(C-p, p-C, q)$ into (1) we get $f(y)=f(0)=C$. Thus $f$ is the constant function whose value is always $C$. + +Case 2: One has $f(m)=m$ for all integers $m$. + +Note that now the special case $b=1$ of (1) takes a particularly simple form, namely + +$$ +f(x)+a=f(x+a) \quad \text { for all }(x, a) \in \mathbb{Q} \times \mathbb{Z} +$$ + +Defining $f\left(\frac{1}{2}\right)=\omega$ we proceed in three steps. + +Step $A$. We show that $\omega \in\{0,1\}$. + +If $\omega \leqslant 0$, we may plug $\left(\frac{1}{2},-\omega, 1-2 \omega\right)$ into (1), obtaining $0=f(0)=f\left(\frac{1}{2}\right)=\omega$. In the contrary case $\omega \geqslant 1$ we argue similarly using the triple $\left(\frac{1}{2}, \omega-1,2 \omega-1\right)$. + +Step B. We show that $f(x)=\omega$ for all rational numbers $x$ with $0
b \geqslant k+\omega$, which is absurd. Similarly, $m \geqslant r$ leads to $r a-m b0} +$$ + +Now suppose first that $x$ is not an integer but can be written in the form $\frac{p}{q}$ with $p \in \mathbb{Z}$ and $q \in \mathbb{Z}_{>0}$ both being odd. Let $d$ denote the multiplicative order of 2 modulo $q$ and let $m$ be any large integer. Plugging $n=d m$ into (6) and using (2) we get + +$$ +f(x)=\left[\frac{f\left(2^{d m} x\right)}{2^{d m}}\right]=\left[\frac{f(x)+\left(2^{d m}-1\right) x}{2^{d m}}\right]=\left[x+\frac{f(x)-x}{2^{d m}}\right] . +$$ + +Since $x$ is not an integer, the square bracket function is continuous at $x$; hence as $m$ tends to infinity the above fomula gives $f(x)=[x]$. To complete the argument we just need to observe that if some $y \in \mathbb{Q}$ satisfies $f(y)=[y]$, then (5) yields $f\left(\frac{y}{2}\right)=f\left(\frac{[y]}{2}\right)=\left[\frac{[y]}{2}\right]=\left[\frac{y}{2}\right]$. + +Solution 2. Here we just give another argument for the second case of the above solution. Again we use equation (2). It follows that the set $S$ of all zeros of $f$ contains for each $x \in \mathbb{Q}$ exactly one term from the infinite sequence $\ldots, x-2, x-1, x, x+1, x+2, \ldots$. + +Next we claim that + +$$ +\text { if }(p, q) \in \mathbb{Z} \times \mathbb{Z}_{>0} \text { and } \frac{p}{q} \in S \text {, then } \frac{p}{q+1} \in S \text { holds as well. } +$$ + +To see this we just plug $\left(\frac{p}{q}, p, q+1\right)$ into (1), thus getting $f\left(\frac{p}{q+1}\right)=f\left(\frac{p}{q}\right)=0$. + +From this we get that + +$$ +\text { if } x, y \in \mathbb{Q}, x>y>0 \text {, and } x \in S \text {, then } y \in S \text {. } +$$ + +Indeed, if we write $x=\frac{p}{q}$ and $y=\frac{r}{s}$ with $p, q, r, s \in \mathbb{Z}_{>0}$, then $p s>q r$ and (7) tells us + +$$ +0=f\left(\frac{p}{q}\right)=f\left(\frac{p r}{q r}\right)=f\left(\frac{p r}{q r+1}\right)=\ldots=f\left(\frac{p r}{p s}\right)=f\left(\frac{r}{s}\right) +$$ + +Essentially the same argument also establishes that + +$$ +\text { if } x, y \in \mathbb{Q}, x 2 m$. Such a pair is necessarily a child of $(c, d-c)$, and thus a descendant of some pair $\left(c, d^{\prime}\right)$ with $m \{(b+k a) \nu\}=\left\{\left(b+k_{0} a\right) \nu\right\}+\left(k-k_{0}\right)\{a \nu\}$ for all $k>k_{0}$, which is absurd. + +Similarly, one can prove that $S_{m}$ contains finitely many pairs $(c, d)$ with $c>2 m$, thus finitely many elements at all. + +We are now prepared for proving the following crucial lemma. + +Lemma. Consider any pair $(a, b)$ with $f(a, b) \neq m$. Then the number $g(a, b)$ of its $m$-excellent descendants is equal to the number $h(a, b)$ of ways to represent the number $t=m-f(a, b)$ as $t=k a+\ell b$ with $k$ and $\ell$ being some nonnegative integers. + +Proof. We proceed by induction on the number $N$ of descendants of $(a, b)$ in $S_{m}$. If $N=0$ then clearly $g(a, b)=0$. Assume that $h(a, b)>0$; without loss of generality, we have $a \leqslant b$. Then, clearly, $m-f(a, b) \geqslant a$, so $f(a, b+a) \leqslant f(a, b)+a \leqslant m$ and $a \leqslant m$, hence $(a, b+a) \in S_{m}$ which is impossible. Thus in the base case we have $g(a, b)=h(a, b)=0$, as desired. + +Now let $N>0$. Assume that $f(a+b, b)=f(a, b)+b$ and $f(a, b+a)=f(a, b)$ (the other case is similar). If $f(a, b)+b \neq m$, then by the induction hypothesis we have + +$$ +g(a, b)=g(a+b, b)+g(a, b+a)=h(a+b, b)+h(a, b+a) +$$ + +Notice that both pairs $(a+b, b)$ and $(a, b+a)$ are descendants of $(a, b)$ and thus each of them has strictly less descendants in $S_{m}$ than $(a, b)$ does. + +Next, each one of the $h(a+b, b)$ representations of $m-f(a+b, b)=m-b-f(a, b)$ as the sum $k^{\prime}(a+b)+\ell^{\prime} b$ provides the representation $m-f(a, b)=k a+\ell b$ with $k=k^{\prime} 1} d=\sum_{d \mid m} d +$$ + +as required. + +Comment. Let us present a sketch of an outline of a different solution. The plan is to check that the number of excellent pairs does not depend on the (irrational) number $\nu$, and to find this number for some appropriate value of $\nu$. For that, we first introduce some geometrical language. We deal only with the excellent pairs $(a, b)$ with $a \neq b$. + +Part I. Given an irrational positive $\nu$, for every positive integer $n$ we introduce two integral points $F_{\nu}(n)=$ $(n,\lfloor n \nu\rfloor)$ and $C_{\nu}(n)=(n,\lceil n \nu\rceil)$ on the coordinate plane $O x y$. Then $(*)$ reads as $\left[O F_{\nu}(a) C_{\nu}(b)\right]=m / 2$; here $[\cdot]$ stands for the signed area. Next, we rewrite in these terms the condition on a pair $(a, b)$ to be excellent. Let $\ell_{\nu}, \ell_{\nu}^{+}$, and $\ell_{\nu}^{-}$be the lines determined by the equations $y=\nu x, y=\nu x+1$, and $y=\nu x-1$, respectively. + +a). Firstly, we deal with all excellent pairs $(a, b)$ with $aa$ is excellent exactly when $p_{\nu}(a)$ lies between $b-a$ and $b$, and the point of $f_{\nu}(a)$ with abscissa $b$ is integral (which means that this point is $C_{\nu}(b)$ ). + +Notice now that, if $p_{\nu}(a)>a$, then the number of excellent pairs of the form $(a, b)$ (with $b>a$ ) is $\operatorname{gcd}(a,\lfloor a \nu\rfloor)$. + + + +Figure 1 + + + +Figure 2 + +b). Analogously, considering the pairs $(a, b)$ with $a>b$, we fix the value of $b$, introduce the line $c_{\nu}(b)$ containing all the points $F$ with $\left[O F C_{\nu}(b)\right]=m / 2$, assume that this line contains an integral point (which means $\operatorname{gcd}(b,\lceil b \nu\rceil) \mid m$ ), and denote the common point of $c_{\nu}(b)$ and $\ell_{\nu}^{-}$by $Q_{\nu}(b)$, its abscissa being $q_{\nu}(b)$. Similarly to the previous case, we obtain that the pair $(a, b)$ is excellent exactly when $q_{\nu}(a)$ lies between $a-b$ and $a$, and the point of $c_{\nu}(b)$ with abscissa $a$ is integral (see Fig. 2). Again, if $q_{\nu}(b)>b$, then the number of excellent pairs of the form $(a, b)$ (with $a>b)$ is $\operatorname{gcd}(b,\lceil b \nu\rceil)$. + +Part II, sketchy. Having obtained such a description, one may check how the number of excellent pairs changes as $\nu$ grows. (Having done that, one may find this number for one appropriate value of $\nu$; for instance, it is relatively easy to make this calculation for $\nu \in\left(1,1+\frac{1}{m}\right)$.) + +Consider, for the initial value of $\nu$, some excellent pair $(a, t)$ with $a>t$. As $\nu$ grows, this pair eventually stops being excellent; this happens when the point $Q_{\nu}(t)$ passes through $F_{\nu}(a)$. At the same moment, the pair $(a+t, t)$ becomes excellent instead. + +This process halts when the point $Q_{\nu}(t)$ eventually disappears, i.e. when $\nu$ passes through the ratio of the coordinates of the point $T=C_{\nu}(t)$. Hence, the point $T$ afterwards is regarded as $F_{\nu}(t)$. Thus, all the old excellent pairs of the form $(a, t)$ with $a>t$ disappear; on the other hand, the same number of excellent pairs with the first element being $t$ just appear. + +Similarly, if some pair $(t, b)$ with $t0$. Show that there exists a positive integer $n$ such that + +$$ +\left(a_{n}-a_{n-1}\right)\left(b_{n}-b_{n-1}\right)<0 . +$$ + +(Denmark) +A3. For a sequence $x_{1}, x_{2}, \ldots, x_{n}$ of real numbers, we define its price as + +$$ +\max _{1 \leqslant i \leqslant n}\left|x_{1}+\cdots+x_{i}\right| +$$ + +Given $n$ real numbers, Dave and George want to arrange them into a sequence with a low price. Diligent Dave checks all possible ways and finds the minimum possible price $D$. Greedy George, on the other hand, chooses $x_{1}$ such that $\left|x_{1}\right|$ is as small as possible; among the remaining numbers, he chooses $x_{2}$ such that $\left|x_{1}+x_{2}\right|$ is as small as possible, and so on. Thus, in the $i^{\text {th }}$ step he chooses $x_{i}$ among the remaining numbers so as to minimise the value of $\left|x_{1}+x_{2}+\cdots+x_{i}\right|$. In each step, if several numbers provide the same value, George chooses one at random. Finally he gets a sequence with price $G$. + +Find the least possible constant $c$ such that for every positive integer $n$, for every collection of $n$ real numbers, and for every possible sequence that George might obtain, the resulting values satisfy the inequality $G \leqslant c D$. +(Georgia) +A4. Determine all functions $f: \mathbb{Z} \rightarrow \mathbb{Z}$ satisfying + +$$ +f(f(m)+n)+f(m)=f(n)+f(3 m)+2014 +$$ + +for all integers $m$ and $n$. + +A5. Consider all polynomials $P(x)$ with real coefficients that have the following property: for any two real numbers $x$ and $y$ one has + +$$ +\left|y^{2}-P(x)\right| \leqslant 2|x| \quad \text { if and only if } \quad\left|x^{2}-P(y)\right| \leqslant 2|y| +$$ + +Determine all possible values of $P(0)$. + +A6. Find all functions $f: \mathbb{Z} \rightarrow \mathbb{Z}$ such that + +$$ +n^{2}+4 f(n)=f(f(n))^{2} +$$ + +for all $n \in \mathbb{Z}$. + +## Combinatorics + +C1. Let $n$ points be given inside a rectangle $R$ such that no two of them lie on a line parallel to one of the sides of $R$. The rectangle $R$ is to be dissected into smaller rectangles with sides parallel to the sides of $R$ in such a way that none of these rectangles contains any of the given points in its interior. Prove that we have to dissect $R$ into at least $n+1$ smaller rectangles. +(Serbia) +C2. We have $2^{m}$ sheets of paper, with the number 1 written on each of them. We perform the following operation. In every step we choose two distinct sheets; if the numbers on the two sheets are $a$ and $b$, then we erase these numbers and write the number $a+b$ on both sheets. Prove that after $m 2^{m-1}$ steps, the sum of the numbers on all the sheets is at least $4^{m}$. +(Iran) +C3. Let $n \geqslant 2$ be an integer. Consider an $n \times n$ chessboard divided into $n^{2}$ unit squares. We call a configuration of $n$ rooks on this board happy if every row and every column contains exactly one rook. Find the greatest positive integer $k$ such that for every happy configuration of rooks, we can find a $k \times k$ square without a rook on any of its $k^{2}$ unit squares. +(Croatia) +C4. Construct a tetromino by attaching two $2 \times 1$ dominoes along their longer sides such that the midpoint of the longer side of one domino is a corner of the other domino. This construction yields two kinds of tetrominoes with opposite orientations. Let us call them Sand Z-tetrominoes, respectively. + + +S-tetrominoes + + +Z-tetrominoes + +Assume that a lattice polygon $P$ can be tiled with S-tetrominoes. Prove than no matter how we tile $P$ using only S- and Z-tetrominoes, we always use an even number of Z-tetrominoes. +(Hungary) +C5. Consider $n \geqslant 3$ lines in the plane such that no two lines are parallel and no three have a common point. These lines divide the plane into polygonal regions; let $\mathcal{F}$ be the set of regions having finite area. Prove that it is possible to colour $\lceil\sqrt{n / 2}\rceil$ of the lines blue in such a way that no region in $\mathcal{F}$ has a completely blue boundary. (For a real number $x,\lceil x\rceil$ denotes the least integer which is not smaller than $x$.) + +C6. We are given an infinite deck of cards, each with a real number on it. For every real number $x$, there is exactly one card in the deck that has $x$ written on it. Now two players draw disjoint sets $A$ and $B$ of 100 cards each from this deck. We would like to define a rule that declares one of them a winner. This rule should satisfy the following conditions: + +1. The winner only depends on the relative order of the 200 cards: if the cards are laid down in increasing order face down and we are told which card belongs to which player, but not what numbers are written on them, we can still decide the winner. +2. If we write the elements of both sets in increasing order as $A=\left\{a_{1}, a_{2}, \ldots, a_{100}\right\}$ and $B=\left\{b_{1}, b_{2}, \ldots, b_{100}\right\}$, and $a_{i}>b_{i}$ for all $i$, then $A$ beats $B$. +3. If three players draw three disjoint sets $A, B, C$ from the deck, $A$ beats $B$ and $B$ beats $C$, then $A$ also beats $C$. + +How many ways are there to define such a rule? Here, we consider two rules as different if there exist two sets $A$ and $B$ such that $A$ beats $B$ according to one rule, but $B$ beats $A$ according to the other. +(Russia) +C7. Let $M$ be a set of $n \geqslant 4$ points in the plane, no three of which are collinear. Initially these points are connected with $n$ segments so that each point in $M$ is the endpoint of exactly two segments. Then, at each step, one may choose two segments $A B$ and $C D$ sharing a common interior point and replace them by the segments $A C$ and $B D$ if none of them is present at this moment. Prove that it is impossible to perform $n^{3} / 4$ or more such moves. +(Russia) +C8. A card deck consists of 1024 cards. On each card, a set of distinct decimal digits is written in such a way that no two of these sets coincide (thus, one of the cards is empty). Two players alternately take cards from the deck, one card per turn. After the deck is empty, each player checks if he can throw out one of his cards so that each of the ten digits occurs on an even number of his remaining cards. If one player can do this but the other one cannot, the one who can is the winner; otherwise a draw is declared. + +Determine all possible first moves of the first player after which he has a winning strategy. +(Russia) +C9. There are $n$ circles drawn on a piece of paper in such a way that any two circles intersect in two points, and no three circles pass through the same point. Turbo the snail slides along the circles in the following fashion. Initially he moves on one of the circles in clockwise direction. Turbo always keeps sliding along the current circle until he reaches an intersection with another circle. Then he continues his journey on this new circle and also changes the direction of moving, i.e. from clockwise to anticlockwise or vice versa. + +Suppose that Turbo's path entirely covers all circles. Prove that $n$ must be odd. + +## Geometry + +G1. The points $P$ and $Q$ are chosen on the side $B C$ of an acute-angled triangle $A B C$ so that $\angle P A B=\angle A C B$ and $\angle Q A C=\angle C B A$. The points $M$ and $N$ are taken on the rays $A P$ and $A Q$, respectively, so that $A P=P M$ and $A Q=Q N$. Prove that the lines $B M$ and $C N$ intersect on the circumcircle of the triangle $A B C$. +(Georgia) +G2. Let $A B C$ be a triangle. The points $K, L$, and $M$ lie on the segments $B C, C A$, and $A B$, respectively, such that the lines $A K, B L$, and $C M$ intersect in a common point. Prove that it is possible to choose two of the triangles $A L M, B M K$, and $C K L$ whose inradii sum up to at least the inradius of the triangle $A B C$. +(Estonia) +G3. Let $\Omega$ and $O$ be the circumcircle and the circumcentre of an acute-angled triangle $A B C$ with $A B>B C$. The angle bisector of $\angle A B C$ intersects $\Omega$ at $M \neq B$. Let $\Gamma$ be the circle with diameter $B M$. The angle bisectors of $\angle A O B$ and $\angle B O C$ intersect $\Gamma$ at points $P$ and $Q$, respectively. The point $R$ is chosen on the line $P Q$ so that $B R=M R$. Prove that $B R \| A C$. (Here we always assume that an angle bisector is a ray.) +(Russia) +G4. Consider a fixed circle $\Gamma$ with three fixed points $A, B$, and $C$ on it. Also, let us fix a real number $\lambda \in(0,1)$. For a variable point $P \notin\{A, B, C\}$ on $\Gamma$, let $M$ be the point on the segment $C P$ such that $C M=\lambda \cdot C P$. Let $Q$ be the second point of intersection of the circumcircles of the triangles $A M P$ and $B M C$. Prove that as $P$ varies, the point $Q$ lies on a fixed circle. +(United Kingdom) +G5. Let $A B C D$ be a convex quadrilateral with $\angle B=\angle D=90^{\circ}$. Point $H$ is the foot of the perpendicular from $A$ to $B D$. The points $S$ and $T$ are chosen on the sides $A B$ and $A D$, respectively, in such a way that $H$ lies inside triangle $S C T$ and + +$$ +\angle S H C-\angle B S C=90^{\circ}, \quad \angle T H C-\angle D T C=90^{\circ} . +$$ + +Prove that the circumcircle of triangle $S H T$ is tangent to the line $B D$. +(Iran) +G6. Let $A B C$ be a fixed acute-angled triangle. Consider some points $E$ and $F$ lying on the sides $A C$ and $A B$, respectively, and let $M$ be the midpoint of $E F$. Let the perpendicular bisector of $E F$ intersect the line $B C$ at $K$, and let the perpendicular bisector of $M K$ intersect the lines $A C$ and $A B$ at $S$ and $T$, respectively. We call the pair $(E, F)$ interesting, if the quadrilateral $K S A T$ is cyclic. + +Suppose that the pairs $\left(E_{1}, F_{1}\right)$ and $\left(E_{2}, F_{2}\right)$ are interesting. Prove that + +$$ +\frac{E_{1} E_{2}}{A B}=\frac{F_{1} F_{2}}{A C} . +$$ + +G7. Let $A B C$ be a triangle with circumcircle $\Omega$ and incentre $I$. Let the line passing through $I$ and perpendicular to $C I$ intersect the segment $B C$ and the $\operatorname{arc} B C($ not containing $A)$ of $\Omega$ at points $U$ and $V$, respectively. Let the line passing through $U$ and parallel to $A I$ intersect $A V$ at $X$, and let the line passing through $V$ and parallel to $A I$ intersect $A B$ at $Y$. Let $W$ and $Z$ be the midpoints of $A X$ and $B C$, respectively. Prove that if the points $I, X$, and $Y$ are collinear, then the points $I, W$, and $Z$ are also collinear. + +## Number Theory + +N1. Let $n \geqslant 2$ be an integer, and let $A_{n}$ be the set + +$$ +A_{n}=\left\{2^{n}-2^{k} \mid k \in \mathbb{Z}, 0 \leqslant k 1$ be a given integer. Prove that infinitely many terms of the sequence $\left(a_{k}\right)_{k \geqslant 1}$, defined by + +$$ +a_{k}=\left\lfloor\frac{n^{k}}{k}\right\rfloor +$$ + +are odd. (For a real number $x,\lfloor x\rfloor$ denotes the largest integer not exceeding $x$.) +(Hong Kong) +N5. Find all triples $(p, x, y)$ consisting of a prime number $p$ and two positive integers $x$ and $y$ such that $x^{p-1}+y$ and $x+y^{p-1}$ are both powers of $p$. +(Belgium) +N6. Let $a_{1} 0$. + +Notice that + +$$ +n z_{n+1}-\left(z_{0}+z_{1}+\cdots+z_{n}\right)=(n+1) z_{n+1}-\left(z_{0}+z_{1}+\cdots+z_{n}+z_{n+1}\right)=-d_{n+1} +$$ + +so the second inequality in (1) is equivalent to $d_{n+1} \leqslant 0$. Therefore, we have to prove that there is a unique index $n \geqslant 1$ that satisfies $d_{n}>0 \geqslant d_{n+1}$. + +By its definition the sequence $d_{1}, d_{2}, \ldots$ consists of integers and we have + +$$ +d_{1}=\left(z_{0}+z_{1}\right)-1 \cdot z_{1}=z_{0}>0 +$$ + +From +$d_{n+1}-d_{n}=\left(\left(z_{0}+\cdots+z_{n}+z_{n+1}\right)-(n+1) z_{n+1}\right)-\left(\left(z_{0}+\cdots+z_{n}\right)-n z_{n}\right)=n\left(z_{n}-z_{n+1}\right)<0$ +we can see that $d_{n+1} d_{2}>\ldots$ of integers such that its first element $d_{1}$ is positive. The sequence must drop below 0 at some point, and thus there is a unique index $n$, that is the index of the last positive term, satisfying $d_{n}>0 \geqslant d_{n+1}$. + +Comment. Omitting the assumption that $z_{1}, z_{2}, \ldots$ are integers allows the numbers $d_{n}$ to be all positive. In such cases the desired $n$ does not exist. This happens for example if $z_{n}=2-\frac{1}{2^{n}}$ for all integers $n \geqslant 0$. + +A2. Define the function $f:(0,1) \rightarrow(0,1)$ by + +$$ +f(x)= \begin{cases}x+\frac{1}{2} & \text { if } x<\frac{1}{2} \\ x^{2} & \text { if } x \geqslant \frac{1}{2}\end{cases} +$$ + +Let $a$ and $b$ be two real numbers such that $00$. Show that there exists a positive integer $n$ such that + +$$ +\left(a_{n}-a_{n-1}\right)\left(b_{n}-b_{n-1}\right)<0 . +$$ + +(Denmark) +Solution. Note that + +$$ +f(x)-x=\frac{1}{2}>0 +$$ + +if $x<\frac{1}{2}$ and + +$$ +f(x)-x=x^{2}-x<0 +$$ + +if $x \geqslant \frac{1}{2}$. So if we consider $(0,1)$ as being divided into the two subintervals $I_{1}=\left(0, \frac{1}{2}\right)$ and $I_{2}=\left[\frac{1}{2}, 1\right)$, the inequality + +$$ +\left(a_{n}-a_{n-1}\right)\left(b_{n}-b_{n-1}\right)=\left(f\left(a_{n-1}\right)-a_{n-1}\right)\left(f\left(b_{n-1}\right)-b_{n-1}\right)<0 +$$ + +holds if and only if $a_{n-1}$ and $b_{n-1}$ lie in distinct subintervals. +Let us now assume, to the contrary, that $a_{k}$ and $b_{k}$ always lie in the same subinterval. Consider the distance $d_{k}=\left|a_{k}-b_{k}\right|$. If both $a_{k}$ and $b_{k}$ lie in $I_{1}$, then + +$$ +d_{k+1}=\left|a_{k+1}-b_{k+1}\right|=\left|a_{k}+\frac{1}{2}-b_{k}-\frac{1}{2}\right|=d_{k} +$$ + +If, on the other hand, $a_{k}$ and $b_{k}$ both lie in $I_{2}$, then $\min \left(a_{k}, b_{k}\right) \geqslant \frac{1}{2}$ and $\max \left(a_{k}, b_{k}\right)=$ $\min \left(a_{k}, b_{k}\right)+d_{k} \geqslant \frac{1}{2}+d_{k}$, which implies + +$$ +d_{k+1}=\left|a_{k+1}-b_{k+1}\right|=\left|a_{k}^{2}-b_{k}^{2}\right|=\left|\left(a_{k}-b_{k}\right)\left(a_{k}+b_{k}\right)\right| \geqslant\left|a_{k}-b_{k}\right|\left(\frac{1}{2}+\frac{1}{2}+d_{k}\right)=d_{k}\left(1+d_{k}\right) \geqslant d_{k} +$$ + +This means that the difference $d_{k}$ is non-decreasing, and in particular $d_{k} \geqslant d_{0}>0$ for all $k$. +We can even say more. If $a_{k}$ and $b_{k}$ lie in $I_{2}$, then + +$$ +d_{k+2} \geqslant d_{k+1} \geqslant d_{k}\left(1+d_{k}\right) \geqslant d_{k}\left(1+d_{0}\right) +$$ + +If $a_{k}$ and $b_{k}$ both lie in $I_{1}$, then $a_{k+1}$ and $b_{k+1}$ both lie in $I_{2}$, and so we have + +$$ +d_{k+2} \geqslant d_{k+1}\left(1+d_{k+1}\right) \geqslant d_{k+1}\left(1+d_{0}\right)=d_{k}\left(1+d_{0}\right) +$$ + +In either case, $d_{k+2} \geqslant d_{k}\left(1+d_{0}\right)$, and inductively we get + +$$ +d_{2 m} \geqslant d_{0}\left(1+d_{0}\right)^{m} +$$ + +For sufficiently large $m$, the right-hand side is greater than 1 , but since $a_{2 m}, b_{2 m}$ both lie in $(0,1)$, we must have $d_{2 m}<1$, a contradiction. + +Thus there must be a positive integer $n$ such that $a_{n-1}$ and $b_{n-1}$ do not lie in the same subinterval, which proves the desired statement. + +A3. For a sequence $x_{1}, x_{2}, \ldots, x_{n}$ of real numbers, we define its price as + +$$ +\max _{1 \leqslant i \leqslant n}\left|x_{1}+\cdots+x_{i}\right| +$$ + +Given $n$ real numbers, Dave and George want to arrange them into a sequence with a low price. Diligent Dave checks all possible ways and finds the minimum possible price $D$. Greedy George, on the other hand, chooses $x_{1}$ such that $\left|x_{1}\right|$ is as small as possible; among the remaining numbers, he chooses $x_{2}$ such that $\left|x_{1}+x_{2}\right|$ is as small as possible, and so on. Thus, in the $i^{\text {th }}$ step he chooses $x_{i}$ among the remaining numbers so as to minimise the value of $\left|x_{1}+x_{2}+\cdots+x_{i}\right|$. In each step, if several numbers provide the same value, George chooses one at random. Finally he gets a sequence with price $G$. + +Find the least possible constant $c$ such that for every positive integer $n$, for every collection of $n$ real numbers, and for every possible sequence that George might obtain, the resulting values satisfy the inequality $G \leqslant c D$. +(Georgia) +Answer. $c=2$. +Solution. If the initial numbers are $1,-1,2$, and -2 , then Dave may arrange them as $1,-2,2,-1$, while George may get the sequence $1,-1,2,-2$, resulting in $D=1$ and $G=2$. So we obtain $c \geqslant 2$. + +Therefore, it remains to prove that $G \leqslant 2 D$. Let $x_{1}, x_{2}, \ldots, x_{n}$ be the numbers Dave and George have at their disposal. Assume that Dave and George arrange them into sequences $d_{1}, d_{2}, \ldots, d_{n}$ and $g_{1}, g_{2}, \ldots, g_{n}$, respectively. Put + +$$ +M=\max _{1 \leqslant i \leqslant n}\left|x_{i}\right|, \quad S=\left|x_{1}+\cdots+x_{n}\right|, \quad \text { and } \quad N=\max \{M, S\} +$$ + +We claim that + +$$ +\begin{aligned} +& D \geqslant S, \\ +& D \geqslant \frac{M}{2}, \quad \text { and } \\ +& G \leqslant N=\max \{M, S\} +\end{aligned} +$$ + +These inequalities yield the desired estimate, as $G \leqslant \max \{M, S\} \leqslant \max \{M, 2 S\} \leqslant 2 D$. +The inequality (1) is a direct consequence of the definition of the price. +To prove (2), consider an index $i$ with $\left|d_{i}\right|=M$. Then we have + +$$ +M=\left|d_{i}\right|=\left|\left(d_{1}+\cdots+d_{i}\right)-\left(d_{1}+\cdots+d_{i-1}\right)\right| \leqslant\left|d_{1}+\cdots+d_{i}\right|+\left|d_{1}+\cdots+d_{i-1}\right| \leqslant 2 D +$$ + +as required. +It remains to establish (3). Put $h_{i}=g_{1}+g_{2}+\cdots+g_{i}$. We will prove by induction on $i$ that $\left|h_{i}\right| \leqslant N$. The base case $i=1$ holds, since $\left|h_{1}\right|=\left|g_{1}\right| \leqslant M \leqslant N$. Notice also that $\left|h_{n}\right|=S \leqslant N$. + +For the induction step, assume that $\left|h_{i-1}\right| \leqslant N$. We distinguish two cases. +Case 1. Assume that no two of the numbers $g_{i}, g_{i+1}, \ldots, g_{n}$ have opposite signs. +Without loss of generality, we may assume that they are all nonnegative. Then one has $h_{i-1} \leqslant h_{i} \leqslant \cdots \leqslant h_{n}$, thus + +$$ +\left|h_{i}\right| \leqslant \max \left\{\left|h_{i-1}\right|,\left|h_{n}\right|\right\} \leqslant N +$$ + +Case 2. Among the numbers $g_{i}, g_{i+1}, \ldots, g_{n}$ there are positive and negative ones. + +Then there exists some index $j \geqslant i$ such that $h_{i-1} g_{j} \leqslant 0$. By the definition of George's sequence we have + +$$ +\left|h_{i}\right|=\left|h_{i-1}+g_{i}\right| \leqslant\left|h_{i-1}+g_{j}\right| \leqslant \max \left\{\left|h_{i-1}\right|,\left|g_{j}\right|\right\} \leqslant N +$$ + +Thus, the induction step is established. +Comment 1. One can establish the weaker inequalities $D \geqslant \frac{M}{2}$ and $G \leqslant D+\frac{M}{2}$ from which the result also follows. + +Comment 2. One may ask a more specific question to find the maximal suitable $c$ if the number $n$ is fixed. For $n=1$ or 2 , the answer is $c=1$. For $n=3$, the answer is $c=\frac{3}{2}$, and it is reached e.g., for the collection $1,2,-4$. Finally, for $n \geqslant 4$ the answer is $c=2$. In this case the arguments from the solution above apply, and the answer is reached e.g., for the same collection $1,-1,2,-2$, augmented by several zeroes. + +A4. Determine all functions $f: \mathbb{Z} \rightarrow \mathbb{Z}$ satisfying + +$$ +f(f(m)+n)+f(m)=f(n)+f(3 m)+2014 +$$ + +for all integers $m$ and $n$. +(Netherlands) +Answer. There is only one such function, namely $n \longmapsto 2 n+1007$. +Solution. Let $f$ be a function satisfying (1). Set $C=1007$ and define the function $g: \mathbb{Z} \rightarrow \mathbb{Z}$ by $g(m)=f(3 m)-f(m)+2 C$ for all $m \in \mathbb{Z}$; in particular, $g(0)=2 C$. Now (1) rewrites as + +$$ +f(f(m)+n)=g(m)+f(n) +$$ + +for all $m, n \in \mathbb{Z}$. By induction in both directions it follows that + +$$ +f(t f(m)+n)=t g(m)+f(n) +$$ + +holds for all $m, n, t \in \mathbb{Z}$. Applying this, for any $r \in \mathbb{Z}$, to the triples $(r, 0, f(0))$ and $(0,0, f(r))$ in place of $(m, n, t)$ we obtain + +$$ +f(0) g(r)=f(f(r) f(0))-f(0)=f(r) g(0) +$$ + +Now if $f(0)$ vanished, then $g(0)=2 C>0$ would entail that $f$ vanishes identically, contrary to (1). Thus $f(0) \neq 0$ and the previous equation yields $g(r)=\alpha f(r)$, where $\alpha=\frac{g(0)}{f(0)}$ is some nonzero constant. + +So the definition of $g$ reveals $f(3 m)=(1+\alpha) f(m)-2 C$, i.e., + +$$ +f(3 m)-\beta=(1+\alpha)(f(m)-\beta) +$$ + +for all $m \in \mathbb{Z}$, where $\beta=\frac{2 C}{\alpha}$. By induction on $k$ this implies + +$$ +f\left(3^{k} m\right)-\beta=(1+\alpha)^{k}(f(m)-\beta) +$$ + +for all integers $k \geqslant 0$ and $m$. +Since $3 \nmid 2014$, there exists by (1) some value $d=f(a)$ attained by $f$ that is not divisible by 3 . Now by (2) we have $f(n+t d)=f(n)+t g(a)=f(n)+\alpha \cdot t f(a)$, i.e., + +$$ +f(n+t d)=f(n)+\alpha \cdot t d +$$ + +for all $n, t \in \mathbb{Z}$. +Let us fix any positive integer $k$ with $d \mid\left(3^{k}-1\right)$, which is possible, since $\operatorname{gcd}(3, d)=1$. E.g., by the Euler-Fermat theorem, we may take $k=\varphi(|d|)$. Now for each $m \in \mathbb{Z}$ we get + +$$ +f\left(3^{k} m\right)=f(m)+\alpha\left(3^{k}-1\right) m +$$ + +from (5), which in view of (4) yields $\left((1+\alpha)^{k}-1\right)(f(m)-\beta)=\alpha\left(3^{k}-1\right) m$. Since $\alpha \neq 0$, the right hand side does not vanish for $m \neq 0$, wherefore the first factor on the left hand side cannot vanish either. It follows that + +$$ +f(m)=\frac{\alpha\left(3^{k}-1\right)}{(1+\alpha)^{k}-1} \cdot m+\beta +$$ + +So $f$ is a linear function, say $f(m)=A m+\beta$ for all $m \in \mathbb{Z}$ with some constant $A \in \mathbb{Q}$. Plugging this into (1) one obtains $\left(A^{2}-2 A\right) m+(A \beta-2 C)=0$ for all $m$, which is equivalent to the conjunction of + +$$ +A^{2}=2 A \quad \text { and } \quad A \beta=2 C +$$ + +The first equation is equivalent to $A \in\{0,2\}$, and as $C \neq 0$ the second one gives + +$$ +A=2 \quad \text { and } \quad \beta=C +$$ + +This shows that $f$ is indeed the function mentioned in the answer and as the numbers found in (7) do indeed satisfy the equations (6) this function is indeed as desired. + +Comment 1. One may see that $\alpha=2$. A more pedestrian version of the above solution starts with a direct proof of this fact, that can be obtained by substituting some special values into (1), e.g., as follows. + +Set $D=f(0)$. Plugging $m=0$ into (1) and simplifying, we get + +$$ +f(n+D)=f(n)+2 C +$$ + +for all $n \in \mathbb{Z}$. In particular, for $n=0, D, 2 D$ we obtain $f(D)=2 C+D, f(2 D)=f(D)+2 C=4 C+D$, and $f(3 D)=f(2 D)+2 C=6 C+D$. So substituting $m=D$ and $n=r-D$ into (1) and applying (8) with $n=r-D$ afterwards we learn + +$$ +f(r+2 C)+2 C+D=(f(r)-2 C)+(6 C+D)+2 C +$$ + +i.e., $f(r+2 C)=f(r)+4 C$. By induction in both directions it follows that + +$$ +f(n+2 C t)=f(n)+4 C t +$$ + +holds for all $n, t \in \mathbb{Z}$. +Claim. If $a$ and $b$ denote two integers with the property that $f(n+a)=f(n)+b$ holds for all $n \in \mathbb{Z}$, then $b=2 a$. +Proof. Applying induction in both directions to the assumption we get $f(n+t a)=f(n)+t b$ for all $n, t \in \mathbb{Z}$. Plugging $(n, t)=(0,2 C)$ into this equation and $(n, t)=(0, a)$ into $(9)$ we get $f(2 a C)-f(0)=$ $2 b C=4 a C$, and, as $C \neq 0$, the claim follows. + +Now by (1), for any $m \in \mathbb{Z}$, the numbers $a=f(m)$ and $b=f(3 m)-f(m)+2 C$ have the property mentioned in the claim, whence we have + +$$ +f(3 m)-C=3(f(m)-C) . +$$ + +In view of (3) this tells us indeed that $\alpha=2$. +Now the solution may be completed as above, but due to our knowledge of $\alpha=2$ we get the desired formula $f(m)=2 m+C$ directly without having the need to go through all linear functions. Now it just remains to check that this function does indeed satisfy (1). + +Comment 2. It is natural to wonder what happens if one replaces the number 2014 appearing in the statement of the problem by some arbitrary integer $B$. + +If $B$ is odd, there is no such function, as can be seen by using the same ideas as in the above solution. + +If $B \neq 0$ is even, however, then the only such function is given by $n \longmapsto 2 n+B / 2$. In case $3 \nmid B$ this was essentially proved above, but for the general case one more idea seems to be necessary. Writing $B=3^{\nu} \cdot k$ with some integers $\nu$ and $k$ such that $3 \nmid k$ one can obtain $f(n)=2 n+B / 2$ for all $n$ that are divisible by $3^{\nu}$ in the same manner as usual; then one may use the formula $f(3 n)=3 f(n)-B$ to establish the remaining cases. + +Finally, in case $B=0$ there are more solutions than just the function $n \longmapsto 2 n$. It can be shown that all these other functions are periodic; to mention just one kind of example, for any even integers $r$ and $s$ the function + +$$ +f(n)= \begin{cases}r & \text { if } n \text { is even, } \\ s & \text { if } n \text { is odd }\end{cases} +$$ + +also has the property under discussion. + +A5. Consider all polynomials $P(x)$ with real coefficients that have the following property: for any two real numbers $x$ and $y$ one has + +$$ +\left|y^{2}-P(x)\right| \leqslant 2|x| \quad \text { if and only if } \quad\left|x^{2}-P(y)\right| \leqslant 2|y| +$$ + +Determine all possible values of $P(0)$. +(Belgium) +Answer. The set of possible values of $P(0)$ is $(-\infty, 0) \cup\{1\}$. + +## Solution. + +Part I. We begin by verifying that these numbers are indeed possible values of $P(0)$. To see that each negative real number $-C$ can be $P(0)$, it suffices to check that for every $C>0$ the polynomial $P(x)=-\left(\frac{2 x^{2}}{C}+C\right)$ has the property described in the statement of the problem. Due to symmetry it is enough for this purpose to prove $\left|y^{2}-P(x)\right|>2|x|$ for any two real numbers $x$ and $y$. In fact we have + +$$ +\left|y^{2}-P(x)\right|=y^{2}+\frac{x^{2}}{C}+\frac{(|x|-C)^{2}}{C}+2|x| \geqslant \frac{x^{2}}{C}+2|x| \geqslant 2|x|, +$$ + +where in the first estimate equality can only hold if $|x|=C$, whilst in the second one it can only hold if $x=0$. As these two conditions cannot be met at the same time, we have indeed $\left|y^{2}-P(x)\right|>2|x|$. + +To show that $P(0)=1$ is possible as well, we verify that the polynomial $P(x)=x^{2}+1$ satisfies (1). Notice that for all real numbers $x$ and $y$ we have + +$$ +\begin{aligned} +\left|y^{2}-P(x)\right| \leqslant 2|x| & \Longleftrightarrow\left(y^{2}-x^{2}-1\right)^{2} \leqslant 4 x^{2} \\ +& \Longleftrightarrow 0 \leqslant\left(\left(y^{2}-(x-1)^{2}\right)\left((x+1)^{2}-y^{2}\right)\right. \\ +& \Longleftrightarrow 0 \leqslant(y-x+1)(y+x-1)(x+1-y)(x+1+y) \\ +& \Longleftrightarrow 0 \leqslant\left((x+y)^{2}-1\right)\left(1-(x-y)^{2}\right) . +\end{aligned} +$$ + +Since this inequality is symmetric in $x$ and $y$, we are done. +Part II. Now we show that no values other than those mentioned in the answer are possible for $P(0)$. To reach this we let $P$ denote any polynomial satisfying (1) and $P(0) \geqslant 0$; as we shall see, this implies $P(x)=x^{2}+1$ for all real $x$, which is actually more than what we want. + +First step: We prove that $P$ is even. +By (1) we have + +$$ +\left|y^{2}-P(x)\right| \leqslant 2|x| \Longleftrightarrow\left|x^{2}-P(y)\right| \leqslant 2|y| \Longleftrightarrow\left|y^{2}-P(-x)\right| \leqslant 2|x| +$$ + +for all real numbers $x$ and $y$. Considering just the equivalence of the first and third statement and taking into account that $y^{2}$ may vary through $\mathbb{R}_{\geqslant 0}$ we infer that + +$$ +[P(x)-2|x|, P(x)+2|x|] \cap \mathbb{R}_{\geqslant 0}=[P(-x)-2|x|, P(-x)+2|x|] \cap \mathbb{R}_{\geqslant 0} +$$ + +holds for all $x \in \mathbb{R}$. We claim that there are infinitely many real numbers $x$ such that $P(x)+2|x| \geqslant 0$. This holds in fact for any real polynomial with $P(0) \geqslant 0$; in order to see this, we may assume that the coefficient of $P$ appearing in front of $x$ is nonnegative. In this case the desired inequality holds for all sufficiently small positive real numbers. + +For such numbers $x$ satisfying $P(x)+2|x| \geqslant 0$ we have $P(x)+2|x|=P(-x)+2|x|$ by the previous displayed formula, and hence also $P(x)=P(-x)$. Consequently the polynomial $P(x)-P(-x)$ has infinitely many zeros, wherefore it has to vanish identically. Thus $P$ is indeed even. + +Second step: We prove that $P(t)>0$ for all $t \in \mathbb{R}$. +Let us assume for a moment that there exists a real number $t \neq 0$ with $P(t)=0$. Then there is some open interval $I$ around $t$ such that $|P(y)| \leqslant 2|y|$ holds for all $y \in I$. Plugging $x=0$ into (1) we learn that $y^{2}=P(0)$ holds for all $y \in I$, which is clearly absurd. We have thus shown $P(t) \neq 0$ for all $t \neq 0$. + +In combination with $P(0) \geqslant 0$ this informs us that our claim could only fail if $P(0)=0$. In this case there is by our first step a polynomial $Q(x)$ such that $P(x)=x^{2} Q(x)$. Applying (1) to $x=0$ and an arbitrary $y \neq 0$ we get $|y Q(y)|>2$, which is surely false when $y$ is sufficiently small. + +Third step: We prove that $P$ is a quadratic polynomial. +Notice that $P$ cannot be constant, for otherwise if $x=\sqrt{P(0)}$ and $y$ is sufficiently large, the first part of (1) is false whilst the second part is true. So the degree $n$ of $P$ has to be at least 1 . By our first step $n$ has to be even as well, whence in particular $n \geqslant 2$. + +Now assume that $n \geqslant 4$. Plugging $y=\sqrt{P(x)}$ into (1) we get $\left|x^{2}-P(\sqrt{P(x)})\right| \leqslant 2 \sqrt{P(x)}$ and hence + +$$ +P(\sqrt{P(x)}) \leqslant x^{2}+2 \sqrt{P(x)} +$$ + +for all real $x$. Choose positive real numbers $x_{0}, a$, and $b$ such that if $x \in\left(x_{0}, \infty\right)$, then $a x^{n}<$ $P(x)0$ denotes the leading coefficient of $P$, then $\lim _{x \rightarrow \infty} \frac{P(x)}{x^{n}}=d$, whence for instance the numbers $a=\frac{d}{2}$ and $b=2 d$ work provided that $x_{0}$ is chosen large enough. + +Now for all sufficiently large real numbers $x$ we have + +$$ +a^{n / 2+1} x^{n^{2} / 2}0$ and $b$ such that $P(x)=$ $a x^{2}+b$. Now if $x$ is large enough and $y=\sqrt{a} x$, the left part of (1) holds and the right part reads $\left|\left(1-a^{2}\right) x^{2}-b\right| \leqslant 2 \sqrt{a} x$. In view of the fact that $a>0$ this is only possible if $a=1$. Finally, substituting $y=x+1$ with $x>0$ into (1) we get + +$$ +|2 x+1-b| \leqslant 2 x \Longleftrightarrow|2 x+1+b| \leqslant 2 x+2 +$$ + +i.e., + +$$ +b \in[1,4 x+1] \Longleftrightarrow b \in[-4 x-3,1] +$$ + +for all $x>0$. Choosing $x$ large enough, we can achieve that at least one of these two statements holds; then both hold, which is only possible if $b=1$, as desired. + +Comment 1. There are some issues with this problem in that its most natural solutions seem to use some basic facts from analysis, such as the continuity of polynomials or the intermediate value theorem. Yet these facts are intuitively obvious and implicitly clear to the students competing at this level of difficulty, so that the Problem Selection Committee still thinks that the problem is suitable for the IMO. + +Comment 2. It seems that most solutions will in the main case, where $P(0)$ is nonnegative, contain an argument that is somewhat asymptotic in nature showing that $P$ is quadratic, and some part narrowing that case down to $P(x)=x^{2}+1$. + +Comment 3. It is also possible to skip the first step and start with the second step directly, but then one has to work a bit harder to rule out the case $P(0)=0$. Let us sketch one possibility of doing this: Take the auxiliary polynomial $Q(x)$ such that $P(x)=x Q(x)$. Applying (1) to $x=0$ and an arbitrary $y \neq 0$ we get $|Q(y)|>2$. Hence we either have $Q(z) \geqslant 2$ for all real $z$ or $Q(z) \leqslant-2$ for all real $z$. In particular there is some $\eta \in\{-1,+1\}$ such that $P(\eta) \geqslant 2$ and $P(-\eta) \leqslant-2$. Substituting $x= \pm \eta$ into (1) we learn + +$$ +\left|y^{2}-P(\eta)\right| \leqslant 2 \Longleftrightarrow|1-P(y)| \leqslant 2|y| \Longleftrightarrow\left|y^{2}-P(-\eta)\right| \leqslant 2 +$$ + +But for $y=\sqrt{P(\eta)}$ the first statement is true, whilst the third one is false. +Also, if one has not obtained the evenness of $P$ before embarking on the fourth step, one needs to work a bit harder there, but not in a way that is likely to cause major difficulties. + +Comment 4. Truly curious people may wonder about the set of all polynomials having property (1). As explained in the solution above, $P(x)=x^{2}+1$ is the only one with $P(0)=1$. On the other hand, it is not hard to notice that for negative $P(0)$ there are more possibilities than those mentioned above. E.g., as remarked by the proposer, if $a$ and $b$ denote two positive real numbers with $a b>1$ and $Q$ denotes a polynomial attaining nonnegative values only, then $P(x)=-\left(a x^{2}+b+Q(x)\right)$ works. + +More generally, it may be proved that if $P(x)$ satisfies (1) and $P(0)<0$, then $-P(x)>2|x|$ holds for all $x \in \mathbb{R}$ so that one just considers the equivalence of two false statements. One may generate all such polynomials $P$ by going through all combinations of a solution of the polynomial equation + +$$ +x=A(x) B(x)+C(x) D(x) +$$ + +and a real $E>0$, and setting + +$$ +P(x)=-\left(A(x)^{2}+B(x)^{2}+C(x)^{2}+D(x)^{2}+E\right) +$$ + +for each of them. + +A6. Find all functions $f: \mathbb{Z} \rightarrow \mathbb{Z}$ such that + +$$ +n^{2}+4 f(n)=f(f(n))^{2} +$$ + +for all $n \in \mathbb{Z}$. +(United Kingdom) +Answer. The possibilities are: + +- $f(n)=n+1$ for all $n$; +- or, for some $a \geqslant 1, \quad f(n)= \begin{cases}n+1, & n>-a, \\ -n+1, & n \leqslant-a ;\end{cases}$ +- or $f(n)= \begin{cases}n+1, & n>0, \\ 0, & n=0, \\ -n+1, & n<0 .\end{cases}$ + + +## Solution 1. + +Part I. Let us first check that each of the functions above really satisfies the given functional equation. If $f(n)=n+1$ for all $n$, then we have + +$$ +n^{2}+4 f(n)=n^{2}+4 n+4=(n+2)^{2}=f(n+1)^{2}=f(f(n))^{2} . +$$ + +If $f(n)=n+1$ for $n>-a$ and $f(n)=-n+1$ otherwise, then we have the same identity for $n>-a$ and + +$$ +n^{2}+4 f(n)=n^{2}-4 n+4=(2-n)^{2}=f(1-n)^{2}=f(f(n))^{2} +$$ + +otherwise. The same applies to the third solution (with $a=0$ ), where in addition one has + +$$ +0^{2}+4 f(0)=0=f(f(0))^{2} +$$ + +Part II. It remains to prove that these are really the only functions that satisfy our functional equation. We do so in three steps: + +Step 1: We prove that $f(n)=n+1$ for $n>0$. +Consider the sequence $\left(a_{k}\right)$ given by $a_{k}=f^{k}(1)$ for $k \geqslant 0$. Setting $n=a_{k}$ in (1), we get + +$$ +a_{k}^{2}+4 a_{k+1}=a_{k+2}^{2} +$$ + +Of course, $a_{0}=1$ by definition. Since $a_{2}^{2}=1+4 a_{1}$ is odd, $a_{2}$ has to be odd as well, so we set $a_{2}=2 r+1$ for some $r \in \mathbb{Z}$. Then $a_{1}=r^{2}+r$ and consequently + +$$ +a_{3}^{2}=a_{1}^{2}+4 a_{2}=\left(r^{2}+r\right)^{2}+8 r+4 +$$ + +Since $8 r+4 \neq 0, a_{3}^{2} \neq\left(r^{2}+r\right)^{2}$, so the difference between $a_{3}^{2}$ and $\left(r^{2}+r\right)^{2}$ is at least the distance from $\left(r^{2}+r\right)^{2}$ to the nearest even square (since $8 r+4$ and $r^{2}+r$ are both even). This implies that + +$$ +|8 r+4|=\left|a_{3}^{2}-\left(r^{2}+r\right)^{2}\right| \geqslant\left(r^{2}+r\right)^{2}-\left(r^{2}+r-2\right)^{2}=4\left(r^{2}+r-1\right) +$$ + +(for $r=0$ and $r=-1$, the estimate is trivial, but this does not matter). Therefore, we ave + +$$ +4 r^{2} \leqslant|8 r+4|-4 r+4 +$$ + +If $|r| \geqslant 4$, then + +$$ +4 r^{2} \geqslant 16|r| \geqslant 12|r|+16>8|r|+4+4|r|+4 \geqslant|8 r+4|-4 r+4 +$$ + +a contradiction. Thus $|r|<4$. Checking all possible remaining values of $r$, we find that $\left(r^{2}+r\right)^{2}+8 r+4$ is only a square in three cases: $r=-3, r=0$ and $r=1$. Let us now distinguish these three cases: + +- $r=-3$, thus $a_{1}=6$ and $a_{2}=-5$. For each $k \geqslant 1$, we have + +$$ +a_{k+2}= \pm \sqrt{a_{k}^{2}+4 a_{k+1}} +$$ + +and the sign needs to be chosen in such a way that $a_{k+1}^{2}+4 a_{k+2}$ is again a square. This yields $a_{3}=-4, a_{4}=-3, a_{5}=-2, a_{6}=-1, a_{7}=0, a_{8}=1, a_{9}=2$. At this point we have reached a contradiction, since $f(1)=f\left(a_{0}\right)=a_{1}=6$ and at the same time $f(1)=f\left(a_{8}\right)=a_{9}=2$. + +- $r=0$, thus $a_{1}=0$ and $a_{2}=1$. Then $a_{3}^{2}=a_{1}^{2}+4 a_{2}=4$, so $a_{3}= \pm 2$. This, however, is a contradiction again, since it gives us $f(1)=f\left(a_{0}\right)=a_{1}=0$ and at the same time $f(1)=f\left(a_{2}\right)=a_{3}= \pm 2$. +- $r=1$, thus $a_{1}=2$ and $a_{2}=3$. We prove by induction that $a_{k}=k+1$ for all $k \geqslant 0$ in this case, which we already know for $k \leqslant 2$ now. For the induction step, assume that $a_{k-1}=k$ and $a_{k}=k+1$. Then + +$$ +a_{k+1}^{2}=a_{k-1}^{2}+4 a_{k}=k^{2}+4 k+4=(k+2)^{2} +$$ + +so $a_{k+1}= \pm(k+2)$. If $a_{k+1}=-(k+2)$, then + +$$ +a_{k+2}^{2}=a_{k}^{2}+4 a_{k+1}=(k+1)^{2}-4 k-8=k^{2}-2 k-7=(k-1)^{2}-8 +$$ + +The latter can only be a square if $k=4$ (since 1 and 9 are the only two squares whose difference is 8 ). Then, however, $a_{4}=5, a_{5}=-6$ and $a_{6}= \pm 1$, so + +$$ +a_{7}^{2}=a_{5}^{2}+4 a_{6}=36 \pm 4 +$$ + +but neither 32 nor 40 is a perfect square. Thus $a_{k+1}=k+2$, which completes our induction. This also means that $f(n)=f\left(a_{n-1}\right)=a_{n}=n+1$ for all $n \geqslant 1$. + +Step 2: We prove that either $f(0)=1$, or $f(0)=0$ and $f(n) \neq 0$ for $n \neq 0$. +Set $n=0$ in (1) to get + +$$ +4 f(0)=f(f(0))^{2} +$$ + +This means that $f(0) \geqslant 0$. If $f(0)=0$, then $f(n) \neq 0$ for all $n \neq 0$, since we would otherwise have + +$$ +n^{2}=n^{2}+4 f(n)=f(f(n))^{2}=f(0)^{2}=0 +$$ + +If $f(0)>0$, then we know that $f(f(0))=f(0)+1$ from the first step, so + +$$ +4 f(0)=(f(0)+1)^{2} +$$ + +which yields $f(0)=1$. + +Step 3: We discuss the values of $f(n)$ for $n<0$. +Lemma. For every $n \geqslant 1$, we have $f(-n)=-n+1$ or $f(-n)=n+1$. Moreover, if $f(-n)=$ $-n+1$ for some $n \geqslant 1$, then also $f(-n+1)=-n+2$. +Proof. We prove this statement by strong induction on $n$. For $n=1$, we get + +$$ +1+4 f(-1)=f(f(-1))^{2} +$$ + +Thus $f(-1)$ needs to be nonnegative. If $f(-1)=0$, then $f(f(-1))=f(0)= \pm 1$, so $f(0)=1$ (by our second step). Otherwise, we know that $f(f(-1))=f(-1)+1$, so + +$$ +1+4 f(-1)=(f(-1)+1)^{2} +$$ + +which yields $f(-1)=2$ and thus establishes the base case. For the induction step, we consider two cases: + +- If $f(-n) \leqslant-n$, then + +$$ +f(f(-n))^{2}=(-n)^{2}+4 f(-n) \leqslant n^{2}-4 n<(n-2)^{2} +$$ + +so $|f(f(-n))| \leqslant n-3$ (for $n=2$, this case cannot even occur). If $f(f(-n)) \geqslant 0$, then we already know from the first two steps that $f(f(f(-n)))=f(f(-n))+1$, unless perhaps if $f(0)=0$ and $f(f(-n))=0$. However, the latter would imply $f(-n)=0$ (as shown in Step 2) and thus $n=0$, which is impossible. If $f(f(-n))<0$, we can apply the induction hypothesis to $f(f(-n))$. In either case, $f(f(f(-n)))= \pm f(f(-n))+1$. Therefore, + +$$ +f(-n)^{2}+4 f(f(-n))=f(f(f(-n)))^{2}=( \pm f(f(-n))+1)^{2} +$$ + +which gives us + +$$ +\begin{aligned} +n^{2} & \leqslant f(-n)^{2}=( \pm f(f(-n))+1)^{2}-4 f(f(-n)) \leqslant f(f(-n))^{2}+6|f(f(-n))|+1 \\ +& \leqslant(n-3)^{2}+6(n-3)+1=n^{2}-8 +\end{aligned} +$$ + +a contradiction. + +- Thus, we are left with the case that $f(-n)>-n$. Now we argue as in the previous case: if $f(-n) \geqslant 0$, then $f(f(-n))=f(-n)+1$ by the first two steps, since $f(0)=0$ and $f(-n)=0$ would imply $n=0$ (as seen in Step 2) and is thus impossible. If $f(-n)<0$, we can apply the induction hypothesis, so in any case we can infer that $f(f(-n))= \pm f(-n)+1$. We obtain + +$$ +(-n)^{2}+4 f(-n)=( \pm f(-n)+1)^{2} +$$ + +so either + +$$ +n^{2}=f(-n)^{2}-2 f(-n)+1=(f(-n)-1)^{2} +$$ + +which gives us $f(-n)= \pm n+1$, or + +$$ +n^{2}=f(-n)^{2}-6 f(-n)+1=(f(-n)-3)^{2}-8 +$$ + +Since 1 and 9 are the only perfect squares whose difference is 8 , we must have $n=1$, which we have already considered. + +Finally, suppose that $f(-n)=-n+1$ for some $n \geqslant 2$. Then + +$$ +f(-n+1)^{2}=f(f(-n))^{2}=(-n)^{2}+4 f(-n)=(n-2)^{2} +$$ + +so $f(-n+1)= \pm(n-2)$. However, we already know that $f(-n+1)=-n+2$ or $f(-n+1)=n$, so $f(-n+1)=-n+2$. + +Combining everything we know, we find the solutions as stated in the answer: + +- One solution is given by $f(n)=n+1$ for all $n$. +- If $f(n)$ is not always equal to $n+1$, then there is a largest integer $m$ (which cannot be positive) for which this is not the case. In view of the lemma that we proved, we must then have $f(n)=-n+1$ for any integer $n (|b|-4)^{2} +$$ + +because $|b| \geqslant|a|-1 \geqslant 9$. Thus (3) can be refined to + +$$ +|a|+3 \geqslant|f(a)| \geqslant|a|-1 \quad \text { for }|a| \geqslant E +$$ + +Now, from $c^{2}=a^{2}+4 b$ with $|b| \in[|a|-1,|a|+3]$ we get $c^{2}=(a \pm 2)^{2}+d$, where $d \in\{-16,-12,-8,-4,0,4,8\}$. Since $|a \pm 2| \geqslant 8$, this can happen only if $c^{2}=(a \pm 2)^{2}$, which in turn yields $b= \pm a+1$. To summarise, + +$$ +f(a)=1 \pm a \quad \text { for }|a| \geqslant E \text {. } +$$ + +We have shown that, with at most finitely many exceptions, $f(a)=1 \pm a$. Thus it will be convenient for our second step to introduce the sets + +$$ +Z_{+}=\{a \in \mathbb{Z}: f(a)=a+1\}, \quad Z_{-}=\{a \in \mathbb{Z}: f(a)=1-a\}, \quad \text { and } \quad Z_{0}=\mathbb{Z} \backslash\left(Z_{+} \cup Z_{-}\right) +$$ + +Step 2. Now we investigate the structure of the sets $Z_{+}, Z_{-}$, and $Z_{0}$. +4. Note that $f(E+1)=1 \pm(E+1)$. If $f(E+1)=E+2$, then $E+1 \in Z_{+}$. Otherwise we have $f(1+E)=-E$; then the original equation (1) with $n=E+1$ gives us $(E-1)^{2}=f(-E)^{2}$, so $f(-E)= \pm(E-1)$. By (4) this may happen only if $f(-E)=1-E$, so in this case $-E \in Z_{+}$. In any case we find that $Z_{+} \neq \varnothing$. +5. Now take any $a \in Z_{+}$. We claim that every integer $x \geqslant a$ also lies in $Z_{+}$. We proceed by induction on $x$, the base case $x=a$ being covered by our assumption. For the induction step, assume that $f(x-1)=x$ and plug $n=x-1$ into (1). We get $f(x)^{2}=(x+1)^{2}$, so either $f(x)=x+1$ or $f(x)=-(x+1)$. +Assume that $f(x)=-(x+1)$ and $x \neq-1$, since otherwise we already have $f(x)=x+1$. Plugging $n=x$ into (1), we obtain $f(-x-1)^{2}=(x-2)^{2}-8$, which may happen only if $x-2= \pm 3$ and $f(-x-1)= \pm 1$. Plugging $n=-x-1$ into (1), we get $f( \pm 1)^{2}=(x+1)^{2} \pm 4$, which in turn may happen only if $x+1 \in\{-2,0,2\}$. +Thus $x \in\{-1,5\}$ and at the same time $x \in\{-3,-1,1\}$, which gives us $x=-1$. Since this has already been excluded, we must have $f(x)=x+1$, which completes our induction. +6. Now we know that either $Z_{+}=\mathbb{Z}$ (if $Z_{+}$is not bounded below), or $Z_{+}=\left\{a \in \mathbb{Z}: a \geqslant a_{0}\right\}$, where $a_{0}$ is the smallest element of $Z_{+}$. In the former case, $f(n)=n+1$ for all $n \in \mathbb{Z}$, which is our first solution. So we assume in the following that $Z_{+}$is bounded below and has a smallest element $a_{0}$. +If $Z_{0}=\varnothing$, then we have $f(x)=x+1$ for $x \geqslant a_{0}$ and $f(x)=1-x$ for $x 1$. If none of the line segments that form the borders between the rectangles is horizontal, then we have $k-1$ vertical segments dividing $R$ into $k$ rectangles. On each of them, there can only be one of the $n$ points, so $n \leqslant k-1$, which is exactly what we want to prove. + +Otherwise, consider the lowest horizontal line $h$ that contains one or more of these line segments. Let $R^{\prime}$ be the rectangle that results when everything that lies below $h$ is removed from $R$ (see the example in the figure below). + +The rectangles that lie entirely below $h$ form blocks of rectangles separated by vertical line segments. Suppose there are $r$ blocks and $k_{i}$ rectangles in the $i^{\text {th }}$ block. The left and right border of each block has to extend further upwards beyond $h$. Thus we can move any points that lie on these borders upwards, so that they now lie inside $R^{\prime}$. This can be done without violating the conditions, one only needs to make sure that they do not get to lie on a common horizontal line with one of the other given points. + +All other borders between rectangles in the $i^{\text {th }}$ block have to lie entirely below $h$. There are $k_{i}-1$ such line segments, each of which can contain at most one of the given points. Finally, there can be one point that lies on $h$. All other points have to lie in $R^{\prime}$ (after moving some of them as explained in the previous paragraph). + + +Figure 2: Illustration of the inductive argument +We see that $R^{\prime}$ is divided into $k-\sum_{i=1}^{r} k_{i}$ rectangles. Applying the induction hypothesis to $R^{\prime}$, we find that there are at most + +$$ +\left(k-\sum_{i=1}^{r} k_{i}\right)-1+\sum_{i=1}^{r}\left(k_{i}-1\right)+1=k-r +$$ + +points. Since $r \geqslant 1$, this means that $n \leqslant k-1$, which completes our induction. + +C2. We have $2^{m}$ sheets of paper, with the number 1 written on each of them. We perform the following operation. In every step we choose two distinct sheets; if the numbers on the two sheets are $a$ and $b$, then we erase these numbers and write the number $a+b$ on both sheets. Prove that after $m 2^{m-1}$ steps, the sum of the numbers on all the sheets is at least $4^{m}$. +(Iran) +Solution. Let $P_{k}$ be the product of the numbers on the sheets after $k$ steps. +Suppose that in the $(k+1)^{\text {th }}$ step the numbers $a$ and $b$ are replaced by $a+b$. In the product, the number $a b$ is replaced by $(a+b)^{2}$, and the other factors do not change. Since $(a+b)^{2} \geqslant 4 a b$, we see that $P_{k+1} \geqslant 4 P_{k}$. Starting with $P_{0}=1$, a straightforward induction yields + +$$ +P_{k} \geqslant 4^{k} +$$ + +for all integers $k \geqslant 0$; in particular + +$$ +P_{m \cdot 2^{m-1}} \geqslant 4^{m \cdot 2^{m-1}}=\left(2^{m}\right)^{2^{m}} +$$ + +so by the AM-GM inequality, the sum of the numbers written on the sheets after $m 2^{m-1}$ steps is at least + +$$ +2^{m} \cdot \sqrt[2^{m}]{P_{m \cdot 2^{m-1}}} \geqslant 2^{m} \cdot 2^{m}=4^{m} +$$ + +Comment 1. It is possible to achieve the sum $4^{m}$ in $m 2^{m-1}$ steps. For example, starting from $2^{m}$ equal numbers on the sheets, in $2^{m-1}$ consecutive steps we can double all numbers. After $m$ such doubling rounds we have the number $2^{m}$ on every sheet. + +Comment 2. There are several versions of the solution above. E.g., one may try to assign to each positive integer $n$ a weight $w_{n}$ in such a way that the sum of the weights of the numbers written on the sheets increases, say, by at least 2 in each step. For this purpose, one needs the inequality + +$$ +2 w_{a+b} \geqslant w_{a}+w_{b}+2 +$$ + +to be satisfied for all positive integers $a$ and $b$. +Starting from $w_{1}=1$ and trying to choose the weights as small as possible, one may find that these weights can be defined as follows: For every positive integer $n$, one chooses $k$ to be the maximal integer such that $n \geqslant 2^{k}$, and puts + +$$ +w_{n}=k+\frac{n}{2^{k}}=\min _{d \in \mathbb{Z} \geq 0}\left(d+\frac{n}{2^{d}}\right) . +$$ + +Now, in order to prove that these weights satisfy (1), one may take arbitrary positive integers $a$ and $b$, and choose an integer $d \geqslant 0$ such that $w_{a+b}=d+\frac{a+b}{2^{d}}$. Then one has + +$$ +2 w_{a+b}=2 d+2 \cdot \frac{a+b}{2^{d}}=\left((d-1)+\frac{a}{2^{d-1}}\right)+\left((d-1)+\frac{b}{2^{d-1}}\right)+2 \geqslant w_{a}+w_{b}+2 +$$ + +Since the initial sum of the weights was $2^{m}$, after $m 2^{m-1}$ steps the sum is at least $(m+1) 2^{m}$. To finish the solution, one may notice that by (2) for every positive integer $a$ one has + +$$ +w_{a} \leqslant m+\frac{a}{2^{m}}, \quad \text { i.e., } \quad a \geqslant 2^{m}\left(-m+w_{a}\right) +$$ + +So the sum of the numbers $a_{1}, a_{2}, \ldots, a_{2^{m}}$ on the sheets can be estimated as + +$$ +\sum_{i=1}^{2^{m}} a_{i} \geqslant \sum_{i=1}^{2^{m}} 2^{m}\left(-m+w_{a_{i}}\right)=-m 2^{m} \cdot 2^{m}+2^{m} \sum_{i=1}^{2^{m}} w_{a_{i}} \geqslant-m 4^{m}+(m+1) 4^{m}=4^{m} +$$ + +as required. +For establishing the inequalities (1) and (3), one may also use the convexity argument, instead of the second definition of $w_{n}$ in (2). + +One may check that $\log _{2} n \leqslant w_{n} \leqslant \log _{2} n+1$; thus, in some rough sense, this approach is obtained by "taking the logarithm" of the solution above. + +Comment 3. An intuitive strategy to minimise the sum of numbers is that in every step we choose the two smallest numbers. We may call this the greedy strategy. In the following paragraphs we prove that the greedy strategy indeed provides the least possible sum of numbers. + +Claim. Starting from any sequence $x_{1}, \ldots, x_{N}$ of positive real numbers on $N$ sheets, for any number $k$ of steps, the greedy strategy achieves the lowest possible sum of numbers. + +Proof. We apply induction on $k$; for $k=1$ the statement is obvious. Let $k \geqslant 2$, and assume that the claim is true for smaller values. + +Every sequence of $k$ steps can be encoded as $S=\left(\left(i_{1}, j_{1}\right), \ldots,\left(i_{k}, j_{k}\right)\right)$, where, for $r=1,2, \ldots, k$, the numbers $i_{r}$ and $j_{r}$ are the indices of the two sheets that are chosen in the $r^{\text {th }}$ step. The resulting final sum will be some linear combination of $x_{1}, \ldots, x_{N}$, say, $c_{1} x_{1}+\cdots+c_{N} x_{N}$ with positive integers $c_{1}, \ldots, c_{N}$ that depend on $S$ only. Call the numbers $\left(c_{1}, \ldots, c_{N}\right)$ the characteristic vector of $S$. + +Choose a sequence $S_{0}=\left(\left(i_{1}, j_{1}\right), \ldots,\left(i_{k}, j_{k}\right)\right)$ of steps that produces the minimal sum, starting from $x_{1}, \ldots, x_{N}$, and let $\left(c_{1}, \ldots, c_{N}\right)$ be the characteristic vector of $S$. We may assume that the sheets are indexed in such an order that $c_{1} \geqslant c_{2} \geqslant \cdots \geqslant c_{N}$. If the sheets (and the numbers) are permuted by a permutation $\pi$ of the indices $(1,2, \ldots, N)$ and then the same steps are performed, we can obtain the $\operatorname{sum} \sum_{t=1}^{N} c_{t} x_{\pi(t)}$. By the rearrangement inequality, the smallest possible sum can be achieved when the numbers $\left(x_{1}, \ldots, x_{N}\right)$ are in non-decreasing order. So we can assume that also $x_{1} \leqslant x_{2} \leqslant \cdots \leqslant x_{N}$. + +Let $\ell$ be the largest index with $c_{1}=\cdots=c_{\ell}$, and let the $r^{\text {th }}$ step be the first step for which $c_{i_{r}}=c_{1}$ or $c_{j_{r}}=c_{1}$. The role of $i_{r}$ and $j_{r}$ is symmetrical, so we can assume $c_{i_{r}}=c_{1}$ and thus $i_{r} \leqslant \ell$. We show that $c_{j_{r}}=c_{1}$ and $j_{r} \leqslant \ell$ hold, too. + +Before the $r^{\text {th }}$ step, on the $i_{r}{ }^{\text {th }}$ sheet we had the number $x_{i_{r}}$. On the $j_{r}{ }^{\text {th }}$ sheet there was a linear combination that contains the number $x_{j_{r}}$ with a positive integer coefficient, and possibly some other terms. In the $r^{\text {th }}$ step, the number $x_{i_{r}}$ joins that linear combination. From this point, each sheet contains a linear combination of $x_{1}, \ldots, x_{N}$, with the coefficient of $x_{j_{r}}$ being not smaller than the coefficient of $x_{i_{r}}$. This is preserved to the end of the procedure, so we have $c_{j_{r}} \geqslant c_{i_{r}}$. But $c_{i_{r}}=c_{1}$ is maximal among the coefficients, so we have $c_{j_{r}}=c_{i_{r}}=c_{1}$ and thus $j_{r} \leqslant \ell$. + +Either from $c_{j_{r}}=c_{i_{r}}=c_{1}$ or from the arguments in the previous paragraph we can see that none of the $i_{r}{ }^{\text {th }}$ and the $j_{r}{ }^{\text {th }}$ sheets were used before step $r$. Therefore, the final linear combination of the numbers does not change if the step $\left(i_{r}, j_{r}\right)$ is performed first: the sequence of steps + +$$ +S_{1}=\left(\left(i_{r}, j_{r}\right),\left(i_{1}, j_{1}\right), \ldots,\left(i_{r-1}, j_{r-1}\right),\left(i_{r+1}, j_{r+1}\right), \ldots,\left(i_{N}, j_{N}\right)\right) +$$ + +also produces the same minimal sum at the end. Therefore, we can replace $S_{0}$ by $S_{1}$ and we may assume that $r=1$ and $c_{i_{1}}=c_{j_{1}}=c_{1}$. + +As $i_{1} \neq j_{1}$, we can see that $\ell \geqslant 2$ and $c_{1}=c_{2}=c_{i_{1}}=c_{j_{1}}$. Let $\pi$ be such a permutation of the indices $(1,2, \ldots, N)$ that exchanges 1,2 with $i_{r}, j_{r}$ and does not change the remaining indices. Let + +$$ +S_{2}=\left(\left(\pi\left(i_{1}\right), \pi\left(j_{1}\right)\right), \ldots,\left(\pi\left(i_{N}\right), \pi\left(j_{N}\right)\right)\right) +$$ + +Since $c_{\pi(i)}=c_{i}$ for all indices $i$, this sequence of steps produces the same, minimal sum. Moreover, in the first step we chose $x_{\pi\left(i_{1}\right)}=x_{1}$ and $x_{\pi\left(j_{1}\right)}=x_{2}$, the two smallest numbers. + +Hence, it is possible to achieve the optimal sum if we follow the greedy strategy in the first step. By the induction hypothesis, following the greedy strategy in the remaining steps we achieve the optimal sum. + +C3. Let $n \geqslant 2$ be an integer. Consider an $n \times n$ chessboard divided into $n^{2}$ unit squares. We call a configuration of $n$ rooks on this board happy if every row and every column contains exactly one rook. Find the greatest positive integer $k$ such that for every happy configuration of rooks, we can find a $k \times k$ square without a rook on any of its $k^{2}$ unit squares. +(Croatia) +Answer. $\lfloor\sqrt{n-1}\rfloor$. +Solution. Let $\ell$ be a positive integer. We will show that (i) if $n>\ell^{2}$ then each happy configuration contains an empty $\ell \times \ell$ square, but (ii) if $n \leqslant \ell^{2}$ then there exists a happy configuration not containing such a square. These two statements together yield the answer. +(i). Assume that $n>\ell^{2}$. Consider any happy configuration. There exists a row $R$ containing a rook in its leftmost square. Take $\ell$ consecutive rows with $R$ being one of them. Their union $U$ contains exactly $\ell$ rooks. Now remove the $n-\ell^{2} \geqslant 1$ leftmost columns from $U$ (thus at least one rook is also removed). The remaining part is an $\ell^{2} \times \ell$ rectangle, so it can be split into $\ell$ squares of size $\ell \times \ell$, and this part contains at most $\ell-1$ rooks. Thus one of these squares is empty. +(ii). Now we assume that $n \leqslant \ell^{2}$. Firstly, we will construct a happy configuration with no empty $\ell \times \ell$ square for the case $n=\ell^{2}$. After that we will modify it to work for smaller values of $n$. + +Let us enumerate the rows from bottom to top as well as the columns from left to right by the numbers $0,1, \ldots, \ell^{2}-1$. Every square will be denoted, as usual, by the pair $(r, c)$ of its row and column numbers. Now we put the rooks on all squares of the form $(i \ell+j, j \ell+i)$ with $i, j=0,1, \ldots, \ell-1$ (the picture below represents this arrangement for $\ell=3$ ). Since each number from 0 to $\ell^{2}-1$ has a unique representation of the form $i \ell+j(0 \leqslant i, j \leqslant \ell-1)$, each row and each column contains exactly one rook. + + +Next, we show that each $\ell \times \ell$ square $A$ on the board contains a rook. Consider such a square $A$, and consider $\ell$ consecutive rows the union of which contains $A$. Let the lowest of these rows have number $p \ell+q$ with $0 \leqslant p, q \leqslant \ell-1$ (notice that $p \ell+q \leqslant \ell^{2}-\ell$ ). Then the rooks in this union are placed in the columns with numbers $q \ell+p,(q+1) \ell+p, \ldots,(\ell-1) \ell+p$, $p+1, \ell+(p+1), \ldots,(q-1) \ell+p+1$, or, putting these numbers in increasing order, + +$$ +p+1, \ell+(p+1), \ldots,(q-1) \ell+(p+1), q \ell+p,(q+1) \ell+p, \ldots,(\ell-1) \ell+p +$$ + +One readily checks that the first number in this list is at most $\ell-1$ (if $p=\ell-1$, then $q=0$, and the first listed number is $q \ell+p=\ell-1$ ), the last one is at least $(\ell-1) \ell$, and the difference between any two consecutive numbers is at most $\ell$. Thus, one of the $\ell$ consecutive columns intersecting $A$ contains a number listed above, and the rook in this column is inside $A$, as required. The construction for $n=\ell^{2}$ is established. + +It remains to construct a happy configuration of rooks not containing an empty $\ell \times \ell$ square for $n<\ell^{2}$. In order to achieve this, take the construction for an $\ell^{2} \times \ell^{2}$ square described above and remove the $\ell^{2}-n$ bottom rows together with the $\ell^{2}-n$ rightmost columns. We will have a rook arrangement with no empty $\ell \times \ell$ square, but several rows and columns may happen to be empty. Clearly, the number of empty rows is equal to the number of empty columns, so one can find a bijection between them, and put a rook on any crossing of an empty row and an empty column corresponding to each other. + +Comment. Part (i) allows several different proofs. E.g., in the last paragraph of the solution, it suffices to deal only with the case $n=\ell^{2}+1$. Notice now that among the four corner squares, at least one is empty. So the rooks in its row and in its column are distinct. Now, deleting this row and column we obtain an $\ell^{2} \times \ell^{2}$ square with $\ell^{2}-1$ rooks in it. This square can be partitioned into $\ell^{2}$ squares of size $\ell \times \ell$, so one of them is empty. + +C4. Construct a tetromino by attaching two $2 \times 1$ dominoes along their longer sides such that the midpoint of the longer side of one domino is a corner of the other domino. This construction yields two kinds of tetrominoes with opposite orientations. Let us call them Sand Z-tetrominoes, respectively. + + +Assume that a lattice polygon $P$ can be tiled with S-tetrominoes. Prove than no matter how we tile $P$ using only S - and Z -tetrominoes, we always use an even number of Z -tetrominoes. +(Hungary) +Solution 1. We may assume that polygon $P$ is the union of some squares of an infinite chessboard. Colour the squares of the chessboard with two colours as the figure below illustrates. + + +Observe that no matter how we tile $P$, any S-tetromino covers an even number of black squares, whereas any Z-tetromino covers an odd number of them. As $P$ can be tiled exclusively by S-tetrominoes, it contains an even number of black squares. But if some S-tetrominoes and some Z-tetrominoes cover an even number of black squares, then the number of Z-tetrominoes must be even. + +Comment. An alternative approach makes use of the following two colourings, which are perhaps somewhat more natural: + + +Let $s_{1}$ and $s_{2}$ be the number of $S$-tetrominoes of the first and second type (as shown in the figure above) respectively that are used in a tiling of $P$. Likewise, let $z_{1}$ and $z_{2}$ be the number of $Z$-tetrominoes of the first and second type respectively. The first colouring shows that $s_{1}+z_{2}$ is invariant modulo 2 , the second colouring shows that $s_{1}+z_{1}$ is invariant modulo 2 . Adding these two conditions, we find that $z_{1}+z_{2}$ is invariant modulo 2 , which is what we have to prove. Indeed, the sum of the two colourings (regarding white as 0 and black as 1 and adding modulo 2) is the colouring shown in the solution. + +Solution 2. Let us assign coordinates to the squares of the infinite chessboard in such a way that the squares of $P$ have nonnegative coordinates only, and that the first coordinate increases as one moves to the right, while the second coordinate increases as one moves upwards. Write the integer $3^{i} \cdot(-3)^{j}$ into the square with coordinates $(i, j)$, as in the following figure: + +| $\vdots$ | | | | | | +| :---: | :---: | :---: | :---: | :---: | :---: | +| 81 | $\vdots$ | | | | | +| -27 | -81 | $\vdots$ | | | | +| 9 | 27 | 81 | $\cdots$ | | | +| -3 | -9 | -27 | -81 | $\cdots$ | | +| 1 | 3 | 9 | 27 | 81 | $\cdots$ | + +The sum of the numbers written into four squares that can be covered by an $S$-tetromino is either of the form + +$$ +3^{i} \cdot(-3)^{j} \cdot\left(1+3+3 \cdot(-3)+3^{2} \cdot(-3)\right)=-32 \cdot 3^{i} \cdot(-3)^{j} +$$ + +(for the first type of $S$-tetrominoes), or of the form + +$$ +3^{i} \cdot(-3)^{j} \cdot\left(3+3 \cdot(-3)+(-3)+(-3)^{2}\right)=0 +$$ + +and thus divisible by 32 . For this reason, the sum of the numbers written into the squares of $P$, and thus also the sum of the numbers covered by $Z$-tetrominoes in the second covering, is likewise divisible by 32 . Now the sum of the entries of a $Z$-tetromino is either of the form + +$$ +3^{i} \cdot(-3)^{j} \cdot\left(3+3^{2}+(-3)+3 \cdot(-3)\right)=0 +$$ + +(for the first type of $Z$-tetrominoes), or of the form + +$$ +3^{i} \cdot(-3)^{j} \cdot\left(1+(-3)+3 \cdot(-3)+3 \cdot(-3)^{2}\right)=16 \cdot 3^{i} \cdot(-3)^{j} +$$ + +i.e., 16 times an odd number. Thus in order to obtain a total that is divisible by 32 , an even number of the latter kind of $Z$-tetrominoes needs to be used. Rotating everything by $90^{\circ}$, we find that the number of $Z$-tetrominoes of the first kind is even as well. So we have even proven slightly more than necessary. + +Comment 1. In the second solution, 3 and -3 can be replaced by other combinations as well. For example, for any positive integer $a \equiv 3(\bmod 4)$, we can write $a^{i} \cdot(-a)^{j}$ into the square with coordinates $(i, j)$ and apply the same argument. + +Comment 2. As the second solution shows, we even have the stronger result that the parity of the number of each of the four types of tetrominoes in a tiling of $P$ by S - and Z-tetrominoes is an invariant of $P$. This also remains true if there is no tiling of $P$ that uses only S-tetrominoes. + +C5. Consider $n \geqslant 3$ lines in the plane such that no two lines are parallel and no three have a common point. These lines divide the plane into polygonal regions; let $\mathcal{F}$ be the set of regions having finite area. Prove that it is possible to colour $\lceil\sqrt{n / 2}\rceil$ of the lines blue in such a way that no region in $\mathcal{F}$ has a completely blue boundary. (For a real number $x,\lceil x\rceil$ denotes the least integer which is not smaller than $x$.) +(Austria) +Solution. Let $L$ be the given set of lines. Choose a maximal (by inclusion) subset $B \subseteq L$ such that when we colour the lines of $B$ blue, no region in $\mathcal{F}$ has a completely blue boundary. Let $|B|=k$. We claim that $k \geqslant\lceil\sqrt{n / 2}\rceil$. + +Let us colour all the lines of $L \backslash B$ red. Call a point blue if it is the intersection of two blue lines. Then there are $\binom{k}{2}$ blue points. + +Now consider any red line $\ell$. By the maximality of $B$, there exists at least one region $A \in \mathcal{F}$ whose only red side lies on $\ell$. Since $A$ has at least three sides, it must have at least one blue vertex. Let us take one such vertex and associate it to $\ell$. + +Since each blue point belongs to four regions (some of which may be unbounded), it is associated to at most four red lines. Thus the total number of red lines is at most $4\binom{k}{2}$. On the other hand, this number is $n-k$, so + +$$ +n-k \leqslant 2 k(k-1), \quad \text { thus } \quad n \leqslant 2 k^{2}-k \leqslant 2 k^{2} +$$ + +and finally $k \geqslant\lceil\sqrt{n / 2}\rceil$, which gives the desired result. +Comment 1. The constant factor in the estimate can be improved in different ways; we sketch two of them below. On the other hand, the Problem Selection Committee is not aware of any results showing that it is sometimes impossible to colour $k$ lines satisfying the desired condition for $k \gg \sqrt{n}$. In this situation we find it more suitable to keep the original formulation of the problem. + +1. Firstly, we show that in the proof above one has in fact $k=|B| \geqslant\lceil\sqrt{2 n / 3}\rceil$. + +Let us make weighted associations as follows. Let a region $A$ whose only red side lies on $\ell$ have $k$ vertices, so that $k-2$ of them are blue. We associate each of these blue vertices to $\ell$, and put the weight $\frac{1}{k-2}$ on each such association. So the sum of the weights of all the associations is exactly $n-k$. + +Now, one may check that among the four regions adjacent to a blue vertex $v$, at most two are triangles. This means that the sum of the weights of all associations involving $v$ is at most $1+1+\frac{1}{2}+\frac{1}{2}=3$. This leads to the estimate + +$$ +n-k \leqslant 3\binom{k}{2} +$$ + +or + +$$ +2 n \leqslant 3 k^{2}-k<3 k^{2} +$$ + +which yields $k \geqslant\lceil\sqrt{2 n / 3}\rceil$. +2. Next, we even show that $k=|B| \geqslant\lceil\sqrt{n}\rceil$. For this, we specify the process of associating points to red lines in one more different way. + +Call a point red if it lies on a red line as well as on a blue line. Consider any red line $\ell$, and take an arbitrary region $A \in \mathcal{F}$ whose only red side lies on $\ell$. Let $r^{\prime}, r, b_{1}, \ldots, b_{k}$ be its vertices in clockwise order with $r^{\prime}, r \in \ell$; then the points $r^{\prime}, r$ are red, while all the points $b_{1}, \ldots, b_{k}$ are blue. Let us associate to $\ell$ the red point $r$ and the blue point $b_{1}$. One may notice that to each pair of a red point $r$ and a blue point $b$, at most one red line can be associated, since there is at most one region $A$ having $r$ and $b$ as two clockwise consecutive vertices. + +We claim now that at most two red lines are associated to each blue point $b$; this leads to the desired bound + +$$ +n-k \leqslant 2\binom{k}{2} \quad \Longleftrightarrow \quad n \leqslant k^{2} +$$ + +Assume, to the contrary, that three red lines $\ell_{1}, \ell_{2}$, and $\ell_{3}$ are associated to the same blue point $b$. Let $r_{1}, r_{2}$, and $r_{3}$ respectively be the red points associated to these lines; all these points are distinct. The point $b$ defines four blue rays, and each point $r_{i}$ is the red point closest to $b$ on one of these rays. So we may assume that the points $r_{2}$ and $r_{3}$ lie on one blue line passing through $b$, while $r_{1}$ lies on the other one. + + +Now consider the region $A$ used to associate $r_{1}$ and $b$ with $\ell_{1}$. Three of its clockwise consecutive vertices are $r_{1}, b$, and either $r_{2}$ or $r_{3}$ (say, $r_{2}$ ). Since $A$ has only one red side, it can only be the triangle $r_{1} b r_{2}$; but then both $\ell_{1}$ and $\ell_{2}$ pass through $r_{2}$, as well as some blue line. This is impossible by the problem assumptions. + +Comment 2. The condition that the lines be non-parallel is essentially not used in the solution, nor in the previous comment; thus it may be omitted. + +C6. We are given an infinite deck of cards, each with a real number on it. For every real number $x$, there is exactly one card in the deck that has $x$ written on it. Now two players draw disjoint sets $A$ and $B$ of 100 cards each from this deck. We would like to define a rule that declares one of them a winner. This rule should satisfy the following conditions: + +1. The winner only depends on the relative order of the 200 cards: if the cards are laid down in increasing order face down and we are told which card belongs to which player, but not what numbers are written on them, we can still decide the winner. +2. If we write the elements of both sets in increasing order as $A=\left\{a_{1}, a_{2}, \ldots, a_{100}\right\}$ and $B=\left\{b_{1}, b_{2}, \ldots, b_{100}\right\}$, and $a_{i}>b_{i}$ for all $i$, then $A$ beats $B$. +3. If three players draw three disjoint sets $A, B, C$ from the deck, $A$ beats $B$ and $B$ beats $C$, then $A$ also beats $C$. + +How many ways are there to define such a rule? Here, we consider two rules as different if there exist two sets $A$ and $B$ such that $A$ beats $B$ according to one rule, but $B$ beats $A$ according to the other. +(Russia) +Answer. 100. +Solution 1. We prove a more general statement for sets of cardinality $n$ (the problem being the special case $n=100$, then the answer is $n$ ). In the following, we write $A>B$ or $Bb_{k}$. This rule clearly satisfies all three conditions, and the rules corresponding to different $k$ are all different. Thus there are at least $n$ different rules. + +Part II. Now we have to prove that there is no other way to define such a rule. Suppose that our rule satisfies the conditions, and let $k \in\{1,2, \ldots, n\}$ be minimal with the property that + +$$ +A_{k}=\{1,2, \ldots, k, n+k+1, n+k+2, \ldots, 2 n\} \prec B_{k}=\{k+1, k+2, \ldots, n+k\} +$$ + +Clearly, such a $k$ exists, since this holds for $k=n$ by assumption. Now consider two disjoint sets $X=\left\{x_{1}, x_{2}, \ldots, x_{n}\right\}$ and $Y=\left\{y_{1}, y_{2}, \ldots, y_{n}\right\}$, both in increasing order (i.e., $x_{1} B_{k-1}$ by our choice of $k$, we also have $U>W$ (if $k=1$, this is trivial). +- The elements of $V \cup W$ are ordered in the same way as those of $A_{k} \cup B_{k}$, and since $A_{k} \prec B_{k}$ by our choice of $k$, we also have $V \prec W$. + +It follows that + +$$ +X \prec V \prec W \prec U \prec Y +$$ + +so $X (\{1\} \cup\{3 i-1 \mid 2 \leqslant i \leqslant n-1\} \cup\{3 n\}) . +$$ + +Likewise, if the second relation does not hold, then we must also have + +$$ +(\{1\} \cup\{3 i-1 \mid 2 \leqslant i \leqslant n-1\} \cup\{3 n\})>(\{3\} \cup\{3 i \mid 2 \leqslant i \leqslant n-1\} \cup\{3 n-1\}) +$$ + +Now condition 3 implies that + +$$ +(\{2\} \cup\{3 i-2 \mid 2 \leqslant i \leqslant n-1\} \cup\{3 n-2\})>(\{3\} \cup\{3 i \mid 2 \leqslant i \leqslant n-1\} \cup\{3 n-1\}) +$$ + +which contradicts the second condition. +Now we distinguish two cases, depending on which of the two relations actually holds: +First case: $(\{2\} \cup\{2 i-1 \mid 2 \leqslant i \leqslant n\})<(\{1\} \cup\{2 i \mid 2 \leqslant i \leqslant n\})$. +Let $A=\left\{a_{1}, a_{2}, \ldots, a_{n}\right\}$ and $B=\left\{b_{1}, b_{2}, \ldots, b_{n}\right\}$ be two disjoint sets, both in increasing order. We claim that the winner can be decided only from the values of $a_{2}, \ldots, a_{n}$ and $b_{2}, \ldots, b_{n}$, while $a_{1}$ and $b_{1}$ are actually irrelevant. Suppose that this was not the case, and assume without loss of generality that $a_{2} 0$ be smaller than half the distance between any two of the numbers in $B_{x} \cup B_{y} \cup A$. For any set $M$, let $M \pm \varepsilon$ be the set obtained by adding/subtracting $\varepsilon$ to all elements of $M$. By our choice of $\varepsilon$, the relative order of the elements of $\left(B_{y}+\varepsilon\right) \cup A$ is still the same as for $B_{y} \cup A$, while the relative order of the elements of $\left(B_{x}-\varepsilon\right) \cup A$ is still the same as for $B_{x} \cup A$. Thus $A \prec B_{x}-\varepsilon$, but $A>B_{y}+\varepsilon$. Moreover, if $y>x$, then $B_{x}-\varepsilon \prec B_{y}+\varepsilon$ by condition 2, while otherwise the relative order of +the elements in $\left(B_{x}-\varepsilon\right) \cup\left(B_{y}+\varepsilon\right)$ is the same as for the two sets $\{2\} \cup\{2 i-1 \mid 2 \leqslant i \leqslant n\}$ and $\{1\} \cup\{2 i \mid 2 \leqslant i \leqslant n\}$, so that $B_{x}-\varepsilon _{\sigma} B$ if and only if $\left(a_{\sigma(1)}, \ldots, a_{\sigma(n)}\right)$ is lexicographically greater than $\left(b_{\sigma(1)}, \ldots, b_{\sigma(n)}\right)$. + +It seems, however, that this formulation adds rather more technicalities to the problem than additional ideas. + +This page is intentionally left blank + +C7. Let $M$ be a set of $n \geqslant 4$ points in the plane, no three of which are collinear. Initially these points are connected with $n$ segments so that each point in $M$ is the endpoint of exactly two segments. Then, at each step, one may choose two segments $A B$ and $C D$ sharing a common interior point and replace them by the segments $A C$ and $B D$ if none of them is present at this moment. Prove that it is impossible to perform $n^{3} / 4$ or more such moves. +(Russia) +Solution. A line is said to be red if it contains two points of $M$. As no three points of $M$ are collinear, each red line determines a unique pair of points of $M$. Moreover, there are precisely $\binom{n}{2}<\frac{n^{2}}{2}$ red lines. By the value of a segment we mean the number of red lines intersecting it in its interior, and the value of a set of segments is defined to be the sum of the values of its elements. We will prove that $(i)$ the value of the initial set of segments is smaller than $n^{3} / 2$ and that (ii) each step decreases the value of the set of segments present by at least 2 . Since such a value can never be negative, these two assertions imply the statement of the problem. + +To show $(i)$ we just need to observe that each segment has a value that is smaller than $n^{2} / 2$. Thus the combined value of the $n$ initial segments is indeed below $n \cdot n^{2} / 2=n^{3} / 2$. + +It remains to establish (ii). Suppose that at some moment we have two segments $A B$ and $C D$ sharing an interior point $S$, and that at the next moment we have the two segments $A C$ and $B D$ instead. Let $X_{A B}$ denote the set of red lines intersecting the segment $A B$ in its interior and let the sets $X_{A C}, X_{B D}$, and $X_{C D}$ be defined similarly. We are to prove that $\left|X_{A C}\right|+\left|X_{B D}\right|+2 \leqslant\left|X_{A B}\right|+\left|X_{C D}\right|$. + +As a first step in this direction, we claim that + +$$ +\left|X_{A C} \cup X_{B D}\right|+2 \leqslant\left|X_{A B} \cup X_{C D}\right| . +$$ + +Indeed, if $g$ is a red line intersecting, e.g. the segment $A C$ in its interior, then it has to intersect the triangle $A C S$ once again, either in the interior of its side $A S$, or in the interior of its side $C S$, or at $S$, meaning that it belongs to $X_{A B}$ or to $X_{C D}$ (see Figure 1). Moreover, the red lines $A B$ and $C D$ contribute to $X_{A B} \cup X_{C D}$ but not to $X_{A C} \cup X_{B D}$. Thereby (1) is proved. + + +Figure 1 + + +Figure 2 + + +Figure 3 + +Similarly but more easily one obtains + +$$ +\left|X_{A C} \cap X_{B D}\right| \leqslant\left|X_{A B} \cap X_{C D}\right| +$$ + +Indeed, a red line $h$ appearing in $X_{A C} \cap X_{B D}$ belongs, for similar reasons as above, also to $X_{A B} \cap X_{C D}$. To make the argument precise, one may just distinguish the cases $S \in h$ (see Figure 2) and $S \notin h$ (see Figure 3). Thereby (2) is proved. + +Adding (1) and (2) we obtain the desired conclusion, thus completing the solution of this problem. + +Comment 1. There is a problem belonging to the folklore, in the solution of which one may use the same kind of operation: + +Given $n$ red and $n$ green points in the plane, prove that one may draw $n$ nonintersecting segments each of which connects a red point with a green point. + +A standard approach to this problem consists in taking $n$ arbitrary segments connecting the red points with the green points, and to perform the same operation as in the above proposal whenever an intersection occurs. Now each time one performs such a step, the total length of the segments that are present decreases due to the triangle inequality. So, as there are only finitely many possibilities for the set of segments present, the process must end at some stage. + +In the above proposal, however, considering the sum of the Euclidean lengths of the segment that are present does not seem to help much, for even though it shows that the process must necessarily terminate after some finite number of steps, it does not seem to easily yield any upper bound on the number of these steps that grows polynomially with $n$. + +One may regard the concept of the value of a segment introduced in the above solution as an appropriately discretised version of Euclidean length suitable for obtaining such a bound. + +The Problem Selection Committee still believes the problem to be sufficiently original for the competition. + +Comment 2. There are some other essentially equivalent ways of presenting the same solution. E.g., put $M=\left\{A_{1}, A_{2}, \ldots, A_{n}\right\}$, denote the set of segments present at any moment by $\left\{e_{1}, e_{2}, \ldots, e_{n}\right\}$, and called a triple $(i, j, k)$ of indices with $i \neq j$ intersecting, if the line $A_{i} A_{j}$ intersects the segment $e_{k}$. It may then be shown that the number $S$ of intersecting triples satisfies $0 \leqslant S 0$ ). It would be interesting to say more about the gap between $c n^{2}$ and $c n^{3}$. + +C8. A card deck consists of 1024 cards. On each card, a set of distinct decimal digits is written in such a way that no two of these sets coincide (thus, one of the cards is empty). Two players alternately take cards from the deck, one card per turn. After the deck is empty, each player checks if he can throw out one of his cards so that each of the ten digits occurs on an even number of his remaining cards. If one player can do this but the other one cannot, the one who can is the winner; otherwise a draw is declared. + +Determine all possible first moves of the first player after which he has a winning strategy. +(Russia) +Answer. All the moves except for taking the empty card. + +Solution. Let us identify each card with the set of digits written on it. For any collection of cards $C_{1}, C_{2}, \ldots, C_{k}$ denote by their sum the set $C_{1} \triangle C_{2} \triangle \cdots \triangle C_{k}$ consisting of all elements belonging to an odd number of the $C_{i}$ 's. Denote the first and the second player by $\mathcal{F}$ and $\mathcal{S}$, respectively. + +Since each digit is written on exactly 512 cards, the sum of all the cards is $\varnothing$. Therefore, at the end of the game the sum of all the cards of $\mathcal{F}$ will be the same as that of $\mathcal{S}$; denote this sum by $C$. Then the player who took $C$ can throw it out and get the desired situation, while the other one cannot. Thus, the player getting card $C$ wins, and no draw is possible. + +Now, given a nonempty card $B$, one can easily see that all the cards can be split into 512 pairs of the form $(X, X \triangle B)$ because $(X \triangle B) \triangle B=X$. The following lemma shows a property of such a partition that is important for the solution. +Lemma. Let $B \neq \varnothing$ be some card. Let us choose 512 cards so that exactly one card is chosen from every pair $(X, X \triangle B)$. Then the sum of all chosen cards is either $\varnothing$ or $B$. +Proof. Let $b$ be some element of $B$. Enumerate the pairs; let $X_{i}$ be the card not containing $b$ in the $i^{\text {th }}$ pair, and let $Y_{i}$ be the other card in this pair. Then the sets $X_{i}$ are exactly all the sets not containing $b$, therefore each digit $a \neq b$ is written on exactly 256 of these cards, so $X_{1} \triangle X_{2} \triangle \cdots \triangle X_{512}=\varnothing$. Now, if we replace some summands in this sum by the other elements from their pairs, we will simply add $B$ several times to this sum, thus the sum will either remain unchanged or change by $B$, as required. + +Now we consider two cases. +Case 1. Assume that $\mathcal{F}$ takes the card $\varnothing$ on his first move. In this case, we present a winning strategy for $\mathcal{S}$. + +Let $\mathcal{S}$ take an arbitrary card $A$. Assume that $\mathcal{F}$ takes card $B$ after that; then $\mathcal{S}$ takes $A \triangle B$. Split all 1024 cards into 512 pairs of the form $(X, X \triangle B)$; we call two cards in one pair partners. Then the four cards taken so far form two pairs $(\varnothing, B)$ and $(A, A \triangle B)$ belonging to $\mathcal{F}$ and $\mathcal{S}$, respectively. On each of the subsequent moves, when $\mathcal{F}$ takes some card, $\mathcal{S}$ should take the partner of this card in response. + +Consider the situation at the end of the game. Let us for a moment replace card $A$ belonging to $\mathcal{S}$ by $\varnothing$. Then he would have one card from each pair; by our lemma, the sum of all these cards would be either $\varnothing$ or $B$. Now, replacing $\varnothing$ back by $A$ we get that the actual sum of the cards of $\mathcal{S}$ is either $A$ or $A \triangle B$, and he has both these cards. Thus $\mathcal{S}$ wins. + +Case 2. Now assume that $\mathcal{F}$ takes some card $A \neq \varnothing$ on his first move. Let us present a winning strategy for $\mathcal{F}$ in this case. + +Assume that $\mathcal{S}$ takes some card $B \neq \varnothing$ on his first move; then $\mathcal{F}$ takes $A \triangle B$. Again, let us split all the cards into pairs of the form $(X, X \triangle B)$; then the cards which have not been taken yet form several complete pairs and one extra element (card $\varnothing$ has not been taken while its partner $B$ has). Now, on each of the subsequent moves, if $\mathcal{S}$ takes some element from a +complete pair, then $\mathcal{F}$ takes its partner. If $\mathcal{S}$ takes the extra element, then $\mathcal{F}$ takes an arbitrary card $Y$, and the partner of $Y$ becomes the new extra element. + +Thus, on his last move $\mathcal{S}$ is forced to take the extra element. After that player $\mathcal{F}$ has cards $A$ and $A \triangle B$, player $\mathcal{S}$ has cards $B$ and $\varnothing$, and $\mathcal{F}$ has exactly one element from every other pair. Thus the situation is the same as in the previous case with roles reversed, and $\mathcal{F}$ wins. + +Finally, if $\mathcal{S}$ takes $\varnothing$ on his first move then $\mathcal{F}$ denotes any card which has not been taken yet by $B$ and takes $A \triangle B$. After that, the same strategy as above is applicable. + +Comment 1. If one wants to avoid the unusual question about the first move, one may change the formulation as follows. (The difficulty of the problem would decrease somewhat.) + +A card deck consists of 1023 cards; on each card, a nonempty set of distinct decimal digits is written in such a way that no two of these sets coincide. Two players alternately take cards from the deck, one card per turn. When the deck is empty, each player checks if he can throw out one of his cards so that for each of the ten digits, he still holds an even number of cards with this digit. If one player can do this but the other one cannot, the one who can is the winner; otherwise a draw is declared. + +Determine which of the players (if any) has a winning strategy. +The winner in this version is the first player. The analysis of the game from the first two paragraphs of the previous solution applies to this version as well, except for the case $C=\varnothing$ in which the result is a draw. Then the strategy for $\mathcal{S}$ in Case 1 works for $\mathcal{F}$ in this version: the sum of all his cards at the end is either $A$ or $A \triangle B$, thus nonempty in both cases. + +Comment 2. Notice that all the cards form a vector space over $\mathbb{F}_{2}$, with $\triangle$ the operation of addition. Due to the automorphisms of this space, all possibilities for $\mathcal{F}$ 's first move except $\varnothing$ are equivalent. The same holds for the response by $\mathcal{S}$ if $\mathcal{F}$ takes the card $\varnothing$ on his first move. + +Comment 3. It is not that hard to show that in the initial game, $\mathcal{F}$ has a winning move, by the idea of "strategy stealing". + +Namely, assume that $\mathcal{S}$ has a winning strategy. Let us take two card decks and start two games, in which $\mathcal{S}$ will act by his strategy. In the first game, $\mathcal{F}$ takes an arbitrary card $A_{1}$; assume that $\mathcal{S}$ takes some $B_{1}$ in response. Then $\mathcal{F}$ takes the card $B_{1}$ at the second game; let the response by $\mathcal{S}$ be $A_{2}$. Then $\mathcal{F}$ takes $A_{2}$ in the first game and gets a response $B_{2}$, and so on. + +This process stops at some moment when in the second game $\mathcal{S}$ takes $A_{i}=A_{1}$. At this moment the players hold the same sets of cards in both games, but with roles reversed. Now, if some cards remain in the decks, $\mathcal{F}$ takes an arbitrary card from the first deck starting a similar cycle. + +At the end of the game, player $\mathcal{F}$ 's cards in the first game are exactly player $\mathcal{S}$ 's cards in the second game, and vice versa. Thus in one of the games $\mathcal{F}$ will win, which is impossible by our assumption. + +One may notice that the strategy in Case 2 is constructed exactly in this way from the strategy in Case 1 . This is possible since every response by $\mathcal{S}$ wins if $\mathcal{F}$ takes the card $\varnothing$ on his first move. + +C9. There are $n$ circles drawn on a piece of paper in such a way that any two circles intersect in two points, and no three circles pass through the same point. Turbo the snail slides along the circles in the following fashion. Initially he moves on one of the circles in clockwise direction. Turbo always keeps sliding along the current circle until he reaches an intersection with another circle. Then he continues his journey on this new circle and also changes the direction of moving, i.e. from clockwise to anticlockwise or vice versa. + +Suppose that Turbo's path entirely covers all circles. Prove that $n$ must be odd. +(India) +Solution 1. Replace every cross (i.e. intersection of two circles) by two small circle arcs that indicate the direction in which the snail should leave the cross (see Figure 1.1). Notice that the placement of the small arcs does not depend on the direction of moving on the curves; no matter which direction the snail is moving on the circle arcs, he will follow the same curves (see Figure 1.2). In this way we have a set of curves, that are the possible paths of the snail. Call these curves snail orbits or just orbits. Every snail orbit is a simple closed curve that has no intersection with any other orbit. + + +Figure 1.1 + + +Figure 1.2 + +We prove the following, more general statement. +(*) In any configuration of $n$ circles such that no two of them are tangent, the number of snail orbits has the same parity as the number $n$. (Note that it is not assumed that all circle pairs intersect.) + +This immediately solves the problem. +Let us introduce the following operation that will be called flipping a cross. At a cross, remove the two small arcs of the orbits, and replace them by the other two arcs. Hence, when the snail arrives at a flipped cross, he will continue on the other circle as before, but he will preserve the orientation in which he goes along the circle arcs (see Figure 2). + + +Figure 2 +Consider what happens to the number of orbits when a cross is flipped. Denote by $a, b, c$, and $d$ the four arcs that meet at the cross such that $a$ and $b$ belong to the same circle. Before the flipping $a$ and $b$ were connected to $c$ and $d$, respectively, and after the flipping $a$ and $b$ are connected to $d$ and $c$, respectively. + +The orbits passing through the cross are closed curves, so each of the $\operatorname{arcs} a, b, c$, and $d$ is connected to another one by orbits outside the cross. We distinguish three cases. + +Case 1: $a$ is connected to $b$ and $c$ is connected to $d$ by the orbits outside the cross (see Figure 3.1). + +We show that this case is impossible. Remove the two small arcs at the cross, connect $a$ to $b$, and connect $c$ to $d$ at the cross. Let $\gamma$ be the new closed curve containing $a$ and $b$, and let $\delta$ be the new curve that connects $c$ and $d$. These two curves intersect at the cross. So one of $c$ and $d$ is inside $\gamma$ and the other one is outside $\gamma$. Then the two closed curves have to meet at least one more time, but this is a contradiction, since no orbit can intersect itself. + + +Figure 3.1 + + +Figure 3.2 + + +Figure 3.3 + +Case 2: $a$ is connected to $c$ and $b$ is connected to $d$ (see Figure 3.2). +Before the flipping $a$ and $c$ belong to one orbit and $b$ and $d$ belong to another orbit. Flipping the cross merges the two orbits into a single orbit. Hence, the number of orbits decreases by 1. + +Case 3: $a$ is connected to $d$ and $b$ is connected to $c$ (see Figure 3.3). +Before the flipping the arcs $a, b, c$, and $d$ belong to a single orbit. Flipping the cross splits that orbit in two. The number of orbits increases by 1. + +As can be seen, every flipping decreases or increases the number of orbits by one, thus changes its parity. + +Now flip every cross, one by one. Since every pair of circles has 0 or 2 intersections, the number of crosses is even. Therefore, when all crosses have been flipped, the original parity of the number of orbits is restored. So it is sufficient to prove (*) for the new configuration, where all crosses are flipped. Of course also in this new configuration the (modified) orbits are simple closed curves not intersecting each other. + +Orient the orbits in such a way that the snail always moves anticlockwise along the circle arcs. Figure 4 shows the same circles as in Figure 1 after flipping all crosses and adding orientation. (Note that this orientation may be different from the orientation of the orbit as a planar curve; the orientation of every orbit may be negative as well as positive, like the middle orbit in Figure 4.) If the snail moves around an orbit, the total angle change in his moving direction, the total curvature, is either $+2 \pi$ or $-2 \pi$, depending on the orientation of the orbit. Let $P$ and $N$ be the number of orbits with positive and negative orientation, respectively. Then the total curvature of all orbits is $(P-N) \cdot 2 \pi$. + + +Figure 4 + + +Figure 5 + +Double-count the total curvature of all orbits. Along every circle the total curvature is $2 \pi$. At every cross, the two turnings make two changes with some angles having the same absolute value but opposite signs, as depicted in Figure 5. So the changes in the direction at the crosses cancel out. Hence, the total curvature is $n \cdot 2 \pi$. + +Now we have $(P-N) \cdot 2 \pi=n \cdot 2 \pi$, so $P-N=n$. The number of (modified) orbits is $P+N$, that has a same parity as $P-N=n$. + +Solution 2. We present a different proof of (*). +We perform a sequence of small modification steps on the configuration of the circles in such a way that at the end they have no intersection at all (see Figure 6.1). We use two kinds of local changes to the structure of the orbits (see Figure 6.2): + +- Type-1 step: An arc of a circle is moved over an arc of another circle; such a step creates or removes two intersections. +- Type-2 step: An arc of a circle is moved through the intersection of two other circles. + + +Figure 6.1 + + +Figure 6.2 + +We assume that in every step only one circle is moved, and that this circle is moved over at most one arc or intersection point of other circles. + +We will show that the parity of the number of orbits does not change in any step. As every circle becomes a separate orbit at the end of the procedure, this fact proves (*). + +Consider what happens to the number of orbits when a Type-1 step is performed. The two intersection points are created or removed in a small neighbourhood. Denote some points of the two circles where they enter or leave this neighbourhood by $a, b, c$, and $d$ in this order around the neighbourhood; let $a$ and $b$ belong to one circle and let $c$ and $d$ belong to the other circle. The two circle arcs may have the same or opposite orientations. Moreover, the four end-points of the two arcs are connected by the other parts of the orbits. This can happen in two ways without intersection: either $a$ is connected to $d$ and $b$ is connected to $c$, or $a$ is connected to $b$ and $c$ is connected to $d$. Altogether we have four cases, as shown in Figure 7. + + +Figure 7 +We can see that the number of orbits is changed by -2 or +2 in the leftmost case when the arcs have the same orientation, $a$ is connected to $d$, and $b$ is connected to $c$. In the other three cases the number of orbits is not changed. Hence, Type-1 steps do not change the parity of the number of orbits. + +Now consider a Type-2 step. The three circles enclose a small, triangular region; by the step, this triangle is replaced by another triangle. Again, the modification of the orbits is done in some small neighbourhood; the structure does not change outside. Each side of the triangle shaped region can be convex or concave; the number of concave sides can be $0,1,2$ or 3 , so there are 4 possible arrangements of the orbits inside the neighbourhood, as shown in Figure 8. + +all convex + + +Figure 8 +Denote the points where the three circles enter or leave the neighbourhood by $a, b, c, d$, $e$, and $f$ in this order around the neighbourhood. As can be seen in Figure 8, there are only two essentially different cases; either $a, c, e$ are connected to $b, d, f$, respectively, or $a, c, e$ are connected to $f, b, d$, respectively. The step either preserves the set of connections or switches to the other arrangement. Obviously, in the earlier case the number of orbits is not changed; therefore we have to consider only the latter case. + +The points $a, b, c, d, e$, and $f$ are connected by the orbits outside, without intersection. If $a$ was connected to $c$, say, then this orbit would isolate $b$, so this is impossible. Hence, each of $a, b, c, d, e$ and $f$ must be connected either to one of its neighbours or to the opposite point. If say $a$ is connected to $d$, then this orbit separates $b$ and $c$ from $e$ and $f$, therefore $b$ must be connected to $c$ and $e$ must be connected to $f$. Altogether there are only two cases and their reverses: either each point is connected to one of its neighbours or two opposite points are connected and the the remaining neigh boring pairs are connected to each other. See Figure 9. + + +Figure 9 +We can see that if only neighbouring points are connected, then the number of orbits is changed by +2 or -2 . If two opposite points are connected ( $a$ and $d$ in the figure), then the orbits are re-arranged, but their number is unchanged. Hence, Type-2 steps also preserve the parity. This completes the proof of (*). + +Solution 3. Like in the previous solutions, we do not need all circle pairs to intersect but we assume that the circles form a connected set. Denote by $\mathcal{C}$ and $\mathcal{P}$ the sets of circles and their intersection points, respectively. + +The circles divide the plane into several simply connected, bounded regions and one unbounded region. Denote the set of these regions by $\mathcal{R}$. We say that an intersection point or a region is odd or even if it is contained inside an odd or even number of circles, respectively. Let $\mathcal{P}_{\text {odd }}$ and $\mathcal{R}_{\text {odd }}$ be the sets of odd intersection points and odd regions, respectively. + +Claim. + +$$ +\left|\mathcal{R}_{\text {odd }}\right|-\left|\mathcal{P}_{\text {odd }}\right| \equiv n \quad(\bmod 2) . +$$ + +Proof. For each circle $c \in \mathcal{C}$, denote by $R_{c}, P_{c}$, and $X_{c}$ the number of regions inside $c$, the number of intersection points inside $c$, and the number of circles intersecting $c$, respectively. The circles divide each other into several arcs; denote by $A_{c}$ the number of such arcs inside $c$. By double counting the regions and intersection points inside the circles we get + +$$ +\left|\mathcal{R}_{\mathrm{odd}}\right| \equiv \sum_{c \in \mathcal{C}} R_{c} \quad(\bmod 2) \quad \text { and } \quad\left|\mathcal{P}_{\mathrm{odd}}\right| \equiv \sum_{c \in \mathcal{C}} P_{c} \quad(\bmod 2) . +$$ + +For each circle $c$, apply EULER's polyhedron theorem to the (simply connected) regions in $c$. There are $2 X_{c}$ intersection points on $c$; they divide the circle into $2 X_{c}$ arcs. The polyhedron theorem yields $\left(R_{c}+1\right)+\left(P_{c}+2 X_{c}\right)=\left(A_{c}+2 X_{c}\right)+2$, considering the exterior of $c$ as a single region. Therefore, + +$$ +R_{c}+P_{c}=A_{c}+1 +$$ + +Moreover, we have four arcs starting from every interior points inside $c$ and a single arc starting into the interior from each intersection point on the circle. By double-counting the end-points of the interior arcs we get $2 A_{c}=4 P_{c}+2 X_{c}$, so + +$$ +A_{c}=2 P_{c}+X_{c} +$$ + +The relations (2) and (3) together yield + +$$ +R_{c}-P_{c}=X_{c}+1 +$$ + +By summing up (4) for all circles we obtain + +$$ +\sum_{c \in \mathcal{C}} R_{c}-\sum_{c \in \mathcal{C}} P_{c}=\sum_{c \in \mathcal{C}} X_{c}+|\mathcal{C}| +$$ + +which yields + +$$ +\left|\mathcal{R}_{\mathrm{odd}}\right|-\left|\mathcal{P}_{\mathrm{odd}}\right| \equiv \sum_{c \in \mathcal{C}} X_{c}+n \quad(\bmod 2) +$$ + +Notice that in $\sum_{c \in \mathcal{C}} X_{c}$ each intersecting circle pair is counted twice, i.e., for both circles in the pair, so + +$$ +\sum_{c \in \mathcal{C}} X_{c} \equiv 0 \quad(\bmod 2) +$$ + +which finishes the proof of the Claim. +Now insert the same small arcs at the intersections as in the first solution, and suppose that there is a single snail orbit $b$. + +First we show that the odd regions are inside the curve $b$, while the even regions are outside. Take a region $r \in \mathcal{R}$ and a point $x$ in its interior, and draw a ray $y$, starting from $x$, that does not pass through any intersection point of the circles and is neither tangent to any of the circles. As is well-known, $x$ is inside the curve $b$ if and only if $y$ intersects $b$ an odd number of times (see Figure 10). Notice that if an arbitrary circle $c$ contains $x$ in its interior, then $c$ intersects $y$ at a single point; otherwise, if $x$ is outside $c$, then $c$ has 2 or 0 intersections with $y$. Therefore, $y$ intersects $b$ an odd number of times if and only if $x$ is contained in an odd number of circles, so if and only if $r$ is odd. + + +Figure 10 +Now consider an intersection point $p$ of two circles $c_{1}$ and $c_{2}$ and a small neighbourhood around $p$. Suppose that $p$ is contained inside $k$ circles. + +We have four regions that meet at $p$. Let $r_{1}$ be the region that lies outside both $c_{1}$ and $c_{2}$, let $r_{2}$ be the region that lies inside both $c_{1}$ and $c_{2}$, and let $r_{3}$ and $r_{4}$ be the two remaining regions, each lying inside exactly one of $c_{1}$ and $c_{2}$. The region $r_{1}$ is contained inside the same $k$ circles as $p$; the region $r_{2}$ is contained also by $c_{1}$ and $c_{2}$, so by $k+2$ circles in total; each of the regions $r_{3}$ and $r_{4}$ is contained inside $k+1$ circles. After the small arcs have been inserted at $p$, the regions $r_{1}$ and $r_{2}$ get connected, and the regions $r_{3}$ and $r_{4}$ remain separated at $p$ (see Figure 11). If $p$ is an odd point, then $r_{1}$ and $r_{2}$ are odd, so two odd regions are connected at $p$. Otherwise, if $p$ is even, then we have two even regions connected at $p$. + + +Figure 11 + + +Figure 12 + +Consider the system of odd regions and their connections at the odd points as a graph. In this graph the odd regions are the vertices, and each odd point establishes an edge that connects two vertices (see Figure 12). As $b$ is a single closed curve, this graph is connected and contains no cycle, so the graph is a tree. Then the number of vertices must be by one greater than the number of edges, so + +$$ +\left|\mathcal{R}_{\text {odd }}\right|-\left|\mathcal{P}_{\text {odd }}\right|=1 . +$$ + +The relations (1) and (9) together prove that $n$ must be odd. + +Comment. For every odd $n$ there exists at least one configuration of $n$ circles with a single snail orbit. Figure 13 shows a possible configuration with 5 circles. In general, if a circle is rotated by $k \cdot \frac{360^{\circ}}{n}$ $(k=1,2, \ldots, n-1)$ around an interior point other than the centre, the circle and its rotated copies together provide a single snail orbit. + + +Figure 13 + +## Geometry + +G1. The points $P$ and $Q$ are chosen on the side $B C$ of an acute-angled triangle $A B C$ so that $\angle P A B=\angle A C B$ and $\angle Q A C=\angle C B A$. The points $M$ and $N$ are taken on the rays $A P$ and $A Q$, respectively, so that $A P=P M$ and $A Q=Q N$. Prove that the lines $B M$ and $C N$ intersect on the circumcircle of the triangle $A B C$. +(Georgia) +Solution 1. Denote by $S$ the intersection point of the lines $B M$ and $C N$. Let moreover $\beta=\angle Q A C=\angle C B A$ and $\gamma=\angle P A B=\angle A C B$. From these equalities it follows that the triangles $A B P$ and $C A Q$ are similar (see Figure 1). Therefore we obtain + +$$ +\frac{B P}{P M}=\frac{B P}{P A}=\frac{A Q}{Q C}=\frac{N Q}{Q C} +$$ + +Moreover, + +$$ +\angle B P M=\beta+\gamma=\angle C Q N +$$ + +Hence the triangles $B P M$ and $N Q C$ are similar. This gives $\angle B M P=\angle N C Q$, so the triangles $B P M$ and $B S C$ are also similar. Thus we get + +$$ +\angle C S B=\angle B P M=\beta+\gamma=180^{\circ}-\angle B A C, +$$ + +which completes the solution. + + +Figure 1 + + +Figure 2 + +Solution 2. As in the previous solution, denote by $S$ the intersection point of the lines $B M$ and $N C$. Let moreover the circumcircle of the triangle $A B C$ intersect the lines $A P$ and $A Q$ again at $K$ and $L$, respectively (see Figure 2). + +Note that $\angle L B C=\angle L A C=\angle C B A$ and similarly $\angle K C B=\angle K A B=\angle B C A$. It implies that the lines $B L$ and $C K$ meet at a point $X$, being symmetric to the point $A$ with respect to the line $B C$. Since $A P=P M$ and $A Q=Q N$, it follows that $X$ lies on the line $M N$. Therefore, using Pascal's theorem for the hexagon $A L B S C K$, we infer that $S$ lies on the circumcircle of the triangle $A B C$, which finishes the proof. + +Comment. Both solutions can be modified to obtain a more general result, with the equalities + +$$ +A P=P M \quad \text { and } \quad A Q=Q N +$$ + +replaced by + +$$ +\frac{A P}{P M}=\frac{Q N}{A Q} +$$ + +G2. Let $A B C$ be a triangle. The points $K, L$, and $M$ lie on the segments $B C, C A$, and $A B$, respectively, such that the lines $A K, B L$, and $C M$ intersect in a common point. Prove that it is possible to choose two of the triangles $A L M, B M K$, and $C K L$ whose inradii sum up to at least the inradius of the triangle $A B C$. +(Estonia) +Solution. Denote + +$$ +a=\frac{B K}{K C}, \quad b=\frac{C L}{L A}, \quad c=\frac{A M}{M B} . +$$ + +By Ceva's theorem, $a b c=1$, so we may, without loss of generality, assume that $a \geqslant 1$. Then at least one of the numbers $b$ or $c$ is not greater than 1 . Therefore at least one of the pairs $(a, b)$, $(b, c)$ has its first component not less than 1 and the second one not greater than 1 . Without loss of generality, assume that $1 \leqslant a$ and $b \leqslant 1$. + +Therefore, we obtain $b c \leqslant 1$ and $1 \leqslant c a$, or equivalently + +$$ +\frac{A M}{M B} \leqslant \frac{L A}{C L} \quad \text { and } \quad \frac{M B}{A M} \leqslant \frac{B K}{K C} . +$$ + +The first inequality implies that the line passing through $M$ and parallel to $B C$ intersects the segment $A L$ at a point $X$ (see Figure 1). Therefore the inradius of the triangle $A L M$ is not less than the inradius $r_{1}$ of triangle $A M X$. + +Similarly, the line passing through $M$ and parallel to $A C$ intersects the segment $B K$ at a point $Y$, so the inradius of the triangle $B M K$ is not less than the inradius $r_{2}$ of the triangle $B M Y$. Thus, to complete our solution, it is enough to show that $r_{1}+r_{2} \geqslant r$, where $r$ is the inradius of the triangle $A B C$. We prove that in fact $r_{1}+r_{2}=r$. + + +Figure 1 +Since $M X \| B C$, the dilation with centre $A$ that takes $M$ to $B$ takes the incircle of the triangle $A M X$ to the incircle of the triangle $A B C$. Therefore + +$$ +\frac{r_{1}}{r}=\frac{A M}{A B}, \quad \text { and similarly } \quad \frac{r_{2}}{r}=\frac{M B}{A B} . +$$ + +Adding these equalities gives $r_{1}+r_{2}=r$, as required. +Comment. Alternatively, one can use Desargues' theorem instead of Ceva's theorem, as follows: The lines $A B, B C, C A$ dissect the plane into seven regions. One of them is bounded, and amongst the other six, three are two-sided and three are three-sided. Now define the points $P=B C \cap L M$, $Q=C A \cap M K$, and $R=A B \cap K L$ (in the projective plane). By Desargues' theorem, the points $P$, $Q, R$ lie on a common line $\ell$. This line intersects only unbounded regions. If we now assume (without loss of generality) that $P, Q$ and $R$ lie on $\ell$ in that order, then one of the segments $P Q$ or $Q R$ lies inside a two-sided region. If, for example, this segment is $P Q$, then the triangles $A L M$ and $B M K$ will satisfy the statement of the problem for the same reason. + +G3. Let $\Omega$ and $O$ be the circumcircle and the circumcentre of an acute-angled triangle $A B C$ with $A B>B C$. The angle bisector of $\angle A B C$ intersects $\Omega$ at $M \neq B$. Let $\Gamma$ be the circle with diameter $B M$. The angle bisectors of $\angle A O B$ and $\angle B O C$ intersect $\Gamma$ at points $P$ and $Q$, respectively. The point $R$ is chosen on the line $P Q$ so that $B R=M R$. Prove that $B R \| A C$. (Here we always assume that an angle bisector is a ray.) +(Russia) +Solution. Let $K$ be the midpoint of $B M$, i.e., the centre of $\Gamma$. Notice that $A B \neq B C$ implies $K \neq O$. Clearly, the lines $O M$ and $O K$ are the perpendicular bisectors of $A C$ and $B M$, respectively. Therefore, $R$ is the intersection point of $P Q$ and $O K$. + +Let $N$ be the second point of intersection of $\Gamma$ with the line $O M$. Since $B M$ is a diameter of $\Gamma$, the lines $B N$ and $A C$ are both perpendicular to $O M$. Hence $B N \| A C$, and it suffices to prove that $B N$ passes through $R$. Our plan for doing this is to interpret the lines $B N, O K$, and $P Q$ as the radical axes of three appropriate circles. + +Let $\omega$ be the circle with diameter $B O$. Since $\angle B N O=\angle B K O=90^{\circ}$, the points $N$ and $K$ lie on $\omega$. + +Next we show that the points $O, K, P$, and $Q$ are concyclic. To this end, let $D$ and $E$ be the midpoints of $B C$ and $A B$, respectively. Clearly, $D$ and $E$ lie on the rays $O Q$ and $O P$, respectively. By our assumptions about the triangle $A B C$, the points $B, E, O, K$, and $D$ lie in this order on $\omega$. It follows that $\angle E O R=\angle E B K=\angle K B D=\angle K O D$, so the line $K O$ externally bisects the angle $P O Q$. Since the point $K$ is the centre of $\Gamma$, it also lies on the perpendicular bisector of $P Q$. So $K$ coincides with the midpoint of the $\operatorname{arc} P O Q$ of the circumcircle $\gamma$ of triangle $P O Q$. + +Thus the lines $O K, B N$, and $P Q$ are pairwise radical axes of the circles $\omega, \gamma$, and $\Gamma$. Hence they are concurrent at $R$, as required. + + +G4. Consider a fixed circle $\Gamma$ with three fixed points $A, B$, and $C$ on it. Also, let us fix a real number $\lambda \in(0,1)$. For a variable point $P \notin\{A, B, C\}$ on $\Gamma$, let $M$ be the point on the segment $C P$ such that $C M=\lambda \cdot C P$. Let $Q$ be the second point of intersection of the circumcircles of the triangles $A M P$ and $B M C$. Prove that as $P$ varies, the point $Q$ lies on a fixed circle. +(United Kingdom) +Solution 1. Throughout the solution, we denote by $\Varangle(a, b)$ the directed angle between the lines $a$ and $b$. + +Let $D$ be the point on the segment $A B$ such that $B D=\lambda \cdot B A$. We will show that either $Q=D$, or $\Varangle(D Q, Q B)=\Varangle(A B, B C)$; this would mean that the point $Q$ varies over the constant circle through $D$ tangent to $B C$ at $B$, as required. + +Denote the circumcircles of the triangles $A M P$ and $B M C$ by $\omega_{A}$ and $\omega_{B}$, respectively. The lines $A P, B C$, and $M Q$ are pairwise radical axes of the circles $\Gamma, \omega_{A}$, and $\omega_{B}$, thus either they are parallel, or they share a common point $X$. + +Assume that these lines are parallel (see Figure 1). Then the segments $A P, Q M$, and $B C$ have a common perpendicular bisector; the reflection in this bisector maps the segment $C P$ to $B A$, and maps $M$ to $Q$. Therefore, in this case $Q$ lies on $A B$, and $B Q / A B=C M / C P=$ $B D / A B$; so we have $Q=D$. + + +Figure 1 + + +Figure 2 + +Now assume that the lines $A P, Q M$, and $B C$ are concurrent at some point $X$ (see Figure 2). Notice that the points $A, B, Q$, and $X$ lie on a common circle $\Omega$ by Miquel's theorem applied to the triangle $X P C$. Let us denote by $Y$ the symmetric image of $X$ about the perpendicular bisector of $A B$. Clearly, $Y$ lies on $\Omega$, and the triangles $Y A B$ and $\triangle X B A$ are congruent. Moreover, the triangle $X P C$ is similar to the triangle $X B A$, so it is also similar to the triangle $Y A B$. + +Next, the points $D$ and $M$ correspond to each other in similar triangles $Y A B$ and $X P C$, since $B D / B A=C M / C P=\lambda$. Moreover, the triangles $Y A B$ and $X P C$ are equi-oriented, so $\Varangle(M X, X P)=\Varangle(D Y, Y A)$. On the other hand, since the points $A, Q, X$, and $Y$ lie on $\Omega$, we have $\Varangle(Q Y, Y A)=\Varangle(M X, X P)$. Therefore, $\Varangle(Q Y, Y A)=\Varangle(D Y, Y A)$, so the points $Y, D$, and $Q$ are collinear. + +Finally, we have $\Varangle(D Q, Q B)=\Varangle(Y Q, Q B)=\Varangle(Y A, A B)=\Varangle(A B, B X)=\Varangle(A B, B C)$, as desired. + +Comment. In the original proposal, $\lambda$ was supposed to be an arbitrary real number distinct from 0 and 1, and the point $M$ was defined by $\overrightarrow{C M}=\lambda \cdot \overrightarrow{C P}$. The Problem Selection Committee decided to add the restriction $\lambda \in(0,1)$ in order to avoid a large case distinction. + +Solution 2. As in the previous solution, we introduce the radical centre $X=A P \cap B C \cap M Q$ of the circles $\omega_{A}, \omega_{B}$, and $\Gamma$. Next, we also notice that the points $A, Q, B$, and $X$ lie on a common circle $\Omega$. + +If the point $P$ lies on the arc $B A C$ of $\Gamma$, then the point $X$ is outside $\Gamma$, thus the point $Q$ belongs to the ray $X M$, and therefore the points $P, A$, and $Q$ lie on the same side of $B C$. Otherwise, if $P$ lies on the arc $B C$ not containing $A$, then $X$ lies inside $\Gamma$, so $M$ and $Q$ lie on different sides of $B C$; thus again $Q$ and $A$ lie on the same side of $B C$. So, in each case the points $Q$ and $A$ lie on the same side of $B C$. + + +Figure 3 +Now we prove that the ratio + +$$ +\frac{Q B}{\sin \angle Q B C}=\frac{Q B}{Q X} \cdot \frac{Q X}{\sin \angle Q B X} +$$ + +is constant. Since the points $A, Q, B$, and $X$ are concyclic, we have + +$$ +\frac{Q X}{\sin \angle Q B X}=\frac{A X}{\sin \angle A B C} +$$ + +Next, since the points $B, Q, M$, and $C$ are concyclic, the triangles $X B Q$ and $X M C$ are similar, so + +$$ +\frac{Q B}{Q X}=\frac{C M}{C X}=\lambda \cdot \frac{C P}{C X} +$$ + +Analogously, the triangles $X C P$ and $X A B$ are also similar, so + +$$ +\frac{C P}{C X}=\frac{A B}{A X} +$$ + +Therefore, we obtain + +$$ +\frac{Q B}{\sin \angle Q B C}=\lambda \cdot \frac{A B}{A X} \cdot \frac{A X}{\sin \angle A B C}=\lambda \cdot \frac{A B}{\sin \angle A B C} +$$ + +so this ratio is indeed constant. Thus the circle passing through $Q$ and tangent to $B C$ at $B$ is also constant, and $Q$ varies over this fixed circle. + +Comment. It is not hard to guess that the desired circle should be tangent to $B C$ at $B$. Indeed, the second paragraph of this solution shows that this circle lies on one side of $B C$; on the other hand, in the limit case $P=B$, the point $Q$ also coincides with $B$. + +Solution 3. Let us perform an inversion centred at $C$. Denote by $X^{\prime}$ the image of a point $X$ under this inversion. + +The circle $\Gamma$ maps to the line $\Gamma^{\prime}$ passing through the constant points $A^{\prime}$ and $B^{\prime}$, and containing the variable point $P^{\prime}$. By the problem condition, the point $M$ varies over the circle $\gamma$ which is the homothetic image of $\Gamma$ with centre $C$ and coefficient $\lambda$. Thus $M^{\prime}$ varies over the constant line $\gamma^{\prime} \| A^{\prime} B^{\prime}$ which is the homothetic image of $A^{\prime} B^{\prime}$ with centre $C$ and coefficient $1 / \lambda$, and $M=\gamma^{\prime} \cap C P^{\prime}$. Next, the circumcircles $\omega_{A}$ and $\omega_{B}$ of the triangles $A M P$ and $B M C$ map to the circumcircle $\omega_{A}^{\prime}$ of the triangle $A^{\prime} M^{\prime} P^{\prime}$ and to the line $B^{\prime} M^{\prime}$, respectively; the point $Q$ thus maps to the second point of intersection of $B^{\prime} M^{\prime}$ with $\omega_{A}^{\prime}$ (see Figure 4). + + +Figure 4 + +Let $J$ be the (constant) common point of the lines $\gamma^{\prime}$ and $C A^{\prime}$, and let $\ell$ be the (constant) line through $J$ parallel to $C B^{\prime}$. Let $V$ be the common point of the lines $\ell$ and $B^{\prime} M^{\prime}$. Applying Pappus' theorem to the triples $\left(C, J, A^{\prime}\right)$ and $\left(V, B^{\prime}, M^{\prime}\right)$ we get that the points $C B^{\prime} \cap J V$, $J M^{\prime} \cap A^{\prime} B^{\prime}$, and $C M^{\prime} \cap A^{\prime} V$ are collinear. The first two of these points are ideal, hence so is the third, which means that $C M^{\prime} \| A^{\prime} V$. + +Now we have $\Varangle\left(Q^{\prime} A^{\prime}, A^{\prime} P^{\prime}\right)=\Varangle\left(Q^{\prime} M^{\prime}, M^{\prime} P^{\prime}\right)=\angle\left(V M^{\prime}, A^{\prime} V\right)$, which means that the triangles $B^{\prime} Q^{\prime} A^{\prime}$ and $B^{\prime} A^{\prime} V$ are similar, and $\left(B^{\prime} A^{\prime}\right)^{2}=B^{\prime} Q^{\prime} \cdot B^{\prime} V$. Thus $Q^{\prime}$ is the image of $V$ under the second (fixed) inversion with centre $B^{\prime}$ and radius $B^{\prime} A^{\prime}$. Since $V$ varies over the constant line $\ell, Q^{\prime}$ varies over some constant circle $\Theta$. Thus, applying the first inversion back we get that $Q$ also varies over some fixed circle. + +One should notice that this last circle is not a line; otherwise $\Theta$ would contain $C$, and thus $\ell$ would contain the image of $C$ under the second inversion. This is impossible, since $C B^{\prime} \| \ell$. + +G5. Let $A B C D$ be a convex quadrilateral with $\angle B=\angle D=90^{\circ}$. Point $H$ is the foot of the perpendicular from $A$ to $B D$. The points $S$ and $T$ are chosen on the sides $A B$ and $A D$, respectively, in such a way that $H$ lies inside triangle $S C T$ and + +$$ +\angle S H C-\angle B S C=90^{\circ}, \quad \angle T H C-\angle D T C=90^{\circ} . +$$ + +Prove that the circumcircle of triangle $S H T$ is tangent to the line $B D$. +(Iran) +Solution. Let the line passing through $C$ and perpendicular to the line $S C$ intersect the line $A B$ at $Q$ (see Figure 1). Then + +$$ +\angle S Q C=90^{\circ}-\angle B S C=180^{\circ}-\angle S H C, +$$ + +which implies that the points $C, H, S$, and $Q$ lie on a common circle. Moreover, since $S Q$ is a diameter of this circle, we infer that the circumcentre $K$ of triangle $S H C$ lies on the line $A B$. Similarly, we prove that the circumcentre $L$ of triangle $C H T$ lies on the line $A D$. + + +Figure 1 +In order to prove that the circumcircle of triangle $S H T$ is tangent to $B D$, it suffices to show that the perpendicular bisectors of $H S$ and $H T$ intersect on the line $A H$. However, these two perpendicular bisectors coincide with the angle bisectors of angles $A K H$ and $A L H$. Therefore, in order to complete the solution, it is enough (by the bisector theorem) to show that + +$$ +\frac{A K}{K H}=\frac{A L}{L H} +$$ + +We present two proofs of this equality. +First proof. Let the lines $K L$ and $H C$ intersect at $M$ (see Figure 2). Since $K H=K C$ and $L H=L C$, the points $H$ and $C$ are symmetric to each other with respect to the line $K L$. Therefore $M$ is the midpoint of $H C$. Denote by $O$ the circumcentre of quadrilateral $A B C D$. Then $O$ is the midpoint of $A C$. Therefore we have $O M \| A H$ and hence $O M \perp B D$. This together with the equality $O B=O D$ implies that $O M$ is the perpendicular bisector of $B D$ and therefore $B M=D M$. + +Since $C M \perp K L$, the points $B, C, M$, and $K$ lie on a common circle with diameter $K C$. Similarly, the points $L, C, M$, and $D$ lie on a circle with diameter $L C$. Thus, using the sine law, we obtain + +$$ +\frac{A K}{A L}=\frac{\sin \angle A L K}{\sin \angle A K L}=\frac{D M}{C L} \cdot \frac{C K}{B M}=\frac{C K}{C L}=\frac{K H}{L H} +$$ + +which finishes the proof of (1). + + +Figure 2 + + +Figure 3 + +Second proof. If the points $A, H$, and $C$ are collinear, then $A K=A L$ and $K H=L H$, so the equality (1) follows. Assume therefore that the points $A, H$, and $C$ do not lie in a line and consider the circle $\omega$ passing through them (see Figure 3). Since the quadrilateral $A B C D$ is cyclic, + +$$ +\angle B A C=\angle B D C=90^{\circ}-\angle A D H=\angle H A D . +$$ + +Let $N \neq A$ be the intersection point of the circle $\omega$ and the angle bisector of $\angle C A H$. Then $A N$ is also the angle bisector of $\angle B A D$. Since $H$ and $C$ are symmetric to each other with respect to the line $K L$ and $H N=N C$, it follows that both $N$ and the centre of $\omega$ lie on the line $K L$. This means that the circle $\omega$ is an Apollonius circle of the points $K$ and $L$. This immediately yields (1). + +Comment. Either proof can be used to obtain the following generalised result: +Let $A B C D$ be a convex quadrilateral and let $H$ be a point in its interior with $\angle B A C=\angle D A H$. The points $S$ and $T$ are chosen on the sides $A B$ and $A D$, respectively, in such a way that $H$ lies inside triangle SCT and + +$$ +\angle S H C-\angle B S C=90^{\circ}, \quad \angle T H C-\angle D T C=90^{\circ} . +$$ + +Then the circumcentre of triangle SHT lies on the line AH (and moreover the circumcentre of triangle SCT lies on $A C$ ). + +G6. Let $A B C$ be a fixed acute-angled triangle. Consider some points $E$ and $F$ lying on the sides $A C$ and $A B$, respectively, and let $M$ be the midpoint of $E F$. Let the perpendicular bisector of $E F$ intersect the line $B C$ at $K$, and let the perpendicular bisector of $M K$ intersect the lines $A C$ and $A B$ at $S$ and $T$, respectively. We call the pair $(E, F)$ interesting, if the quadrilateral $K S A T$ is cyclic. + +Suppose that the pairs $\left(E_{1}, F_{1}\right)$ and $\left(E_{2}, F_{2}\right)$ are interesting. Prove that + +$$ +\frac{E_{1} E_{2}}{A B}=\frac{F_{1} F_{2}}{A C} +$$ + +(Iran) +Solution 1. For any interesting pair $(E, F)$, we will say that the corresponding triangle $E F K$ is also interesting. + +Let $E F K$ be an interesting triangle. Firstly, we prove that $\angle K E F=\angle K F E=\angle A$, which also means that the circumcircle $\omega_{1}$ of the triangle $A E F$ is tangent to the lines $K E$ and $K F$. + +Denote by $\omega$ the circle passing through the points $K, S, A$, and $T$. Let the line $A M$ intersect the line $S T$ and the circle $\omega$ (for the second time) at $N$ and $L$, respectively (see Figure 1). + +Since $E F \| T S$ and $M$ is the midpoint of $E F, N$ is the midpoint of $S T$. Moreover, since $K$ and $M$ are symmetric to each other with respect to the line $S T$, we have $\angle K N S=\angle M N S=$ $\angle L N T$. Thus the points $K$ and $L$ are symmetric to each other with respect to the perpendicular bisector of $S T$. Therefore $K L \| S T$. + +Let $G$ be the point symmetric to $K$ with respect to $N$. Then $G$ lies on the line $E F$, and we may assume that it lies on the ray $M F$. One has + +$$ +\angle K G E=\angle K N S=\angle S N M=\angle K L A=180^{\circ}-\angle K S A +$$ + +(if $K=L$, then the angle $K L A$ is understood to be the angle between $A L$ and the tangent to $\omega$ at $L$ ). This means that the points $K, G, E$, and $S$ are concyclic. Now, since $K S G T$ is a parallelogram, we obtain $\angle K E F=\angle K S G=180^{\circ}-\angle T K S=\angle A$. Since $K E=K F$, we also have $\angle K F E=\angle K E F=\angle A$. + +After having proved this fact, one may finish the solution by different methods. + + +Figure 1 + + +Figure 2 + +First method. We have just proved that all interesting triangles are similar to each other. This allows us to use the following lemma. + +Lemma. Let $A B C$ be an arbitrary triangle. Choose two points $E_{1}$ and $E_{2}$ on the side $A C$, two points $F_{1}$ and $F_{2}$ on the side $A B$, and two points $K_{1}$ and $K_{2}$ on the side $B C$, in a way that the triangles $E_{1} F_{1} K_{1}$ and $E_{2} F_{2} K_{2}$ are similar. Then the six circumcircles of the triangles $A E_{i} F_{i}$, $B F_{i} K_{i}$, and $C E_{i} K_{i}(i=1,2)$ meet at a common point $Z$. Moreover, $Z$ is the centre of the spiral similarity that takes the triangle $E_{1} F_{1} K_{1}$ to the triangle $E_{2} F_{2} K_{2}$. +Proof. Firstly, notice that for each $i=1,2$, the circumcircles of the triangles $A E_{i} F_{i}, B F_{i} K_{i}$, and $C K_{i} E_{i}$ have a common point $Z_{i}$ by Miquel's theorem. Moreover, we have +$\Varangle\left(Z_{i} F_{i}, Z_{i} E_{i}\right)=\Varangle(A B, C A), \quad \Varangle\left(Z_{i} K_{i}, Z_{i} F_{i}\right)=\Varangle(B C, A B), \quad \Varangle\left(Z_{i} E_{i}, Z_{i} K_{i}\right)=\Varangle(C A, B C)$. +This yields that the points $Z_{1}$ and $Z_{2}$ correspond to each other in similar triangles $E_{1} F_{1} K_{1}$ and $E_{2} F_{2} K_{2}$. Thus, if they coincide, then this common point is indeed the desired centre of a spiral similarity. + +Finally, in order to show that $Z_{1}=Z_{2}$, one may notice that $\Varangle\left(A B, A Z_{1}\right)=\Varangle\left(E_{1} F_{1}, E_{1} Z_{1}\right)=$ $\Varangle\left(E_{2} F_{2}, E_{2} Z_{2}\right)=\Varangle\left(A B, A Z_{2}\right)$ (see Figure 2). Similarly, one has $\Varangle\left(B C, B Z_{1}\right)=\Varangle\left(B C, B Z_{2}\right)$ and $\Varangle\left(C A, C Z_{1}\right)=\Varangle\left(C A, C Z_{2}\right)$. This yields $Z_{1}=Z_{2}$. + +Now, let $P$ and $Q$ be the feet of the perpendiculars from $B$ and $C$ onto $A C$ and $A B$, respectively, and let $R$ be the midpoint of $B C$ (see Figure 3). Then $R$ is the circumcentre of the cyclic quadrilateral $B C P Q$. Thus we obtain $\angle A P Q=\angle B$ and $\angle R P C=\angle C$, which yields $\angle Q P R=\angle A$. Similarly, we show that $\angle P Q R=\angle A$. Thus, all interesting triangles are similar to the triangle $P Q R$. + + +Figure 3 + + +Figure 4 + +Denote now by $Z$ the common point of the circumcircles of $A P Q, B Q R$, and $C P R$. Let $E_{1} F_{1} K_{1}$ and $E_{2} F_{2} K_{2}$ be two interesting triangles. By the lemma, $Z$ is the centre of any spiral similarity taking one of the triangles $E_{1} F_{1} K_{1}, E_{2} F_{2} K_{2}$, and $P Q R$ to some other of them. Therefore the triangles $Z E_{1} E_{2}$ and $Z F_{1} F_{2}$ are similar, as well as the triangles $Z E_{1} F_{1}$ and $Z P Q$. Hence + +$$ +\frac{E_{1} E_{2}}{F_{1} F_{2}}=\frac{Z E_{1}}{Z F_{1}}=\frac{Z P}{Z Q} +$$ + +Moreover, the equalities $\angle A Z Q=\angle A P Q=\angle A B C=180^{\circ}-\angle Q Z R$ show that the point $Z$ lies on the line $A R$ (see Figure 4). Therefore the triangles $A Z P$ and $A C R$ are similar, as well as the triangles $A Z Q$ and $A B R$. This yields + +$$ +\frac{Z P}{Z Q}=\frac{Z P}{R C} \cdot \frac{R B}{Z Q}=\frac{A Z}{A C} \cdot \frac{A B}{A Z}=\frac{A B}{A C} +$$ + +which completes the solution. + +Second method. Now we will start from the fact that $\omega_{1}$ is tangent to the lines $K E$ and $K F$ (see Figure 5). We prove that if $(E, F)$ is an interesting pair, then + +$$ +\frac{A E}{A B}+\frac{A F}{A C}=2 \cos \angle A +$$ + +Let $Y$ be the intersection point of the segments $B E$ and $C F$. The points $B, K$, and $C$ are collinear, hence applying PASCAL's theorem to the degenerated hexagon AFFYEE, we infer that $Y$ lies on the circle $\omega_{1}$. + +Denote by $Z$ the second intersection point of the circumcircle of the triangle $B F Y$ with the line $B C$ (see Figure 6). By Miquel's theorem, the points $C, Z, Y$, and $E$ are concyclic. Therefore we obtain + +$$ +B F \cdot A B+C E \cdot A C=B Y \cdot B E+C Y \cdot C F=B Z \cdot B C+C Z \cdot B C=B C^{2} +$$ + +On the other hand, $B C^{2}=A B^{2}+A C^{2}-2 A B \cdot A C \cos \angle A$, by the cosine law. Hence + +$$ +(A B-A F) \cdot A B+(A C-A E) \cdot A C=A B^{2}+A C^{2}-2 A B \cdot A C \cos \angle A, +$$ + +which simplifies to the desired equality (1). +Let now $\left(E_{1}, F_{1}\right)$ and $\left(E_{2}, F_{2}\right)$ be two interesting pairs of points. Then we get + +$$ +\frac{A E_{1}}{A B}+\frac{A F_{1}}{A C}=\frac{A E_{2}}{A B}+\frac{A F_{2}}{A C} +$$ + +which gives the desired result. + + +Figure 5 + + +Figure 6 + +Third method. Again, we make use of the fact that all interesting triangles are similar (and equi-oriented). Let us put the picture onto a complex plane such that $A$ is at the origin, and identify each point with the corresponding complex number. + +Let $E F K$ be any interesting triangle. The equalities $\angle K E F=\angle K F E=\angle A$ yield that the ratio $\nu=\frac{K-E}{F-E}$ is the same for all interesting triangles. This in turn means that the numbers $E$, $F$, and $K$ satisfy the linear equation + +$$ +K=\mu E+\nu F, \quad \text { where } \quad \mu=1-\nu +$$ + +Now let us choose the points $X$ and $Y$ on the rays $A B$ and $A C$, respectively, so that $\angle C X A=\angle A Y B=\angle A=\angle K E F$ (see Figure 7). Then each of the triangles $A X C$ and $Y A B$ is similar to any interesting triangle, which also means that + +$$ +C=\mu A+\nu X=\nu X \quad \text { and } \quad B=\mu Y+\nu A=\mu Y . +$$ + +Moreover, one has $X / Y=\overline{C / B}$. +Since the points $E, F$, and $K$ lie on $A C, A B$, and $B C$, respectively, one gets + +$$ +E=\rho Y, \quad F=\sigma X, \quad \text { and } \quad K=\lambda B+(1-\lambda) C +$$ + +for some real $\rho, \sigma$, and $\lambda$. In view of (3), the equation (2) now reads $\lambda B+(1-\lambda) C=K=$ $\mu E+\nu F=\rho B+\sigma C$, or + +$$ +(\lambda-\rho) B=(\sigma+\lambda-1) C +$$ + +Since the nonzero complex numbers $B$ and $C$ have different arguments, the coefficients in the brackets vanish, so $\rho=\lambda$ and $\sigma=1-\lambda$. Therefore, + +$$ +\frac{E}{Y}+\frac{F}{X}=\rho+\sigma=1 +$$ + +Now, if $\left(E_{1}, F_{1}\right)$ and $\left(E_{2}, F_{2}\right)$ are two distinct interesting pairs, one may apply (4) to both pairs. Subtracting, we get + +$$ +\frac{E_{1}-E_{2}}{Y}=\frac{F_{2}-F_{1}}{X}, \quad \text { so } \quad \frac{E_{1}-E_{2}}{F_{2}-F_{1}}=\frac{Y}{X}=\frac{\bar{B}}{\bar{C}} +$$ + +Taking absolute values provides the required result. + + +Figure 7 + +Comment 1. One may notice that the triangle $P Q R$ is also interesting. +Comment 2. In order to prove that $\angle K E F=\angle K F E=\angle A$, one may also use the following well-known fact: +Let $A E F$ be a triangle with $A E \neq A F$, and let $K$ be the common point of the symmedian taken from $A$ and the perpendicular bisector of $E F$. Then the lines $K E$ and $K F$ are tangent to the circumcircle $\omega_{1}$ of the triangle $A E F$. + +In this case, however, one needs to deal with the case $A E=A F$ separately. + +Solution 2. Let $(E, F)$ be an interesting pair. This time we prove that + +$$ +\frac{A M}{A K}=\cos \angle A +$$ + +As in Solution 1, we introduce the circle $\omega$ passing through the points $K, S$, $A$, and $T$, together with the points $N$ and $L$ at which the line $A M$ intersect the line $S T$ and the circle $\omega$ for the second time, respectively. Let moreover $O$ be the centre of $\omega$ (see Figures 8 and 9). As in Solution 1, we note that $N$ is the midpoint of $S T$ and show that $K L \| S T$, which implies $\angle F A M=\angle E A K$. + + +Figure 8 + + +Figure 9 + +Suppose now that $K \neq L$ (see Figure 8). Then $K L \| S T$, and consequently the lines $K M$ and $K L$ are perpendicular. It implies that the lines $L O$ and $K M$ meet at a point $X$ lying on the circle $\omega$. Since the lines $O N$ and $X M$ are both perpendicular to the line $S T$, they are parallel to each other, and hence $\angle L O N=\angle L X K=\angle M A K$. On the other hand, $\angle O L N=\angle M K A$, so we infer that triangles $N O L$ and $M A K$ are similar. This yields + +$$ +\frac{A M}{A K}=\frac{O N}{O L}=\frac{O N}{O T}=\cos \angle T O N=\cos \angle A +$$ + +If, on the other hand, $K=L$, then the points $A, M, N$, and $K$ lie on a common line, and this line is the perpendicular bisector of $S T$ (see Figure 9). This implies that $A K$ is a diameter of $\omega$, which yields $A M=2 O K-2 N K=2 O N$. So also in this case we obtain + +$$ +\frac{A M}{A K}=\frac{2 O N}{2 O T}=\cos \angle T O N=\cos \angle A +$$ + +Thus (5) is proved. +Let $P$ and $Q$ be the feet of the perpendiculars from $B$ and $C$ onto $A C$ and $A B$, respectively (see Figure 10). We claim that the point $M$ lies on the line $P Q$. Consider now the composition of the dilatation with factor $\cos \angle A$ and centre $A$, and the reflection with respect to the angle bisector of $\angle B A C$. This transformation is a similarity that takes $B, C$, and $K$ to $P, Q$, and $M$, respectively. Since $K$ lies on the line $B C$, the point $M$ lies on the line $P Q$. + + +Figure 10 +Suppose that $E \neq P$. Then also $F \neq Q$, and by Menelaus' theorem, we obtain + +$$ +\frac{A Q}{F Q} \cdot \frac{F M}{E M} \cdot \frac{E P}{A P}=1 +$$ + +Using the similarity of the triangles $A P Q$ and $A B C$, we infer that + +$$ +\frac{E P}{F Q}=\frac{A P}{A Q}=\frac{A B}{A C}, \quad \text { and hence } \quad \frac{E P}{A B}=\frac{F Q}{A C} +$$ + +The last equality holds obviously also in case $E=P$, because then $F=Q$. Moreover, since the line $P Q$ intersects the segment $E F$, we infer that the point $E$ lies on the segment $A P$ if and only if the point $F$ lies outside of the segment $A Q$. + +Let now $\left(E_{1}, F_{1}\right)$ and $\left(E_{2}, F_{2}\right)$ be two interesting pairs. Then we obtain + +$$ +\frac{E_{1} P}{A B}=\frac{F_{1} Q}{A C} \quad \text { and } \quad \frac{E_{2} P}{A B}=\frac{F_{2} Q}{A C} . +$$ + +If $P$ lies between the points $E_{1}$ and $E_{2}$, we add the equalities above, otherwise we subtract them. In any case we obtain + +$$ +\frac{E_{1} E_{2}}{A B}=\frac{F_{1} F_{2}}{A C} +$$ + +which completes the solution. + +G7. Let $A B C$ be a triangle with circumcircle $\Omega$ and incentre $I$. Let the line passing through $I$ and perpendicular to $C I$ intersect the segment $B C$ and the $\operatorname{arc} B C$ (not containing $A$ ) of $\Omega$ at points $U$ and $V$, respectively. Let the line passing through $U$ and parallel to $A I$ intersect $A V$ at $X$, and let the line passing through $V$ and parallel to $A I$ intersect $A B$ at $Y$. Let $W$ and $Z$ be the midpoints of $A X$ and $B C$, respectively. Prove that if the points $I, X$, and $Y$ are collinear, then the points $I, W$, and $Z$ are also collinear. + +Solution 1. We start with some general observations. Set $\alpha=\angle A / 2, \beta=\angle B / 2, \gamma=\angle C / 2$. Then obviously $\alpha+\beta+\gamma=90^{\circ}$. Since $\angle U I C=90^{\circ}$, we obtain $\angle I U C=\alpha+\beta$. Therefore $\angle B I V=\angle I U C-\angle I B C=\alpha=\angle B A I=\angle B Y V$, which implies that the points $B, Y, I$, and $V$ lie on a common circle (see Figure 1). + +Assume now that the points $I, X$ and $Y$ are collinear. We prove that $\angle Y I A=90^{\circ}$. +Let the line $X U$ intersect $A B$ at $N$. Since the lines $A I, U X$, and $V Y$ are parallel, we get + +$$ +\frac{N X}{A I}=\frac{Y N}{Y A}=\frac{V U}{V I}=\frac{X U}{A I} +$$ + +implying $N X=X U$. Moreover, $\angle B I U=\alpha=\angle B N U$. This implies that the quadrilateral BUIN is cyclic, and since $B I$ is the angle bisector of $\angle U B N$, we infer that $N I=U I$. Thus in the isosceles triangle $N I U$, the point $X$ is the midpoint of the base $N U$. This gives $\angle I X N=90^{\circ}$, i.e., $\angle Y I A=90^{\circ}$. + + +Figure 1 +Let $S$ be the midpoint of the segment $V C$. Let moreover $T$ be the intersection point of the lines $A X$ and $S I$, and set $x=\angle B A V=\angle B C V$. Since $\angle C I A=90^{\circ}+\beta$ and $S I=S C$, we obtain + +$$ +\angle T I A=180^{\circ}-\angle A I S=90^{\circ}-\beta-\angle C I S=90^{\circ}-\beta-\gamma-x=\alpha-x=\angle T A I, +$$ + +which implies that $T I=T A$. Therefore, since $\angle X I A=90^{\circ}$, the point $T$ is the midpoint of $A X$, i.e., $T=W$. + +To complete our solution, it remains to show that the intersection point of the lines $I S$ and $B C$ coincide with the midpoint of the segment $B C$. But since $S$ is the midpoint of the segment $V C$, it suffices to show that the lines $B V$ and $I S$ are parallel. + +Since the quadrilateral $B Y I V$ is cyclic, $\angle V B I=\angle V Y I=\angle Y I A=90^{\circ}$. This implies that $B V$ is the external angle bisector of the angle $A B C$, which yields $\angle V A C=\angle V C A$. Therefore $2 \alpha-x=2 \gamma+x$, which gives $\alpha=\gamma+x$. Hence $\angle S C I=\alpha$, so $\angle V S I=2 \alpha$. + +On the other hand, $\angle B V C=180^{\circ}-\angle B A C=180^{\circ}-2 \alpha$, which implies that the lines $B V$ and $I S$ are parallel. This completes the solution. + +Solution 2. As in Solution 1, we first prove that the points $B, Y, I, V$ lie on a common circle and $\angle Y I A=90^{\circ}$. The remaining part of the solution is based on the following lemma, which holds true for any triangle $A B C$, not necessarily with the property that $I, X, Y$ are collinear. Lemma. Let $A B C$ be the triangle inscribed in a circle $\Gamma$ and let $I$ be its incentre. Assume that the line passing through $I$ and perpendicular to the line $A I$ intersects the side $A B$ at the point $Y$. Let the circumcircle of the triangle $B Y I$ intersect the circle $\Gamma$ for the second time at $V$, and let the excircle of the triangle $A B C$ opposite to the vertex $A$ be tangent to the side $B C$ at $E$. Then + +$$ +\angle B A V=\angle C A E +$$ + +Proof. Let $\rho$ be the composition of the inversion with centre $A$ and radius $\sqrt{A B \cdot A C}$, and the symmetry with respect to $A I$. Clearly, $\rho$ interchanges $B$ and $C$. + +Let $J$ be the excentre of the triangle $A B C$ opposite to $A$ (see Figure 2). Then we have $\angle J A C=\angle B A I$ and $\angle J C A=90^{\circ}+\gamma=\angle B I A$, so the triangles $A C J$ and $A I B$ are similar, and therefore $A B \cdot A C=A I \cdot A J$. This means that $\rho$ interchanges $I$ and $J$. Moreover, since $Y$ lies on $A B$ and $\angle A I Y=90^{\circ}$, the point $Y^{\prime}=\rho(Y)$ lies on $A C$, and $\angle J Y^{\prime} A=90^{\circ}$. Thus $\rho$ maps the circumcircle $\gamma$ of the triangle $B Y I$ to a circle $\gamma^{\prime}$ with diameter $J C$. + +Finally, since $V$ lies on both $\Gamma$ and $\gamma$, the point $V^{\prime}=\rho(V)$ lies on the line $\rho(\Gamma)=A B$ as well as on $\gamma^{\prime}$, which in turn means that $V^{\prime}=E$. This implies the desired result. + + +Figure 2 + + +Figure 3 + +Now we turn to the solution of the problem. +Assume that the incircle $\omega_{1}$ of the triangle $A B C$ is tangent to $B C$ at $D$, and let the excircle $\omega_{2}$ of the triangle $A B C$ opposite to the vertex $A$ touch the side $B C$ at $E$ (see Figure 3). The homothety with centre $A$ that takes $\omega_{2}$ to $\omega_{1}$ takes the point $E$ to some point $F$, and the +tangent to $\omega_{1}$ at $F$ is parallel to $B C$. Therefore $D F$ is a diameter of $\omega_{1}$. Moreover, $Z$ is the midpoint of $D E$. This implies that the lines $I Z$ and $F E$ are parallel. + +Let $K=Y I \cap A E$. Since $\angle Y I A=90^{\circ}$, the lemma yields that $I$ is the midpoint of $X K$. This implies that the segments $I W$ and $A K$ are parallel. Therefore, the points $W, I$ and $Z$ are collinear. + +Comment 1. The properties $\angle Y I A=90^{\circ}$ and $V A=V C$ can be established in various ways. The main difficulty of the problem seems to find out how to use these properties in connection to the points $W$ and $Z$. + +In Solution 2 this principal part is more or less covered by the lemma, for which we have presented a direct proof. On the other hand, this lemma appears to be a combination of two well-known facts; let us formulate them in terms of the lemma statement. + +Let the line $I Y$ intersect $A C$ at $P$ (see Figure 4). The first fact states that the circumcircle $\omega$ of the triangle $V Y P$ is tangent to the segments $A B$ and $A C$, as well as to the circle $\Gamma$. The second fact states that for such a circle, the angles $B A V$ and $C A E$ are equal. + +The awareness of this lemma may help a lot in solving this problem; so the Jury might also consider a variation of the proposed problem, for which the lemma does not seem to be useful; see Comment 3. + + +Comment 2. The proposed problem stated the equivalence: the point $I$ lies on the line $X Y$ if and only if $I$ lies on the line $W Z$. Here we sketch the proof of the "if" part (see Figure 5). +As in Solution 2 , let $B C$ touch the circles $\omega_{1}$ and $\omega_{2}$ at $D$ and $E$, respectively. Since $I Z \| A E$ and $W$ lies on $I Z$, the line $D X$ is also parallel to $A E$. Therefore, the triangles $X U P$ and $A I Q$ are similar. Moreover, the line $D X$ is symmetric to $A E$ with respect to $I$, so $I P=I Q$, where $P=U V \cap X D$ and $Q=U V \cap A E$. Thus we obtain + +$$ +\frac{U V}{V I}=\frac{U X}{I A}=\frac{U P}{I Q}=\frac{U P}{I P} +$$ + +So the pairs $I U$ and $P V$ are harmonic conjugates, and since $\angle U D I=90^{\circ}$, we get $\angle V D B=\angle B D X=$ $\angle B E A$. Therefore the point $V^{\prime}$ symmetric to $V$ with respect to the perpendicular bisector of $B C$ lies on the line $A E$. So we obtain $\angle B A V=\angle C A E$. + +The rest can be obtained by simply reversing the arguments in Solution 2 . The points $B, V, I$, and $Y$ are concyclic. The lemma implies that $\angle Y I A=90^{\circ}$. Moreover, the points $B, U, I$, and $N$, where $N=U X \cap A B$, lie on a common circle, so $I N=I U$. Since $I Y \perp U N$, the point $X^{\prime}=I Y \cap U N$ is the midpoint of $U N$. But in the trapezoid $A Y V I$, the line $X U$ is parallel to the sides $A I$ and $Y V$, so $N X=U X^{\prime}$. This yields $X=X^{\prime}$. +The reasoning presented in Solution 1 can also be reversed, but it requires a lot of technicalities. Therefore the Problem Selection Committee proposes to consider only the "only if" part of the original proposal, which is still challenging enough. + +Comment 3. The Jury might also consider the following variation of the proposed problem. +Let $A B C$ be a triangle with circumcircle $\Omega$ and incentre I. Let the line through I perpendicular to CI intersect the segment $B C$ and the arc $B C$ (not containing $A$ ) of $\Omega$ at $U$ and $V$, respectively. Let the line through $U$ parallel to $A I$ intersect $A V$ at $X$. Prove that if the lines XI and AI are perpendicular, then the midpoint of the segment AC lies on the line XI (see Figure 6). + + +Figure 6 + + +Figure 7 + +Since the solution contains the arguments used above, we only sketch it. +Let $N=X U \cap A B$ (see Figure 7). Then $\angle B N U=\angle B A I=\angle B I U$, so the points $B, U, I$, and $N$ lie on a common circle. Therefore $I U=I N$, and since $I X \perp N U$, it follows that $N X=X U$. +Now set $Y=X I \cap A B$. The equality $N X=X U$ implies that + +$$ +\frac{V X}{V A}=\frac{X U}{A I}=\frac{N X}{A I}=\frac{Y X}{Y I} +$$ + +and therefore $Y V \| A I$. Hence $\angle B Y V=\angle B A I=\angle B I V$, so the points $B, V, I, Y$ are concyclic. Next we have $I Y \perp Y V$, so $\angle I B V=90^{\circ}$. This implies that $B V$ is the external angle bisector of the angle $A B C$, which gives $\angle V A C=\angle V C A$. +So in order to show that $M=X I \cap A C$ is the midpoint of $A C$, it suffices to prove that $\angle V M C=90^{\circ}$. But this follows immediately from the observation that the points $V, C, M$, and $I$ are concyclic, as $\angle M I V=\angle Y B V=180^{\circ}-\angle A C V$. +The converse statement is also true, but its proof requires some technicalities as well. + +## Number Theory + +N1. Let $n \geqslant 2$ be an integer, and let $A_{n}$ be the set + +$$ +A_{n}=\left\{2^{n}-2^{k} \mid k \in \mathbb{Z}, 0 \leqslant k 2$, and take an integer $m>(n-2) 2^{n}+1$. If $m$ is even, then consider + +$$ +\frac{m}{2} \geqslant \frac{(n-2) 2^{n}+2}{2}=(n-2) 2^{n-1}+1>(n-3) 2^{n-1}+1 +$$ + +By the induction hypothesis, there is a representation of the form + +$$ +\frac{m}{2}=\left(2^{n-1}-2^{k_{1}}\right)+\left(2^{n-1}-2^{k_{2}}\right)+\cdots+\left(2^{n-1}-2^{k_{r}}\right) +$$ + +for some $k_{i}$ with $0 \leqslant k_{i} \frac{(n-2) 2^{n}+1-\left(2^{n}-1\right)}{2}=(n-3) 2^{n-1}+1 +$$ + +By the induction hypothesis, there is a representation of the form + +$$ +\frac{m-\left(2^{n}-1\right)}{2}=\left(2^{n-1}-2^{k_{1}}\right)+\left(2^{n-1}-2^{k_{2}}\right)+\cdots+\left(2^{n-1}-2^{k_{r}}\right) +$$ + +for some $k_{i}$ with $0 \leqslant k_{i} 2$, assume that there exist integers $a, b$ with $a \geqslant 0, b \geqslant 1$ and $a+b y$ due to symmetry. Then the integer $n=x-y$ is positive and (1) may be rewritten as + +$$ +\sqrt[3]{7(y+n)^{2}-13(y+n) y+7 y^{2}}=n+1 +$$ + +Raising this to the third power and simplifying the result one obtains + +$$ +y^{2}+y n=n^{3}-4 n^{2}+3 n+1 . +$$ + +To complete the square on the left hand side, we multiply by 4 and add $n^{2}$, thus getting + +$$ +(2 y+n)^{2}=4 n^{3}-15 n^{2}+12 n+4=(n-2)^{2}(4 n+1) +$$ + +This shows that the cases $n=1$ and $n=2$ are impossible, whence $n>2$, and $4 n+1$ is the square of the rational number $\frac{2 y+n}{n-2}$. Consequently, it has to be a perfect square, and, since it is odd as well, there has to exist some nonnegative integer $m$ such that $4 n+1=(2 m+1)^{2}$, i.e. + +$$ +n=m^{2}+m +$$ + +Notice that $n>2$ entails $m \geqslant 2$. Substituting the value of $n$ just found into the previous displayed equation we arrive at + +$$ +\left(2 y+m^{2}+m\right)^{2}=\left(m^{2}+m-2\right)^{2}(2 m+1)^{2}=\left(2 m^{3}+3 m^{2}-3 m-2\right)^{2} . +$$ + +Extracting square roots and taking $2 m^{3}+3 m^{2}-3 m-2=(m-1)\left(2 m^{2}+5 m+2\right)>0$ into account we derive $2 y+m^{2}+m=2 m^{3}+3 m^{2}-3 m-2$, which in turn yields + +$$ +y=m^{3}+m^{2}-2 m-1 +$$ + +Notice that $m \geqslant 2$ implies that $y=\left(m^{3}-1\right)+(m-2) m$ is indeed positive, as it should be. In view of $x=y+n=y+m^{2}+m$ it also follows that + +$$ +x=m^{3}+2 m^{2}-m-1, +$$ + +and that this integer is positive as well. +Comment. Alternatively one could ask to find all pairs $(x, y)$ of - not necessarily positive - integers solving (1). The answer to that question is a bit nicer than the answer above: the set of solutions are now described by + +$$ +\{x, y\}=\left\{m^{3}+m^{2}-2 m-1, m^{3}+2 m^{2}-m-1\right\} +$$ + +where $m$ varies through $\mathbb{Z}$. This may be shown using essentially the same arguments as above. We finally observe that the pair $(x, y)=(1,1)$, that appears to be sporadic above, corresponds to $m=-1$. + +N3. A coin is called a Cape Town coin if its value is $1 / n$ for some positive integer $n$. Given a collection of Cape Town coins of total value at most $99+\frac{1}{2}$, prove that it is possible to split this collection into at most 100 groups each of total value at most 1. +(Luxembourg) +Solution. We will show that for every positive integer $N$ any collection of Cape Town coins of total value at most $N-\frac{1}{2}$ can be split into $N$ groups each of total value at most 1 . The problem statement is a particular case for $N=100$. + +We start with some preparations. If several given coins together have a total value also of the form $\frac{1}{k}$ for a positive integer $k$, then we may merge them into one new coin. Clearly, if the resulting collection can be split in the required way then the initial collection can also be split. + +After each such merging, the total number of coins decreases, thus at some moment we come to a situation when no more merging is possible. At this moment, for every even $k$ there is at most one coin of value $\frac{1}{k}$ (otherwise two such coins may be merged), and for every odd $k>1$ there are at most $k-1$ coins of value $\frac{1}{k}$ (otherwise $k$ such coins may also be merged). + +Now, clearly, each coin of value 1 should form a single group; if there are $d$ such coins then we may remove them from the collection and replace $N$ by $N-d$. So from now on we may assume that there are no coins of value 1. + +Finally, we may split all the coins in the following way. For each $k=1,2, \ldots, N$ we put all the coins of values $\frac{1}{2 k-1}$ and $\frac{1}{2 k}$ into a group $G_{k}$; the total value of $G_{k}$ does not exceed + +$$ +(2 k-2) \cdot \frac{1}{2 k-1}+\frac{1}{2 k}<1 +$$ + +It remains to distribute the "small" coins of values which are less than $\frac{1}{2 N}$; we will add them one by one. In each step, take any remaining small coin. The total value of coins in the groups at this moment is at most $N-\frac{1}{2}$, so there exists a group of total value at most $\frac{1}{N}\left(N-\frac{1}{2}\right)=1-\frac{1}{2 N}$; thus it is possible to put our small coin into this group. Acting so, we will finally distribute all the coins. + +Comment 1. The algorithm may be modified, at least the step where one distributes the coins of values $\geqslant \frac{1}{2 N}$. One different way is to put into $G_{k}$ all the coins of values $\frac{1}{(2 k-1) 2^{s}}$ for all integer $s \geqslant 0$. One may easily see that their total value also does not exceed 1. + +Comment 2. The original proposal also contained another part, suggesting to show that a required splitting may be impossible if the total value of coins is at most 100 . There are many examples of such a collection, e.g. one may take 98 coins of value 1 , one coin of value $\frac{1}{2}$, two coins of value $\frac{1}{3}$, and four coins of value $\frac{1}{5}$. + +The Problem Selection Committee thinks that this part is less suitable for the competition. + +N4. Let $n>1$ be a given integer. Prove that infinitely many terms of the sequence $\left(a_{k}\right)_{k \geqslant 1}$, defined by + +$$ +a_{k}=\left\lfloor\frac{n^{k}}{k}\right\rfloor +$$ + +are odd. (For a real number $x,\lfloor x\rfloor$ denotes the largest integer not exceeding $x$.) +(Hong Kong) +Solution 1. If $n$ is odd, let $k=n^{m}$ for $m=1,2, \ldots$. Then $a_{k}=n^{n^{m}-m}$, which is odd for each $m$. + +Henceforth, assume that $n$ is even, say $n=2 t$ for some integer $t \geqslant 1$. Then, for any $m \geqslant 2$, the integer $n^{2^{m}}-2^{m}=2^{m}\left(2^{2^{m}-m} \cdot t^{2^{m}}-1\right)$ has an odd prime divisor $p$, since $2^{m}-m>1$. Then, for $k=p \cdot 2^{m}$, we have + +$$ +n^{k}=\left(n^{2^{m}}\right)^{p} \equiv\left(2^{m}\right)^{p}=\left(2^{p}\right)^{m} \equiv 2^{m} +$$ + +where the congruences are taken modulo $p\left(\right.$ recall that $2^{p} \equiv 2(\bmod p)$, by Fermat's little theorem). Also, from $n^{k}-2^{m} m$ ). Note that for different values of $m$, we get different values of $k$, due to the different powers of 2 in the prime factorisation of $k$. + +Solution 2. Treat the (trivial) case when $n$ is odd as in Solution 1. +Now assume that $n$ is even and $n>2$. Let $p$ be a prime divisor of $n-1$. +Proceed by induction on $i$ to prove that $p^{i+1}$ is a divisor of $n^{p^{i}}-1$ for every $i \geqslant 0$. The case $i=0$ is true by the way in which $p$ is chosen. Suppose the result is true for some $i \geqslant 0$. The factorisation + +$$ +n^{p^{i+1}}-1=\left(n^{p^{i}}-1\right)\left[n^{p^{i}(p-1)}+n^{p^{i}(p-2)}+\cdots+n^{p^{i}}+1\right], +$$ + +together with the fact that each of the $p$ terms between the square brackets is congruent to 1 modulo $p$, implies that the result is also true for $i+1$. + +Hence $\left\lfloor\frac{n^{p^{i}}}{p^{i}}\right\rfloor=\frac{n^{p^{i}}-1}{p^{i}}$, an odd integer for each $i \geqslant 1$. +Finally, we consider the case $n=2$. We observe that $3 \cdot 4^{i}$ is a divisor of $2^{3 \cdot 4^{i}}-4^{i}$ for every $i \geqslant 1$ : Trivially, $4^{i}$ is a divisor of $2^{3 \cdot 4^{i}}-4^{i}$, since $3 \cdot 4^{i}>2 i$. Furthermore, since $2^{3 \cdot 4^{i}}$ and $4^{i}$ are both congruent to 1 modulo 3, we have $3 \mid 2^{3 \cdot 4^{i}}-4^{i}$. Hence, $\left\lfloor\frac{2^{3 \cdot 4^{i}}}{3 \cdot 4^{i}}\right\rfloor=\frac{2^{3 \cdot 4^{i}}-4^{i}}{3 \cdot 4^{i}}=\frac{2^{3 \cdot 4^{i}-2 i}-1}{3}$, which is odd for every $i \geqslant 1$. + +Comment. The case $n$ even and $n>2$ can also be solved by recursively defining the sequence $\left(k_{i}\right)_{i \geqslant 1}$ by $k_{1}=1$ and $k_{i+1}=n^{k_{i}}-1$ for $i \geqslant 1$. Then $\left(k_{i}\right)$ is strictly increasing and it follows (by induction on $i$ ) that $k_{i} \mid n^{k_{i}}-1$ for all $i \geqslant 1$, so the $k_{i}$ are as desired. + +The case $n=2$ can also be solved as follows: Let $i \geqslant 2$. By Bertrand's postulate, there exists a prime number $p$ such that $2^{2^{i}-1} 0}: 2^{i} \text { divides } a p+1\right\} +$$ + +Recall that there exists $a$ with $1 \leqslant a<2^{i}$ such that $a p \equiv-1\left(\bmod 2^{i}\right)$, so each $a_{i}$ satisfies $1 \leqslant a_{i}<2^{i}$. This implies that $a_{i} p+1
2$, and we let $a$ and $b$ be positive integers such that $x^{p-1}+y=p^{a}$ and $x+y^{p-1}=p^{b}$. Assume further, without loss of generality, that $x \leqslant y$, so that $p^{a}=x^{p-1}+y \leqslant x+y^{p-1}=p^{b}$, which means that $a \leqslant b$ (and thus $\left.p^{a} \mid p^{b}\right)$. + +Now we have + +$$ +p^{b}=y^{p-1}+x=\left(p^{a}-x^{p-1}\right)^{p-1}+x . +$$ + +We take this equation modulo $p^{a}$ and take into account that $p-1$ is even, which gives us + +$$ +0 \equiv x^{(p-1)^{2}}+x \quad\left(\bmod p^{a}\right) +$$ + +If $p \mid x$, then $p^{a} \mid x$, since $x^{(p-1)^{2}-1}+1$ is not divisible by $p$ in this case. However, this is impossible, since $x \leqslant x^{p-1}
2$. Thus $a=r+1$. Now since $p^{r} \leqslant x+1$, we get + +$$ +x=\frac{x^{2}+x}{x+1} \leqslant \frac{x^{p-1}+y}{x+1}=\frac{p^{a}}{x+1} \leqslant \frac{p^{a}}{p^{r}}=p, +$$ + +so we must have $x=p-1$ for $p$ to divide $x+1$. +It follows that $r=1$ and $a=2$. If $p \geqslant 5$, we obtain + +$$ +p^{a}=x^{p-1}+y>(p-1)^{4}=\left(p^{2}-2 p+1\right)^{2}>(3 p)^{2}>p^{2}=p^{a} +$$ + +a contradiction. So the only case that remains is $p=3$, and indeed $x=2$ and $y=p^{a}-x^{p-1}=5$ satisfy the conditions. + +Comment 1. In this solution, we are implicitly using a special case of the following lemma known as "lifting the exponent": +Lemma. Let $n$ be a positive integer, let $p$ be an odd prime, and let $v_{p}(m)$ denote the exponent of the highest power of $p$ that divides $m$. + +If $x$ and $y$ are integers not divisible by $p$ such that $p \mid x-y$, then we have + +$$ +v_{p}\left(x^{n}-y^{n}\right)=v_{p}(x-y)+v_{p}(n) +$$ + +Likewise, if $x$ and $y$ are integers not divisible by $p$ such that $p \mid x+y$, then we have + +$$ +v_{p}\left(x^{n}+y^{n}\right)=v_{p}(x+y)+v_{p}(n) . +$$ + +Comment 2. There exist various ways of solving the problem involving the "lifting the exponent" lemma. Let us sketch another one. + +The cases $x=y$ and $p \mid x$ are ruled out easily, so we assume that $p>2, x
2$. If $p \mid x$, then also $p \mid y$. In this case, let $p^{k}$ and $p^{\ell}$ be the highest powers of $p$ that divide $x$ and $y$ respectively, and assume without loss of generality that $k \leqslant \ell$. Then $p^{k}$ divides $x+y^{p-1}$ while $p^{k+1}$ does not, but $p^{k} p$, so $x^{p-1}+y$ and $y^{p-1}+x$ are both at least equal to $p^{2}$. Now we have + +$$ +x^{p-1} \equiv-y \quad\left(\bmod p^{2}\right) \quad \text { and } \quad y^{p-1} \equiv-x \quad\left(\bmod p^{2}\right) +$$ + +These two congruences, together with the Euler-Fermat theorem, give us + +$$ +1 \equiv x^{p(p-1)} \equiv(-y)^{p} \equiv-y^{p} \equiv x y \quad\left(\bmod p^{2}\right) +$$ + +Since $x \equiv y \equiv-1(\bmod p), x-y$ is divisible by $p$, so $(x-y)^{2}$ is divisible by $p^{2}$. This means that + +$$ +(x+y)^{2}=(x-y)^{2}+4 x y \equiv 4 \quad\left(\bmod p^{2}\right) +$$ + +so $p^{2}$ divides $(x+y-2)(x+y+2)$. We already know that $x+y \equiv-2(\bmod p)$, so $x+y-2 \equiv$ $-4 \not \equiv 0(\bmod p)$. This means that $p^{2}$ divides $x+y+2$. + +Using the same notation as in the first solution, we subtract the two original equations to obtain + +$$ +p^{b}-p^{a}=y^{p-1}-x^{p-1}+x-y=(y-x)\left(y^{p-2}+y^{p-3} x+\cdots+x^{p-2}-1\right) +$$ + +The second factor is symmetric in $x$ and $y$, so it can be written as a polynomial of the elementary symmetric polynomials $x+y$ and $x y$ with integer coefficients. In particular, its value modulo +$p^{2}$ is characterised by the two congruences $x y \equiv 1\left(\bmod p^{2}\right)$ and $x+y \equiv-2\left(\bmod p^{2}\right)$. Since both congruences are satisfied when $x=y=-1$, we must have + +$$ +y^{p-2}+y^{p-3} x+\cdots+x^{p-2}-1 \equiv(-1)^{p-2}+(-1)^{p-3}(-1)+\cdots+(-1)^{p-2}-1 \quad\left(\bmod p^{2}\right), +$$ + +which simplifies to $y^{p-2}+y^{p-3} x+\cdots+x^{p-2}-1 \equiv-p\left(\bmod p^{2}\right)$. Thus the second factor in (1) is divisible by $p$, but not $p^{2}$. + +This means that $p^{a-1}$ has to divide the other factor $y-x$. It follows that + +$$ +0 \equiv x^{p-1}+y \equiv x^{p-1}+x \equiv x(x+1)\left(x^{p-3}-x^{p-4}+\cdots+1\right) \quad\left(\bmod p^{a-1}\right) . +$$ + +Since $x \equiv-1(\bmod p)$, the last factor is $x^{p-3}-x^{p-4}+\cdots+1 \equiv p-2(\bmod p)$ and in particular not divisible by $p$. We infer that $p^{a-1} \mid x+1$ and continue as in the first solution. + +Comment. Instead of reasoning by means of elementary symmetric polynomials, it is possible to provide a more direct argument as well. For odd $r,(x+1)^{2}$ divides $\left(x^{r}+1\right)^{2}$, and since $p$ divides $x+1$, we deduce that $p^{2}$ divides $\left(x^{r}+1\right)^{2}$. Together with the fact that $x y \equiv 1\left(\bmod p^{2}\right)$, we obtain + +$$ +0 \equiv y^{r}\left(x^{r}+1\right)^{2} \equiv x^{2 r} y^{r}+2 x^{r} y^{r}+y^{r} \equiv x^{r}+2+y^{r} \quad\left(\bmod p^{2}\right) . +$$ + +We apply this congruence with $r=p-2-2 k$ (where $0 \leqslant k<(p-2) / 2$ ) to find that + +$$ +x^{k} y^{p-2-k}+x^{p-2-k} y^{k} \equiv(x y)^{k}\left(x^{p-2-2 k}+y^{p-2-2 k}\right) \equiv 1^{k} \cdot(-2) \equiv-2 \quad\left(\bmod p^{2}\right) . +$$ + +Summing over all $k$ yields + +$$ +y^{p-2}+y^{p-3} x+\cdots+x^{p-2}-1 \equiv \frac{p-1}{2} \cdot(-2)-1 \equiv-p \quad\left(\bmod p^{2}\right) +$$ + +once again. + +N6. Let $a_{1} x_{n} +$$ + +holds for all integers $n \geqslant 0$, it is also strictly increasing. Since $x_{n+1}$ is by (1) coprime to $c$ for any $n \geqslant 0$, it suffices to prove that for each $n \geqslant 2$ there exists a prime number $p$ dividing $x_{n}$ but none of the numbers $x_{1}, \ldots, x_{n-1}$. Let us begin by establishing three preliminary claims. +Claim 1. If $i \equiv j(\bmod m)$ holds for some integers $i, j \geqslant 0$ and $m \geqslant 1$, then $x_{i} \equiv x_{j}\left(\bmod x_{m}\right)$ holds as well. +Proof. Evidently, it suffices to show $x_{i+m} \equiv x_{i}\left(\bmod x_{m}\right)$ for all integers $i \geqslant 0$ and $m \geqslant 1$. For this purpose we may argue for fixed $m$ by induction on $i$ using $x_{0}=0$ in the base case $i=0$. Now, if we have $x_{i+m} \equiv x_{i}\left(\bmod x_{m}\right)$ for some integer $i$, then the recursive equation (1) yields + +$$ +x_{i+m+1} \equiv c^{2}\left(x_{i+m}^{3}-4 x_{i+m}^{2}+5 x_{i+m}\right)+1 \equiv c^{2}\left(x_{i}^{3}-4 x_{i}^{2}+5 x_{i}\right)+1 \equiv x_{i+1} \quad\left(\bmod x_{m}\right), +$$ + +which completes the induction. +Claim 2. If the integers $i, j \geqslant 2$ and $m \geqslant 1$ satisfy $i \equiv j(\bmod m)$, then $x_{i} \equiv x_{j}\left(\bmod x_{m}^{2}\right)$ holds as well. +Proof. Again it suffices to prove $x_{i+m} \equiv x_{i}\left(\bmod x_{m}^{2}\right)$ for all integers $i \geqslant 2$ and $m \geqslant 1$. As above, we proceed for fixed $m$ by induction on $i$. The induction step is again easy using (1), but this time the base case $i=2$ requires some calculation. Set $L=5 c^{2}$. By (1) we have $x_{m+1} \equiv L x_{m}+1\left(\bmod x_{m}^{2}\right)$, and hence + +$$ +\begin{aligned} +x_{m+1}^{3}-4 x_{m+1}^{2}+5 x_{m+1} & \equiv\left(L x_{m}+1\right)^{3}-4\left(L x_{m}+1\right)^{2}+5\left(L x_{m}+1\right) \\ +& \equiv\left(3 L x_{m}+1\right)-4\left(2 L x_{m}+1\right)+5\left(L x_{m}+1\right) \equiv 2 \quad\left(\bmod x_{m}^{2}\right) +\end{aligned} +$$ + +which in turn gives indeed $x_{m+2} \equiv 2 c^{2}+1 \equiv x_{2}\left(\bmod x_{m}^{2}\right)$. +Claim 3. For each integer $n \geqslant 2$, we have $x_{n}>x_{1} \cdot x_{2} \cdots x_{n-2}$. +Proof. The cases $n=2$ and $n=3$ are clear. Arguing inductively, we assume now that the claim holds for some $n \geqslant 3$. Recall that $x_{2} \geqslant 3$, so by monotonicity and (2) we get $x_{n} \geqslant x_{3} \geqslant x_{2}\left(x_{2}-2\right)^{2}+x_{2}+1 \geqslant 7$. It follows that + +$$ +x_{n+1}>x_{n}^{3}-4 x_{n}^{2}+5 x_{n}>7 x_{n}^{2}-4 x_{n}^{2}>x_{n}^{2}>x_{n} x_{n-1} +$$ + +which by the induction hypothesis yields $x_{n+1}>x_{1} \cdot x_{2} \cdots x_{n-1}$, as desired. + +Now we direct our attention to the problem itself: let any integer $n \geqslant 2$ be given. By Claim 3 there exists a prime number $p$ appearing with a higher exponent in the prime factorisation of $x_{n}$ than in the prime factorisation of $x_{1} \cdots x_{n-2}$. In particular, $p \mid x_{n}$, and it suffices to prove that $p$ divides none of $x_{1}, \ldots, x_{n-1}$. + +Otherwise let $k \in\{1, \ldots, n-1\}$ be minimal such that $p$ divides $x_{k}$. Since $x_{n-1}$ and $x_{n}$ are coprime by (1) and $x_{1}=1$, we actually have $2 \leqslant k \leqslant n-2$. Write $n=q k+r$ with some integers $q \geqslant 0$ and $0 \leqslant r 1$, so there exists a prime $p$ with $v_{p}(N)>0$. Since $N$ is a fraction of two odd numbers, $p$ is odd. + +By our lemma, + +$$ +0 \frac{1}{2}, \quad \text { or } \quad\{x\}>\frac{1}{2}, \quad\{y\}>\frac{1}{2}, \quad\{x+y\}<\frac{1}{2}, +$$ + +where $\{x\}$ denotes the fractional part of $x$. +In the context of our problem, the first condition seems easier to deal with. Also, one may notice that + +$$ +\{x\}<\frac{1}{2} \Longleftrightarrow \varkappa(x)=0 \quad \text { and } \quad\{x\} \geqslant \frac{1}{2} \Longleftrightarrow \varkappa(x)=1, +$$ + +where + +$$ +\varkappa(x)=\lfloor 2 x\rfloor-2\lfloor x\rfloor . +$$ + +Now it is natural to consider the number + +$$ +M=\frac{\binom{2 a+2 b}{a+b}}{\binom{2 a}{a}\binom{2 b}{b}} +$$ + +since + +$$ +v_{p}(M)=\sum_{k=1}^{\infty}\left(\varkappa\left(\frac{2(a+b)}{p^{k}}\right)-\varkappa\left(\frac{2 a}{p^{k}}\right)-\varkappa\left(\frac{2 b}{p^{k}}\right)\right) . +$$ + +One may see that $M>1$, and that $v_{2}(M) \leqslant 0$. Thus, there exist an odd prime $p$ and a positive integer $k$ with + +$$ +\varkappa\left(\frac{2(a+b)}{p^{k}}\right)-\varkappa\left(\frac{2 a}{p^{k}}\right)-\varkappa\left(\frac{2 b}{p^{k}}\right)>0 . +$$ + +In view of (4), the last inequality yields + +$$ +\left\{\frac{a}{p^{k}}\right\}<\frac{1}{2}, \quad\left\{\frac{b}{p^{k}}\right\}<\frac{1}{2}, \quad \text { and } \quad\left\{\frac{a+b}{p^{k}}\right\}>\frac{1}{2} +$$ + +which is what we wanted to obtain. +Comment 2. Once one tries to prove the existence of suitable $p$ and $k$ satisfying (5), it seems somehow natural to suppose that $a \leqslant b$ and to add the restriction $p^{k}>a$. In this case the inequalities (5) can be rewritten as + +$$ +2 a k$. We would like to mention here that Sylvester's theorem itself does not seem to suffice for solving the problem. + diff --git a/IMO/md/en-IMO2015SL.md b/IMO/md/en-IMO2015SL.md new file mode 100644 index 0000000000000000000000000000000000000000..88e96b991bbdac35f5dd9fdffead6993b47498b8 --- /dev/null +++ b/IMO/md/en-IMO2015SL.md @@ -0,0 +1,2600 @@ +# Shortlisted Problems with Solutions + +## $(\sqrt{(1)}$
$56^{\text {th }}$
International Mathematical Olympiad + + + +## Shortlisted Problems with Solutions + +$56^{\text {th }}$ International Mathematical Olympiad +Chiang Mai, Thailand, 4-16 + + +## The shortlisted problems should be kept strictly confidential until IMO 2016. + +## Contributing Countries + +The Organizing Committee and the Problem Selection Committee of IMO 2015 thank the following 53 countries for contributing 155 problem proposals: + +Albania, Algeria, Armenia, Australia, Austria, Brazil, Bulgaria, Canada, Costa Rica, Croatia, Cyprus, Denmark, El Salvador, Estonia, Finland, France, Georgia, Germany, Greece, Hong Kong, Hungary, India, Iran, Ireland, Israel, Italy, Japan, Kazakhstan, Lithuania, Luxembourg, Montenegro, Morocco, Netherlands, Pakistan, Poland, Romania, Russia, Saudi Arabia, Serbia, Singapore, Slovakia, Slovenia, South Africa, South Korea, Sweden, Turkey, Turkmenistan, Taiwan, Tanzania, Ukraine, United Kingdom, U.S.A., Uzbekistan + +## Problem Selection Committee + + + +Dungjade Shiowattana, Ilya I. Bogdanov, Tirasan Khandhawit, Wittawat Kositwattanarerk, Géza Kós, Weerachai Neeranartvong, Nipun Pitimanaaree, Christian Reiher, Nat Sothanaphan, Warut Suksompong, Wuttisak Trongsiriwat, Wijit Yangjit + +Assistants: Jirawat Anunrojwong, Pakawut Jiradilok + +## Problems + +## Algebra + +A1. Suppose that a sequence $a_{1}, a_{2}, \ldots$ of positive real numbers satisfies + +$$ +a_{k+1} \geqslant \frac{k a_{k}}{a_{k}^{2}+(k-1)} +$$ + +for every positive integer $k$. Prove that $a_{1}+a_{2}+\cdots+a_{n} \geqslant n$ for every $n \geqslant 2$. +A2. Determine all functions $f: \mathbb{Z} \rightarrow \mathbb{Z}$ with the property that + +$$ +f(x-f(y))=f(f(x))-f(y)-1 +$$ + +holds for all $x, y \in \mathbb{Z}$. +(Croatia) +A3. Let $n$ be a fixed positive integer. Find the maximum possible value of + +$$ +\sum_{1 \leqslant rm \geqslant N$. + +C6. Let $S$ be a nonempty set of positive integers. We say that a positive integer $n$ is clean if it has a unique representation as a sum of an odd number of distinct elements from $S$. Prove that there exist infinitely many positive integers that are not clean. + +C7. In a company of people some pairs are enemies. A group of people is called unsociable if the number of members in the group is odd and at least 3 , and it is possible to arrange all its members around a round table so that every two neighbors are enemies. Given that there are at most 2015 unsociable groups, prove that it is possible to partition the company into 11 parts so that no two enemies are in the same part. + +## Geometry + +G1. Let $A B C$ be an acute triangle with orthocenter $H$. Let $G$ be the point such that the quadrilateral $A B G H$ is a parallelogram. Let $I$ be the point on the line $G H$ such that $A C$ bisects $H I$. Suppose that the line $A C$ intersects the circumcircle of the triangle $G C I$ at $C$ and $J$. Prove that $I J=A H$. +(Australia) +G2. Let $A B C$ be a triangle inscribed into a circle $\Omega$ with center $O$. A circle $\Gamma$ with center $A$ meets the side $B C$ at points $D$ and $E$ such that $D$ lies between $B$ and $E$. Moreover, let $F$ and $G$ be the common points of $\Gamma$ and $\Omega$. We assume that $F$ lies on the arc $A B$ of $\Omega$ not containing $C$, and $G$ lies on the arc $A C$ of $\Omega$ not containing $B$. The circumcircles of the triangles $B D F$ and $C E G$ meet the sides $A B$ and $A C$ again at $K$ and $L$, respectively. Suppose that the lines $F K$ and $G L$ are distinct and intersect at $X$. Prove that the points $A, X$, and $O$ are collinear. +(Greece) +G3. Let $A B C$ be a triangle with $\angle C=90^{\circ}$, and let $H$ be the foot of the altitude from $C$. A point $D$ is chosen inside the triangle $C B H$ so that $C H$ bisects $A D$. Let $P$ be the intersection point of the lines $B D$ and $C H$. Let $\omega$ be the semicircle with diameter $B D$ that meets the segment $C B$ at an interior point. A line through $P$ is tangent to $\omega$ at $Q$. Prove that the lines $C Q$ and $A D$ meet on $\omega$. +(Georgia) +G4. Let $A B C$ be an acute triangle, and let $M$ be the midpoint of $A C$. A circle $\omega$ passing through $B$ and $M$ meets the sides $A B$ and $B C$ again at $P$ and $Q$, respectively. Let $T$ be the point such that the quadrilateral $B P T Q$ is a parallelogram. Suppose that $T$ lies on the circumcircle of the triangle $A B C$. Determine all possible values of $B T / B M$. +(Russia) +G5. Let $A B C$ be a triangle with $C A \neq C B$. Let $D, F$, and $G$ be the midpoints of the sides $A B, A C$, and $B C$, respectively. A circle $\Gamma$ passing through $C$ and tangent to $A B$ at $D$ meets the segments $A F$ and $B G$ at $H$ and $I$, respectively. The points $H^{\prime}$ and $I^{\prime}$ are symmetric to $H$ and $I$ about $F$ and $G$, respectively. The line $H^{\prime} I^{\prime}$ meets $C D$ and $F G$ at $Q$ and $M$, respectively. The line $C M$ meets $\Gamma$ again at $P$. Prove that $C Q=Q P$. +(El Salvador) +G6. Let $A B C$ be an acute triangle with $A B>A C$, and let $\Gamma$ be its circumcircle. Let $H$, $M$, and $F$ be the orthocenter of the triangle, the midpoint of $B C$, and the foot of the altitude from $A$, respectively. Let $Q$ and $K$ be the two points on $\Gamma$ that satisfy $\angle A Q H=90^{\circ}$ and $\angle Q K H=90^{\circ}$. Prove that the circumcircles of the triangles $K Q H$ and $K F M$ are tangent to each other. +(Ukraine) +G7. Let $A B C D$ be a convex quadrilateral, and let $P, Q, R$, and $S$ be points on the sides $A B, B C, C D$, and $D A$, respectively. Let the line segments $P R$ and $Q S$ meet at $O$. Suppose that each of the quadrilaterals $A P O S, B Q O P, C R O Q$, and $D S O R$ has an incircle. Prove that the lines $A C, P Q$, and $R S$ are either concurrent or parallel to each other. +(Bulgaria) +G8. A triangulation of a convex polygon $\Pi$ is a partitioning of $\Pi$ into triangles by diagonals having no common points other than the vertices of the polygon. We say that a triangulation is a Thaiangulation if all triangles in it have the same area. + +Prove that any two different Thaiangulations of a convex polygon $\Pi$ differ by exactly two triangles. (In other words, prove that it is possible to replace one pair of triangles in the first Thaiangulation with a different pair of triangles so as to obtain the second Thaiangulation.) +(Bulgaria) + +## Number Theory + +N1. Determine all positive integers $M$ for which the sequence $a_{0}, a_{1}, a_{2}, \ldots$, defined by $a_{0}=\frac{2 M+1}{2}$ and $a_{k+1}=a_{k}\left\lfloor a_{k}\right\rfloor$ for $k=0,1,2, \ldots$, contains at least one integer term. +(Luxembourg) +N2. Let $a$ and $b$ be positive integers such that $a!b$ ! is a multiple of $a!+b!$. Prove that $3 a \geqslant 2 b+2$. +(United Kingdom) +N3. Let $m$ and $n$ be positive integers such that $m>n$. Define $x_{k}=(m+k) /(n+k)$ for $k=$ $1,2, \ldots, n+1$. Prove that if all the numbers $x_{1}, x_{2}, \ldots, x_{n+1}$ are integers, then $x_{1} x_{2} \cdots x_{n+1}-1$ is divisible by an odd prime. +(Austria) +N4. Suppose that $a_{0}, a_{1}, \ldots$ and $b_{0}, b_{1}, \ldots$ are two sequences of positive integers satisfying $a_{0}, b_{0} \geqslant 2$ and + +$$ +a_{n+1}=\operatorname{gcd}\left(a_{n}, b_{n}\right)+1, \quad b_{n+1}=\operatorname{lcm}\left(a_{n}, b_{n}\right)-1 +$$ + +for all $n \geqslant 0$. Prove that the sequence $\left(a_{n}\right)$ is eventually periodic; in other words, there exist integers $N \geqslant 0$ and $t>0$ such that $a_{n+t}=a_{n}$ for all $n \geqslant N$. +(France) +N5. Determine all triples $(a, b, c)$ of positive integers for which $a b-c, b c-a$, and $c a-b$ are powers of 2 . + +Explanation: A power of 2 is an integer of the form $2^{n}$, where $n$ denotes some nonnegative integer. +(Serbia) +N6. Let $\mathbb{Z}_{>0}$ denote the set of positive integers. Consider a function $f: \mathbb{Z}_{>0} \rightarrow \mathbb{Z}_{>0}$. For any $m, n \in \mathbb{Z}_{>0}$ we write $f^{n}(m)=\underbrace{f(f(\ldots f}_{n}(m) \ldots))$. Suppose that $f$ has the following two properties: +(i) If $m, n \in \mathbb{Z}_{>0}$, then $\frac{f^{n}(m)-m}{n} \in \mathbb{Z}_{>0}$; +(ii) The set $\mathbb{Z}_{>0} \backslash\left\{f(n) \mid n \in \mathbb{Z}_{>0}\right\}$ is finite. + +Prove that the sequence $f(1)-1, f(2)-2, f(3)-3, \ldots$ is periodic. +(Singapore) +N7. Let $\mathbb{Z}_{>0}$ denote the set of positive integers. For any positive integer $k$, a function $f: \mathbb{Z}_{>0} \rightarrow \mathbb{Z}_{>0}$ is called $k$-good if $\operatorname{gcd}(f(m)+n, f(n)+m) \leqslant k$ for all $m \neq n$. Find all $k$ such that there exists a $k$-good function. +(Canada) +N8. For every positive integer $n$ with prime factorization $n=\prod_{i=1}^{k} p_{i}^{\alpha_{i}}$, define + +$$ +\mho(n)=\sum_{i: p_{i}>10^{100}} \alpha_{i} . +$$ + +That is, $\mho(n)$ is the number of prime factors of $n$ greater than $10^{100}$, counted with multiplicity. +Find all strictly increasing functions $f: \mathbb{Z} \rightarrow \mathbb{Z}$ such that + +$$ +\mho(f(a)-f(b)) \leqslant \mho(a-b) \quad \text { for all integers } a \text { and } b \text { with } a>b . +$$ + +## Solutions + +## Algebra + +A1. Suppose that a sequence $a_{1}, a_{2}, \ldots$ of positive real numbers satisfies + +$$ +a_{k+1} \geqslant \frac{k a_{k}}{a_{k}^{2}+(k-1)} +$$ + +for every positive integer $k$. Prove that $a_{1}+a_{2}+\cdots+a_{n} \geqslant n$ for every $n \geqslant 2$. + +Solution. From the constraint (1), it can be seen that + +$$ +\frac{k}{a_{k+1}} \leqslant \frac{a_{k}^{2}+(k-1)}{a_{k}}=a_{k}+\frac{k-1}{a_{k}} +$$ + +and so + +$$ +a_{k} \geqslant \frac{k}{a_{k+1}}-\frac{k-1}{a_{k}} . +$$ + +Summing up the above inequality for $k=1, \ldots, m$, we obtain + +$$ +a_{1}+a_{2}+\cdots+a_{m} \geqslant\left(\frac{1}{a_{2}}-\frac{0}{a_{1}}\right)+\left(\frac{2}{a_{3}}-\frac{1}{a_{2}}\right)+\cdots+\left(\frac{m}{a_{m+1}}-\frac{m-1}{a_{m}}\right)=\frac{m}{a_{m+1}} +$$ + +Now we prove the problem statement by induction on $n$. The case $n=2$ can be done by applying (1) to $k=1$ : + +$$ +a_{1}+a_{2} \geqslant a_{1}+\frac{1}{a_{1}} \geqslant 2 +$$ + +For the induction step, assume that the statement is true for some $n \geqslant 2$. If $a_{n+1} \geqslant 1$, then the induction hypothesis yields + +$$ +\left(a_{1}+\cdots+a_{n}\right)+a_{n+1} \geqslant n+1 +$$ + +Otherwise, if $a_{n+1}<1$ then apply (2) as + +$$ +\left(a_{1}+\cdots+a_{n}\right)+a_{n+1} \geqslant \frac{n}{a_{n+1}}+a_{n+1}=\frac{n-1}{a_{n+1}}+\left(\frac{1}{a_{n+1}}+a_{n+1}\right)>(n-1)+2 +$$ + +That completes the solution. +Comment 1. It can be seen easily that having equality in the statement requires $a_{1}=a_{2}=1$ in the base case $n=2$, and $a_{n+1}=1$ in (3). So the equality $a_{1}+\cdots+a_{n}=n$ is possible only in the trivial case $a_{1}=\cdots=a_{n}=1$. + +Comment 2. After obtaining (2), there are many ways to complete the solution. We outline three such possibilities. + +- With defining $s_{n}=a_{1}+\cdots+a_{n}$, the induction step can be replaced by + +$$ +s_{n+1}=s_{n}+a_{n+1} \geqslant s_{n}+\frac{n}{s_{n}} \geqslant n+1 +$$ + +because the function $x \mapsto x+\frac{n}{x}$ increases on $[n, \infty)$. + +- By applying the AM-GM inequality to the numbers $a_{1}+\cdots+a_{k}$ and $k a_{k+1}$, we can conclude + +$$ +a_{1}+\cdots+a_{k}+k a_{k+1} \geqslant 2 k +$$ + +and sum it up for $k=1, \ldots, n-1$. + +- We can derive the symmetric estimate + +$$ +\sum_{1 \leqslant ib$ with $f(a)=f(b)$. A straightforward induction using (2) in the induction step reveals that we have $f(a+n)=f(b+n)$ for all nonnegative integers $n$. Consequently, the sequence $\gamma_{n}=f(b+n)$ is periodic and thus in particular bounded, which means that the numbers + +$$ +\varphi=\min _{n \geqslant 0} \gamma_{n} \quad \text { and } \quad \psi=\max _{n \geqslant 0} \gamma_{n} +$$ + +exist. +Let us pick any integer $y$ with $f(y)=\varphi$ and then an integer $x \geqslant a$ with $f(x-f(y))=\varphi$. Due to the definition of $\varphi$ and (3) we have + +$$ +\varphi \leqslant f(x+1)=f(x-f(y))+f(y)+1=2 \varphi+1 +$$ + +whence $\varphi \geqslant-1$. The same reasoning applied to $\psi$ yields $\psi \leqslant-1$. Since $\varphi \leqslant \psi$ holds trivially, it follows that $\varphi=\psi=-1$, or in other words that we have $f(t)=-1$ for all integers $t \geqslant a$. + +Finally, if any integer $y$ is given, we may find an integer $x$ which is so large that $x+1 \geqslant a$ and $x-f(y) \geqslant a$ hold. Due to (3) and the result from the previous paragraph we get + +$$ +f(y)=f(x+1)-f(x-f(y))-1=(-1)-(-1)-1=-1 . +$$ + +Thereby the problem is solved. +Solution 3. Set $d=f(0)$. By plugging $x=f(y)$ into (1) we obtain + +$$ +f^{3}(y)=f(y)+d+1 +$$ + +for all $y \in \mathbb{Z}$, where the left-hand side abbreviates $f(f(f(y)))$. When we replace $x$ in (1) by $f(x)$ we obtain $f(f(x)-f(y))=f^{3}(x)-f(y)-1$ and as a consequence of (4) this simplifies to + +$$ +f(f(x)-f(y))=f(x)-f(y)+d +$$ + +Now we consider the set + +$$ +E=\{f(x)-d \mid x \in \mathbb{Z}\} +$$ + +Given two integers $a$ and $b$ from $E$, we may pick some integers $x$ and $y$ with $f(x)=a+d$ and $f(y)=b+d$; now (5) tells us that $f(a-b)=(a-b)+d$, which means that $a-b$ itself exemplifies $a-b \in E$. Thus, + +$$ +E \text { is closed under taking differences. } +$$ + +Also, the definitions of $d$ and $E$ yield $0 \in E$. If $E=\{0\}$, then $f$ is a constant function and (1) implies that the only value attained by $f$ is indeed -1 . + +So let us henceforth suppose that $E$ contains some number besides zero. It is known that in this case (6) entails $E$ to be the set of all integer multiples of some positive integer $k$. Indeed, this holds for + +$$ +k=\min \{|x| \mid x \in E \text { and } x \neq 0\} +$$ + +as one may verify by an argument based on division with remainder. +Thus we have + +$$ +\{f(x) \mid x \in \mathbb{Z}\}=\{k \cdot t+d \mid t \in \mathbb{Z}\} +$$ + +Due to (5) and (7) we get + +$$ +f(k \cdot t)=k \cdot t+d +$$ + +for all $t \in \mathbb{Z}$, whence in particular $f(k)=k+d$. So by comparing the results of substituting $y=0$ and $y=k$ into (1) we learn that + +$$ +f(z+k)=f(z)+k +$$ + +holds for all integers $z$. In plain English, this means that on any residue class modulo $k$ the function $f$ is linear with slope 1. + +Now by (7) the set of all values attained by $f$ is such a residue class. Hence, there exists an absolute constant $c$ such that $f(f(x))=f(x)+c$ holds for all $x \in \mathbb{Z}$. Thereby (1) simplifies to + +$$ +f(x-f(y))=f(x)-f(y)+c-1 +$$ + +On the other hand, considering (1) modulo $k$ we obtain $d \equiv-1(\bmod k)$ because of (7). So by (7) again, $f$ attains the value -1 . + +Thus we may apply (9) to some integer $y$ with $f(y)=-1$, which gives $f(x+1)=f(x)+c$. So $f$ is a linear function with slope $c$. Hence, (8) leads to $c=1$, wherefore there is an absolute constant $d^{\prime}$ with $f(x)=x+d^{\prime}$ for all $x \in \mathbb{Z}$. Using this for $x=0$ we obtain $d^{\prime}=d$ and finally (4) discloses $d=1$, meaning that $f$ is indeed the successor function. + +A3. Let $n$ be a fixed positive integer. Find the maximum possible value of + +$$ +\sum_{1 \leqslant r 1$ is odd. One can modify the arguments of the last part in order to work for every (not necessarily odd) sufficiently large value of $k$; namely, when $k$ is even, one may show that the sequence $P(1), P(2), \ldots, P(k)$ has different numbers of positive and negative terms. + +On the other hand, the problem statement with $k$ replaced by 2 is false, since the polynomials $P(x)=T(x)-T(x-1)$ and $Q(x)=T(x-1)-T(x)$ are block-similar in this case, due to the fact that $P(2 i-1)=-P(2 i)=Q(2 i)=-Q(2 i-1)=T(2 i-1)$ for all $i=1,2, \ldots, n$. Thus, every complete solution should use the relation $k>2$. + +One may easily see that the condition $n \geqslant 2$ is also substantial, since the polynomials $x$ and $k+1-x$ become block-similar if we set $n=1$. + +It is easily seen from the solution that the result still holds if we assume that the polynomials have degree at most $n$. + +Solution 2. We provide an alternative argument for part (b). +Assume again that there exist two distinct block-similar polynomials $P(x)$ and $Q(x)$ of degree $n$. Let $R(x)=P(x)-Q(x)$ and $S(x)=P(x)+Q(x)$. For brevity, we also denote the segment $[(i-1) k+1, i k]$ by $I_{i}$, and the set $\{(i-1) k+1,(i-1) k+2, \ldots, i k\}$ of all integer points in $I_{i}$ by $Z_{i}$. +Step 1. We prove that $R(x)$ has exactly one root in each segment $I_{i}, i=1,2, \ldots, n$, and all these roots are simple. + +Indeed, take any $i \in\{1,2, \ldots, n\}$ and choose some points $p^{-}, p^{+} \in Z_{i}$ so that + +$$ +P\left(p^{-}\right)=\min _{x \in Z_{i}} P(x) \quad \text { and } \quad P\left(p^{+}\right)=\max _{x \in Z_{i}} P(x) +$$ + +Since the sequences of values of $P$ and $Q$ in $Z_{i}$ are permutations of each other, we have $R\left(p^{-}\right)=P\left(p^{-}\right)-Q\left(p^{-}\right) \leqslant 0$ and $R\left(p^{+}\right)=P\left(p^{+}\right)-Q\left(p^{+}\right) \geqslant 0$. Since $R(x)$ is continuous, there exists at least one root of $R(x)$ between $p^{-}$and $p^{+}$- thus in $I_{i}$. + +So, $R(x)$ has at least one root in each of the $n$ disjoint segments $I_{i}$ with $i=1,2, \ldots, n$. Since $R(x)$ is nonzero and its degree does not exceed $n$, it should have exactly one root in each of these segments, and all these roots are simple, as required. + +## Step 2. We prove that $S(x)$ is constant. + +We start with the following claim. +Claim. For every $i=1,2, \ldots, n$, the sequence of values $S((i-1) k+1), S((i-1) k+2), \ldots$, $S(i k)$ cannot be strictly increasing. +Proof. Fix any $i \in\{1,2, \ldots, n\}$. Due to the symmetry, we may assume that $P(i k) \leqslant Q(i k)$. Choose now $p^{-}$and $p^{+}$as in Step 1. If we had $P\left(p^{+}\right)=P\left(p^{-}\right)$, then $P$ would be constant on $Z_{i}$, so all the elements of $Z_{i}$ would be the roots of $R(x)$, which is not the case. In particular, we have $p^{+} \neq p^{-}$. If $p^{-}>p^{+}$, then $S\left(p^{-}\right)=P\left(p^{-}\right)+Q\left(p^{-}\right) \leqslant Q\left(p^{+}\right)+P\left(p^{+}\right)=S\left(p^{+}\right)$, so our claim holds. + +We now show that the remaining case $p^{-}$ $Q\left(p^{+}\right)$. Then, like in Step 1 , we have $R\left(p^{-}\right) \leqslant 0, R\left(p^{+}\right)>0$, and $R(i k) \leqslant 0$, so $R(x)$ has a root in each of the intervals $\left[p^{-}, p^{+}\right)$and $\left(p^{+}, i k\right]$. This contradicts the result of Step 1. + +We are left only with the case $p^{-}
0$. Next, let $p^{-}, q^{+} \in I_{i}$ be some points such that $P\left(p^{-}\right)=\min _{x \in Z_{i}} P(x)$ and $Q\left(q^{+}\right)=\max _{x \in Z_{i}} Q(x)$. Notice that $P\left(p^{-}\right) \leqslant Q(r)
Q(r)$, so $r$ is different from $p^{-}$and $q^{+}$. + +Without loss of generality, we may assume that $p^{-}
r$, then, similarly, $R\left(q^{+}\right) \leqslant 0 \ell_{j}>r_{i}$. + +Clearly, there is no town which can sweep $T_{n}$ away from the right. Then we may choose the leftmost town $T_{k}$ which cannot be swept away from the right. One can observe now that no town $T_{i}$ with $i>k$ may sweep away some town $T_{j}$ with $j m$. As we have already observed, $p$ cannot be greater than $k$. On the other hand, $T_{m}$ cannot sweep $T_{p}$ away, so a fortiori it cannot sweep $T_{k}$ away. + +Claim 2. Any town $T_{m}$ with $m \neq k$ can be swept away by some other town. + +Proof. If $m k$. + +Let $T_{p}$ be a town among $T_{k}, T_{k+1}, \ldots, T_{m-1}$ having the largest right bulldozer. We claim that $T_{p}$ can sweep $T_{m}$ away. If this is not the case, then $r_{p}<\ell_{q}$ for some $q$ with $p 1$. Firstly, we find a town which can be swept away by each of its neighbors (each town has two neighbors, except for the bordering ones each of which has one); we call such town a loser. Such a town exists, because there are $n-1$ pairs of neighboring towns, and in each of them there is only one which can sweep the other away; so there exists a town which is a winner in none of these pairs. + +Notice that a loser can be swept away, but it cannot sweep any other town away (due to its neighbors' protection). Now we remove a loser, and suggest its left bulldozer to its right neighbor (if it exists), and its right bulldozer to a left one (if it exists). Surely, a town accepts a suggestion if a suggested bulldozer is larger than the town's one of the same orientation. + +Notice that suggested bulldozers are useless in attack (by the definition of a loser), but may serve for defensive purposes. Moreover, each suggested bulldozer's protection works for the same pairs of remaining towns as before the removal. + +By the induction hypothesis, the new configuration contains exactly one town which cannot be swept away. The arguments above show that the initial one also satisfies this property. + +Solution 3. We separately prove that $(i)$ there exists a town which cannot be swept away, and that (ii) there is at most one such town. We also make use of the two observations from the previous solutions. +To prove ( $i$ ), assume contrariwise that every town can be swept away. Let $t_{1}$ be the leftmost town; next, for every $k=1,2, \ldots$ we inductively choose $t_{k+1}$ to be some town which can sweep $t_{k}$ away. Now we claim that for every $k=1,2, \ldots$, the town $t_{k+1}$ is to the right of $t_{k}$; this leads to the contradiction, since the number of towns is finite. + +Induction on $k$. The base case $k=1$ is clear due to the choice of $t_{1}$. Assume now that for all $j$ with $1 \leqslant jj$ and $a_{i} \frac{n}{2}$, then we have $O A_{i-n / 2+1}=A_{i} A_{i-n / 2+1}$. This completes the proof. + +An example of such a construction when $n=10$ is shown in Figure 1. + + +Figure 1 + + +Figure 2 + +Comment (a). There are many ways to construct an example by placing equilateral triangles in a circle. Here we present one general method. + +Let $O$ be the center of a circle and let $A_{1}, B_{1}, \ldots, A_{k}, B_{k}$ be distinct points on the circle such that the triangle $O A_{i} B_{i}$ is equilateral for each $i$. Then $\mathcal{V}=\left\{O, A_{1}, B_{1}, \ldots, A_{k}, B_{k}\right\}$ is balanced. To construct a set of even cardinality, put extra points $C, D, E$ on the circle such that triangles $O C D$ and $O D E$ are equilateral (see Figure 2). Then $\mathcal{V}=\left\{O, A_{1}, B_{1}, \ldots, A_{k}, B_{k}, C, D, E\right\}$ is balanced. + +Part (b). We now show that there exists a balanced, center-free set containing $n$ points for all odd $n \geqslant 3$, and that one does not exist for any even $n \geqslant 3$. + +If $n$ is odd, then let $\mathcal{V}$ be the set of vertices of a regular $n$-gon. We have shown in part ( $a$ ) that $\mathcal{V}$ is balanced. We claim that $\mathcal{V}$ is also center-free. Indeed, if $P$ is a point such that +$P A=P B=P C$ for some three distinct vertices $A, B$ and $C$, then $P$ is the circumcenter of the $n$-gon, which is not contained in $\mathcal{V}$. + +Now suppose that $\mathcal{V}$ is a balanced, center-free set of even cardinality $n$. We will derive a contradiction. For a pair of distinct points $A, B \in \mathcal{V}$, we say that a point $C \in \mathcal{V}$ is associated with the pair $\{A, B\}$ if $A C=B C$. Since there are $\frac{n(n-1)}{2}$ pairs of points, there exists a point $P \in \mathcal{V}$ which is associated with at least $\left\lceil\frac{n(n-1)}{2} / n\right\rceil=\frac{n}{2}$ pairs. Note that none of these $\frac{n}{2}$ pairs can contain $P$, so that the union of these $\frac{n}{2}$ pairs consists of at most $n-1$ points. Hence there exist two such pairs that share a point. Let these two pairs be $\{A, B\}$ and $\{A, C\}$. Then $P A=P B=P C$, which is a contradiction. + +Comment (b). We can rephrase the argument in graph theoretic terms as follows. Let $\mathcal{V}$ be a balanced, center-free set consisting of $n$ points. For any pair of distinct vertices $A, B \in \mathcal{V}$ and for any $C \in \mathcal{V}$ such that $A C=B C$, draw directed edges $A \rightarrow C$ and $B \rightarrow C$. Then all pairs of vertices generate altogether at least $n(n-1)$ directed edges; since the set is center-free, these edges are distinct. So we must obtain a graph in which any two vertices are connected in both directions. Now, each vertex has exactly $n-1$ incoming edges, which means that $n-1$ is even. Hence $n$ is odd. + +C3. For a finite set $A$ of positive integers, we call a partition of $A$ into two disjoint nonempty subsets $A_{1}$ and $A_{2}$ good if the least common multiple of the elements in $A_{1}$ is equal to the greatest common divisor of the elements in $A_{2}$. Determine the minimum value of $n$ such that there exists a set of $n$ positive integers with exactly 2015 good partitions. +(Ukraine) +Answer. 3024. +Solution. Let $A=\left\{a_{1}, a_{2}, \ldots, a_{n}\right\}$, where $a_{1} 1$ and $B$ can respond by choosing $a-1$ on the $k^{\text {th }}$ move instead. + +We now give an alternative winning strategy in the case $n$ is even and $n \geqslant 8$. We first present a winning strategy for the case when $A$ 's first pick is 1 . We consider two cases depending on $A$ 's second move. + +Case 1. A's second pick is 3 . Then $B$ chooses $n-3$ on the second move. On the $k^{\text {th }}$ move, $B$ chooses the number exactly 1 less than $A^{\prime}$ 's $k^{\text {th }}$ pick except that $B$ chooses 2 if $A$ 's $k^{\text {th }}$ pick is $n-2$ or $n-1$. + +Case 2. A's second pick is $a>3$. Then $B$ chooses $a-2$ on the second move. Afterwards on the $k^{\text {th }}$ move, $B$ picks the number exactly 1 less than $A^{\text {'s }} k^{\text {th }}$ pick. + +One may easily see that this strategy guarantees $B$ 's victory, when $A$ 's first pick is 1 . +The following claim shows how to extend the strategy to the general case. +Claim. Assume that $B$ has an explicit strategy leading to a victory after $A$ picks 1 on the first move. Then $B$ also has an explicit strategy leading to a victory after any first moves of $A$. +Proof. Let $S$ be an optimal strategy of $B$ after $A$ picks 1 on the first move. Assume that $A$ picks some number $a>1$ on this move; we show how $B$ can make use of $S$ in order to win in this case. + +In parallel to the real play, $B$ starts an imaginary play. The positions in these plays differ by flipping the segment $[1, a]$; so, if a player chooses some number $x$ in the real play, then the same player chooses a number $x$ or $a+1-x$ in the imaginary play, depending on whether $x>a$ or $x \leqslant a$. Thus $A$ 's first pick in the imaginary play is 1. + +Clearly, a number is chosen in the real play exactly if the corresponding number is chosen in the imaginary one. Next, if an unchosen number is neighboring to one chosen by $A$ in the imaginary play, then the corresponding number also has this property in the real play, so $A$ also cannot choose it. One can easily see that a similar statement with real and imaginary plays interchanged holds for $B$ instead of $A$. + +Thus, when $A$ makes some move in the real play, $B$ may imagine the corresponding legal move in the imaginary one. Then $B$ chooses the response according to $S$ in the imaginary game and makes the corresponding legal move in the real one. Acting so, $B$ wins the imaginary game, thus $B$ will also win the real one. + +Hence, $B$ has a winning strategy for all even $n$ greater or equal to 8 . +Notice that the claim can also be used to simplify the argument when $n$ is odd. +Comment 2. One may also employ symmetry when $n$ is odd. In particular, $B$ could use a mirror strategy. However, additional ideas are required to modify the strategy after $A$ picks $\frac{n+1}{2}$. + +C5. Consider an infinite sequence $a_{1}, a_{2}, \ldots$ of positive integers with $a_{i} \leqslant 2015$ for all $i \geqslant 1$. Suppose that for any two distinct indices $i$ and $j$ we have $i+a_{i} \neq j+a_{j}$. + +Prove that there exist two positive integers $b$ and $N$ such that + +$$ +\left|\sum_{i=m+1}^{n}\left(a_{i}-b\right)\right| \leqslant 1007^{2} +$$ + +whenever $n>m \geqslant N$. +(Australia) +Solution 1. We visualize the set of positive integers as a sequence of points. For each $n$ we draw an arrow emerging from $n$ that points to $n+a_{n}$; so the length of this arrow is $a_{n}$. Due to the condition that $m+a_{m} \neq n+a_{n}$ for $m \neq n$, each positive integer receives at most one arrow. There are some positive integers, such as 1 , that receive no arrows; these will be referred to as starting points in the sequel. When one starts at any of the starting points and keeps following the arrows, one is led to an infinite path, called its ray, that visits a strictly increasing sequence of positive integers. Since the length of any arrow is at most 2015, such a ray, say with starting point $s$, meets every interval of the form $[n, n+2014]$ with $n \geqslant s$ at least once. + +Suppose for the sake of contradiction that there would be at least 2016 starting points. Then we could take an integer $n$ that is larger than the first 2016 starting points. But now the interval $[n, n+2014]$ must be met by at least 2016 rays in distinct points, which is absurd. We have thereby shown that the number $b$ of starting points satisfies $1 \leqslant b \leqslant 2015$. Let $N$ denote any integer that is larger than all starting points. We contend that $b$ and $N$ are as required. + +To see this, let any two integers $m$ and $n$ with $n>m \geqslant N$ be given. The sum $\sum_{i=m+1}^{n} a_{i}$ gives the total length of the arrows emerging from $m+1, \ldots, n$. Taken together, these arrows form $b$ subpaths of our rays, some of which may be empty. Now on each ray we look at the first number that is larger than $m$; let $x_{1}, \ldots, x_{b}$ denote these numbers, and let $y_{1}, \ldots, y_{b}$ enumerate in corresponding order the numbers defined similarly with respect to $n$. Then the list of differences $y_{1}-x_{1}, \ldots, y_{b}-x_{b}$ consists of the lengths of these paths and possibly some zeros corresponding to empty paths. Consequently, we obtain + +$$ +\sum_{i=m+1}^{n} a_{i}=\sum_{j=1}^{b}\left(y_{j}-x_{j}\right) +$$ + +whence + +$$ +\sum_{i=m+1}^{n}\left(a_{i}-b\right)=\sum_{j=1}^{b}\left(y_{j}-n\right)-\sum_{j=1}^{b}\left(x_{j}-m\right) . +$$ + +Now each of the $b$ rays meets the interval $[m+1, m+2015]$ at some point and thus $x_{1}-$ $m, \ldots, x_{b}-m$ are $b$ distinct members of the set $\{1,2, \ldots, 2015\}$. Moreover, since $m+1$ is not a starting point, it must belong to some ray; so 1 has to appear among these numbers, wherefore + +$$ +1+\sum_{j=1}^{b-1}(j+1) \leqslant \sum_{j=1}^{b}\left(x_{j}-m\right) \leqslant 1+\sum_{j=1}^{b-1}(2016-b+j) +$$ + +The same argument applied to $n$ and $y_{1}, \ldots, y_{b}$ yields + +$$ +1+\sum_{j=1}^{b-1}(j+1) \leqslant \sum_{j=1}^{b}\left(y_{j}-n\right) \leqslant 1+\sum_{j=1}^{b-1}(2016-b+j) +$$ + +So altogether we get + +$$ +\begin{aligned} +\left|\sum_{i=m+1}^{n}\left(a_{i}-b\right)\right| & \leqslant \sum_{j=1}^{b-1}((2016-b+j)-(j+1))=(b-1)(2015-b) \\ +& \leqslant\left(\frac{(b-1)+(2015-b)}{2}\right)^{2}=1007^{2}, +\end{aligned} +$$ + +as desired. +Solution 2. Set $s_{n}=n+a_{n}$ for all positive integers $n$. By our assumptions, we have + +$$ +n+1 \leqslant s_{n} \leqslant n+2015 +$$ + +for all $n \in \mathbb{Z}_{>0}$. The members of the sequence $s_{1}, s_{2}, \ldots$ are distinct. We shall investigate the set + +$$ +M=\mathbb{Z}_{>0} \backslash\left\{s_{1}, s_{2}, \ldots\right\} +$$ + +Claim. At most 2015 numbers belong to $M$. +Proof. Otherwise let $m_{1} m \geqslant N$. Plugging $r=n$ and $r=m$ into (3) and subtracting the estimates that result, we deduce + +$$ +\sum_{i=m+1}^{n}\left(a_{i}-b\right)=\sum C_{n}-\sum C_{m} +$$ + +Since $C_{n}$ and $C_{m}$ are subsets of $\{1,2, \ldots, 2014\}$ with $\left|C_{n}\right|=\left|C_{m}\right|=b-1$, it is clear that the absolute value of the right-hand side of the above inequality attains its largest possible value if either $C_{m}=\{1,2, \ldots, b-1\}$ and $C_{n}=\{2016-b, \ldots, 2014\}$, or the other way around. In these two cases we have + +$$ +\left|\sum C_{n}-\sum C_{m}\right|=(b-1)(2015-b) +$$ + +so in the general case we find + +$$ +\left|\sum_{i=m+1}^{n}\left(a_{i}-b\right)\right| \leqslant(b-1)(2015-b) \leqslant\left(\frac{(b-1)+(2015-b)}{2}\right)^{2}=1007^{2} +$$ + +as desired. + +Comment. The sets $C_{n}$ may be visualized by means of the following process: Start with an empty blackboard. For $n \geqslant 1$, the following happens during the $n^{\text {th }}$ step. The number $a_{n}$ gets written on the blackboard, then all numbers currently on the blackboard are decreased by 1 , and finally all zeros that have arisen get swept away. + +It is not hard to see that the numbers present on the blackboard after $n$ steps are distinct and form the set $C_{n}$. Moreover, it is possible to complete a solution based on this idea. + +C6. Let $S$ be a nonempty set of positive integers. We say that a positive integer $n$ is clean if it has a unique representation as a sum of an odd number of distinct elements from $S$. Prove that there exist infinitely many positive integers that are not clean. + +Solution 1. Define an odd (respectively, even) representation of $n$ to be a representation of $n$ as a sum of an odd (respectively, even) number of distinct elements of $S$. Let $\mathbb{Z}_{>0}$ denote the set of all positive integers. + +Suppose, to the contrary, that there exist only finitely many positive integers that are not clean. Therefore, there exists a positive integer $N$ such that every integer $n>N$ has exactly one odd representation. + +Clearly, $S$ is infinite. We now claim the following properties of odd and even representations. +$\underline{P r o p e r t y}$ 1. Any positive integer $n$ has at most one odd and at most one even representation. +Proof. We first show that every integer $n$ has at most one even representation. Since $S$ is infinite, there exists $x \in S$ such that $x>\max \{n, N\}$. Then, the number $n+x$ must be clean, and $x$ does not appear in any even representation of $n$. If $n$ has more than one even representation, then we obtain two distinct odd representations of $n+x$ by adding $x$ to the even representations of $n$, which is impossible. Therefore, $n$ can have at most one even representation. + +Similarly, there exist two distinct elements $y, z \in S$ such that $y, z>\max \{n, N\}$. If $n$ has more than one odd representation, then we obtain two distinct odd representations of $n+y+z$ by adding $y$ and $z$ to the odd representations of $n$. This is again a contradiction. + +Property 2. Fix $s \in S$. Suppose that a number $n>N$ has no even representation. Then $n+2 a s$ has an even representation containing $s$ for all integers $a \geqslant 1$. +Proof. It is sufficient to prove the following statement: If $n$ has no even representation without $s$, then $n+2 s$ has an even representation containing $s$ (and hence no even representation without $s$ by Property 1). + +Notice that the odd representation of $n+s$ does not contain $s$; otherwise, we have an even representation of $n$ without $s$. Then, adding $s$ to this odd representation of $n+s$, we get that $n+2 s$ has an even representation containing $s$, as desired. + +Property 3. Every sufficiently large integer has an even representation. +Proof. Fix any $s \in S$, and let $r$ be an arbitrary element in $\{1,2, \ldots, 2 s\}$. Then, Property 2 implies that the set $Z_{r}=\{r+2 a s: a \geqslant 0\}$ contains at most one number exceeding $N$ with no even representation. Therefore, $Z_{r}$ contains finitely many positive integers with no even representation, and so does $\mathbb{Z}_{>0}=\bigcup_{r=1}^{2 s} Z_{r}$. + +In view of Properties 1 and 3 , we may assume that $N$ is chosen such that every $n>N$ has exactly one odd and exactly one even representation. In particular, each element $s>N$ of $S$ has an even representation. +Property 4. For any $s, t \in S$ with $N N$. Then, Property 4 implies that for every $i>k$ the even representation of $s_{i}$ contains all the numbers $s_{k}, s_{k+1}, \ldots, s_{i-1}$. Therefore, + +$$ +s_{i}=s_{k}+s_{k+1}+\cdots+s_{i-1}+R_{i}=\sigma_{i-1}-\sigma_{k-1}+R_{i} +$$ + +where $R_{i}$ is a sum of some of $s_{1}, \ldots, s_{k-1}$. In particular, $0 \leqslant R_{i} \leqslant s_{1}+\cdots+s_{k-1}=\sigma_{k-1}$. + +Let $j_{0}$ be an integer satisfying $j_{0}>k$ and $\sigma_{j_{0}}>2 \sigma_{k-1}$. Then (1) shows that, for every $j>j_{0}$, + +$$ +s_{j+1} \geqslant \sigma_{j}-\sigma_{k-1}>\sigma_{j} / 2 . +$$ + +Next, let $p>j_{0}$ be an index such that $R_{p}=\min _{i>j_{0}} R_{i}$. Then, + +$$ +s_{p+1}=s_{k}+s_{k+1}+\cdots+s_{p}+R_{p+1}=\left(s_{p}-R_{p}\right)+s_{p}+R_{p+1} \geqslant 2 s_{p} +$$ + +Therefore, there is no element of $S$ larger than $s_{p}$ but smaller than $2 s_{p}$. It follows that the even representation $\tau$ of $2 s_{p}$ does not contain any element larger than $s_{p}$. On the other hand, inequality (2) yields $2 s_{p}>s_{1}+\cdots+s_{p-1}$, so $\tau$ must contain a term larger than $s_{p-1}$. Thus, it must contain $s_{p}$. After removing $s_{p}$ from $\tau$, we have that $s_{p}$ has an odd representation not containing $s_{p}$, which contradicts Property 1 since $s_{p}$ itself also forms an odd representation of $s_{p}$. + +Solution 2. We will also use Property 1 from Solution 1. +We first define some terminology and notations used in this solution. Let $\mathbb{Z}_{\geqslant 0}$ denote the set of all nonnegative integers. All sums mentioned are regarded as sums of distinct elements of $S$. Moreover, a sum is called even or odd depending on the parity of the number of terms in it. All closed or open intervals refer to sets of all integers inside them, e.g., $[a, b]=\{x \in \mathbb{Z}: a \leqslant x \leqslant b\}$. + +Again, let $s_{1}$ $2^{n-1}-1+n m \geqslant \sigma_{n}$ for every sufficiently large $n$. We now claim the following. + +Claim 1. $\left(\sigma_{n}-s_{n+1}, s_{n+2}-s_{n+1}\right) \subseteq E_{n}$ for every sufficiently large $n$. +Proof. For sufficiently large $n$, all elements of $\left(\sigma_{n}, s_{n+2}\right)$ are clean. Clearly, the elements of $\left(\sigma_{n}, s_{n+2}\right)$ can be in neither $O_{n}$ nor $O \backslash O_{n+1}$. So, $\left(\sigma_{n}, s_{n+2}\right) \subseteq O_{n+1} \backslash O_{n}=s_{n+1}+E_{n}$, which yields the claim. + +Now, Claim 1 together with inequalities (3) implies that, for all sufficiently large $n$, + +$$ +E \supseteq E_{n} \supseteq\left(\sigma_{n}-s_{n+1}, s_{n+2}-s_{n+1}\right) \supseteq\left(2 n m, 2^{n-1}-(n+2) m\right) . +$$ + +This easily yields that $\mathbb{Z}_{\geqslant 0} \backslash E$ is also finite. Since $\mathbb{Z}_{\geqslant 0} \backslash O$ is also finite, by Property 1 , there exists a positive integer $N$ such that every integer $n>N$ has exactly one even and one odd representation. + +Step 3. We investigate the structures of $E_{n}$ and $O_{n}$. +Suppose that $z \in E_{2 n}$. Since $z$ can be represented as an even sum using $\left\{s_{1}, s_{2}, \ldots, s_{2 n}\right\}$, so can its complement $\sigma_{2 n}-z$. Thus, we get $E_{2 n}=\sigma_{2 n}-E_{2 n}$. Similarly, we have + +$$ +E_{2 n}=\sigma_{2 n}-E_{2 n}, \quad O_{2 n}=\sigma_{2 n}-O_{2 n}, \quad E_{2 n+1}=\sigma_{2 n+1}-O_{2 n+1}, \quad O_{2 n+1}=\sigma_{2 n+1}-E_{2 n+1} +$$ + +Claim 2. For every sufficiently large $n$, we have + +$$ +\left[0, \sigma_{n}\right] \supseteq O_{n} \supseteq\left(N, \sigma_{n}-N\right) \quad \text { and } \quad\left[0, \sigma_{n}\right] \supseteq E_{n} \supseteq\left(N, \sigma_{n}-N\right) +$$ + +Proof. Clearly $O_{n}, E_{n} \subseteq\left[0, \sigma_{n}\right]$ for every positive integer $n$. We now prove $O_{n}, E_{n} \supseteq\left(N, \sigma_{n}-N\right)$. Taking $n$ sufficiently large, we may assume that $s_{n+1} \geqslant 2^{n-1}+1-n m>\frac{1}{2}\left(2^{n-1}-1+n m\right) \geqslant \sigma_{n} / 2$. Therefore, the odd representation of every element of ( $\left.N, \sigma_{n} / 2\right]$ cannot contain a term larger than $s_{n}$. Thus, $\left(N, \sigma_{n} / 2\right] \subseteq O_{n}$. Similarly, since $s_{n+1}+s_{1}>\sigma_{n} / 2$, we also have $\left(N, \sigma_{n} / 2\right] \subseteq E_{n}$. Equations (4) then yield that, for sufficiently large $n$, the interval $\left(N, \sigma_{n}-N\right)$ is a subset of both $O_{n}$ and $E_{n}$, as desired. + +Step 4. We obtain a final contradiction. +Notice that $0 \in \mathbb{Z}_{\geqslant 0} \backslash O$ and $1 \in \mathbb{Z}_{\geqslant 0} \backslash E$. Therefore, the sets $\mathbb{Z}_{\geqslant 0} \backslash O$ and $\mathbb{Z}_{\geqslant 0} \backslash E$ are nonempty. Denote $o=\max \left(\mathbb{Z}_{\geqslant 0} \backslash O\right)$ and $e=\max \left(\mathbb{Z}_{\geqslant 0} \backslash E\right)$. Observe also that $e, o \leqslant N$. + +Taking $k$ sufficiently large, we may assume that $\sigma_{2 k}>2 N$ and that Claim 2 holds for all $n \geqslant 2 k$. Due to (4) and Claim 2, we have that $\sigma_{2 k}-e$ is the minimal number greater than $N$ which is not in $E_{2 k}$, i.e., $\sigma_{2 k}-e=s_{2 k+1}+s_{1}$. Similarly, + +$$ +\sigma_{2 k}-o=s_{2 k+1}, \quad \sigma_{2 k+1}-e=s_{2 k+2}, \quad \text { and } \quad \sigma_{2 k+1}-o=s_{2 k+2}+s_{1} +$$ + +Therefore, we have + +$$ +\begin{aligned} +s_{1} & =\left(s_{2 k+1}+s_{1}\right)-s_{2 k+1}=\left(\sigma_{2 k}-e\right)-\left(\sigma_{2 k}-o\right)=o-e \\ +& =\left(\sigma_{2 k+1}-e\right)-\left(\sigma_{2 k+1}-o\right)=s_{2 k+2}-\left(s_{2 k+2}+s_{1}\right)=-s_{1} +\end{aligned} +$$ + +which is impossible since $s_{1}>0$. + +C7. In a company of people some pairs are enemies. A group of people is called unsociable if the number of members in the group is odd and at least 3, and it is possible to arrange all its members around a round table so that every two neighbors are enemies. Given that there are at most 2015 unsociable groups, prove that it is possible to partition the company into 11 parts so that no two enemies are in the same part. +(Russia) +Solution 1. Let $G=(V, E)$ be a graph where $V$ is the set of people in the company and $E$ is the set of the enemy pairs - the edges of the graph. In this language, partitioning into 11 disjoint enemy-free subsets means properly coloring the vertices of this graph with 11 colors. + +We will prove the following more general statement. +Claim. Let $G$ be a graph with chromatic number $k \geqslant 3$. Then $G$ contains at least $2^{k-1}-k$ unsociable groups. + +Recall that the chromatic number of $G$ is the least $k$ such that a proper coloring + +$$ +V=V_{1} \sqcup \cdots \sqcup V_{k} +$$ + +exists. In view of $2^{11}-12>2015$, the claim implies the problem statement. +Let $G$ be a graph with chromatic number $k$. We say that a proper coloring (1) of $G$ is leximinimal, if the $k$-tuple $\left(\left|V_{1}\right|,\left|V_{2}\right|, \ldots,\left|V_{k}\right|\right)$ is lexicographically minimal; in other words, the following conditions are satisfied: the number $n_{1}=\left|V_{1}\right|$ is minimal; the number $n_{2}=\left|V_{2}\right|$ is minimal, subject to the previously chosen value of $n_{1} ; \ldots$; the number $n_{k-1}=\left|V_{k-1}\right|$ is minimal, subject to the previously chosen values of $n_{1}, \ldots, n_{k-2}$. + +The following lemma is the core of the proof. +Lemma 1. Suppose that $G=(V, E)$ is a graph with odd chromatic number $k \geqslant 3$, and let (1) be one of its leximinimal colorings. Then $G$ contains an odd cycle which visits all color classes $V_{1}, V_{2}, \ldots, V_{k}$. +Proof of Lemma 1. Let us call a cycle colorful if it visits all color classes. +Due to the definition of the chromatic number, $V_{1}$ is nonempty. Choose an arbitrary vertex $v \in V_{1}$. We construct a colorful odd cycle that has only one vertex in $V_{1}$, and this vertex is $v$. + +We draw a subgraph of $G$ as follows. Place $v$ in the center, and arrange the sets $V_{2}, V_{3}, \ldots, V_{k}$ in counterclockwise circular order around it. For convenience, let $V_{k+1}=V_{2}$. We will draw arrows to add direction to some edges of $G$, and mark the vertices these arrows point to. First we draw arrows from $v$ to all its neighbors in $V_{2}$, and mark all those neighbors. If some vertex $u \in V_{i}$ with $i \in\{2,3, \ldots, k\}$ is already marked, we draw arrows from $u$ to all its neighbors in $V_{i+1}$ which are not marked yet, and we mark all of them. We proceed doing this as long as it is possible. The process of marking is exemplified in Figure 1. + +Notice that by the rules of our process, in the final state, marked vertices in $V_{i}$ cannot have unmarked neighbors in $V_{i+1}$. Moreover, $v$ is connected to all marked vertices by directed paths. + +Now move each marked vertex to the next color class in circular order (see an example in Figure 3). In view of the arguments above, the obtained coloring $V_{1} \sqcup W_{2} \sqcup \cdots \sqcup W_{k}$ is proper. Notice that $v$ has a neighbor $w \in W_{2}$, because otherwise + +$$ +\left(V_{1} \backslash\{v\}\right) \sqcup\left(W_{2} \cup\{v\}\right) \sqcup W_{3} \sqcup \cdots \sqcup W_{k} +$$ + +would be a proper coloring lexicographically smaller than (1). If $w$ was unmarked, i.e., $w$ was an element of $V_{2}$, then it would be marked at the beginning of the process and thus moved to $V_{3}$, which did not happen. Therefore, $w$ is marked and $w \in V_{k}$. + + +Figure 1 +Figure 2 +Since $w$ is marked, there exists a directed path from $v$ to $w$. This path moves through the sets $V_{2}, \ldots, V_{k}$ in circular order, so the number of edges in it is divisible by $k-1$ and thus even. Closing this path by the edge $w \rightarrow v$, we get a colorful odd cycle, as required. + +Proof of the claim. Let us choose a leximinimal coloring (1) of $G$. For every set $C \subseteq\{1,2, \ldots, k\}$ such that $|C|$ is odd and greater than 1 , we will provide an odd cycle visiting exactly those color classes whose indices are listed in the set $C$. This property ensures that we have different cycles for different choices of $C$, and it proves the claim because there are $2^{k-1}-k$ choices for the set $C$. + +Let $V_{C}=\bigcup_{c \in C} V_{c}$, and let $G_{C}$ be the induced subgraph of $G$ on the vertex set $V_{C}$. We also have the induced coloring of $V_{C}$ with $|C|$ colors; this coloring is of course proper. Notice further that the induced coloring is leximinimal: if we had a lexicographically smaller coloring $\left(W_{c}\right)_{c \in C}$ of $G_{C}$, then these classes, together the original color classes $V_{i}$ for $i \notin C$, would provide a proper coloring which is lexicographically smaller than (1). Hence Lemma 1, applied to the subgraph $G_{C}$ and its leximinimal coloring $\left(V_{c}\right)_{c \in C}$, provides an odd cycle that visits exactly those color classes that are listed in the set $C$. + +Solution 2. We provide a different proof of the claim from the previous solution. +We say that a graph is critical if deleting any vertex from the graph decreases the graph's chromatic number. Obviously every graph contains a critical induced subgraph with the same chromatic number. +Lemma 2. Suppose that $G=(V, E)$ is a critical graph with chromatic number $k \geqslant 3$. Then every vertex $v$ of $G$ is contained in at least $2^{k-2}-1$ unsociable groups. +Proof. For every set $X \subseteq V$, denote by $n(X)$ the number of neighbors of $v$ in the set $X$. +Since $G$ is critical, there exists a proper coloring of $G \backslash\{v\}$ with $k-1$ colors, so there exists a proper coloring $V=V_{1} \sqcup V_{2} \sqcup \cdots \sqcup V_{k}$ of $G$ such that $V_{1}=\{v\}$. Among such colorings, take one for which the sequence $\left(n\left(V_{2}\right), n\left(V_{3}\right), \ldots, n\left(V_{k}\right)\right)$ is lexicographically minimal. Clearly, $n\left(V_{i}\right)>0$ for every $i=2,3, \ldots, k$; otherwise $V_{2} \sqcup \ldots \sqcup V_{i-1} \sqcup\left(V_{i} \cup V_{1}\right) \sqcup V_{i+1} \sqcup \ldots V_{k}$ would be a proper coloring of $G$ with $k-1$ colors. + +We claim that for every $C \subseteq\{2,3, \ldots, k\}$ with $|C| \geqslant 2$ being even, $G$ contains an unsociable group so that the set of its members' colors is precisely $C \cup\{1\}$. Since the number of such sets $C$ is $2^{k-2}-1$, this proves the lemma. Denote the elements of $C$ by $c_{1}, \ldots, c_{2 \ell}$ in increasing order. For brevity, let $U_{i}=V_{c_{i}}$. Denote by $N_{i}$ the set of neighbors of $v$ in $U_{i}$. + +We show that for every $i=1, \ldots, 2 \ell-1$ and $x \in N_{i}$, the subgraph induced by $U_{i} \cup U_{i+1}$ contains a path that connects $x$ with another point in $N_{i+1}$. For the sake of contradiction, suppose that no such path exists. Let $S$ be the set of vertices that lie in the connected component of $x$ in the subgraph induced by $U_{i} \cup U_{i+1}$, and let $P=U_{i} \cap S$, and $Q=U_{i+1} \cap S$ (see Figure 3). Since $x$ is separated from $N_{i+1}$, the sets $Q$ and $N_{i+1}$ are disjoint. So, if we re-color $G$ by replacing $U_{i}$ and $U_{i+1}$ by $\left(U_{i} \cup Q\right) \backslash P$ and $\left(U_{i+1} \cup P\right) \backslash Q$, respectively, we obtain a proper coloring such that $n\left(U_{i}\right)=n\left(V_{c_{i}}\right)$ is decreased and only $n\left(U_{i+1}\right)=n\left(V_{c_{i+1}}\right)$ is increased. That contradicts the lexicographical minimality of $\left(n\left(V_{2}\right), n\left(V_{3}\right), \ldots, n\left(V_{k}\right)\right)$. + + +Figure 3 +Next, we build a path through $U_{1}, U_{2}, \ldots, U_{2 \ell}$ as follows. Let the starting point of the path be an arbitrary vertex $v_{1}$ in the set $N_{1}$. For $i \leqslant 2 \ell-1$, if the vertex $v_{i} \in N_{i}$ is already defined, connect $v_{i}$ to some vertex in $N_{i+1}$ in the subgraph induced by $U_{i} \cup U_{i+1}$, and add these edges to the path. Denote the new endpoint of the path by $v_{i+1}$; by the construction we have $v_{i+1} \in N_{i+1}$ again, so the process can be continued. At the end we have a path that starts at $v_{1} \in N_{1}$ and ends at some $v_{2 \ell} \in N_{2 \ell}$. Moreover, all edges in this path connect vertices in neighboring classes: if a vertex of the path lies in $U_{i}$, then the next vertex lies in $U_{i+1}$ or $U_{i-1}$. Notice that the path is not necessary simple, so take a minimal subpath of it. The minimal subpath is simple and connects the same endpoints $v_{1}$ and $v_{2 \ell}$. The property that every edge steps to a neighboring color class (i.e., from $U_{i}$ to $U_{i+1}$ or $U_{i-1}$ ) is preserved. So the resulting path also visits all of $U_{1}, \ldots, U_{2 \ell}$, and its length must be odd. Closing the path with the edges $v v_{1}$ and $v_{2 \ell} v$ we obtain the desired odd cycle (see Figure 4). + + +Figure 4 +Now we prove the claim by induction on $k \geqslant 3$. The base case $k=3$ holds by applying Lemma 2 to a critical subgraph. For the induction step, let $G_{0}$ be a critical $k$-chromatic subgraph of $G$, and let $v$ be an arbitrary vertex of $G_{0}$. By Lemma 2, $G_{0}$ has at least $2^{k-2}-1$ unsociable groups containing $v$. On the other hand, the graph $G_{0} \backslash\{v\}$ has chromatic number $k-1$, so it contains at least $2^{k-2}-(k-1)$ unsociable groups by the induction hypothesis. Altogether, this gives $2^{k-2}-1+2^{k-2}-(k-1)=2^{k-1}-k$ distinct unsociable groups in $G_{0}$ (and thus in $G$ ). + +Comment 1. The claim we proved is sharp. The complete graph with $k$ vertices has chromatic number $k$ and contains exactly $2^{k-1}-k$ unsociable groups. + +Comment 2. The proof of Lemma 2 works for odd values of $|C| \geqslant 3$ as well. Hence, the second solution shows the analogous statement that the number of even sized unsociable groups is at least $2^{k}-1-\binom{k}{2}$. + +## Geometry + +G1. Let $A B C$ be an acute triangle with orthocenter $H$. Let $G$ be the point such that the quadrilateral $A B G H$ is a parallelogram. Let $I$ be the point on the line $G H$ such that $A C$ bisects $H I$. Suppose that the line $A C$ intersects the circumcircle of the triangle $G C I$ at $C$ and $J$. Prove that $I J=A H$. +(Australia) +Solution 1. Since $H G \| A B$ and $B G \| A H$, we have $B G \perp B C$ and $C H \perp G H$. Therefore, the quadrilateral $B G C H$ is cyclic. Since $H$ is the orthocenter of the triangle $A B C$, we have $\angle H A C=90^{\circ}-\angle A C B=\angle C B H$. Using that $B G C H$ and $C G J I$ are cyclic quadrilaterals, we get + +$$ +\angle C J I=\angle C G H=\angle C B H=\angle H A C . +$$ + +Let $M$ be the intersection of $A C$ and $G H$, and let $D \neq A$ be the point on the line $A C$ such that $A H=H D$. Then $\angle M J I=\angle H A C=\angle M D H$. + +Since $\angle M J I=\angle M D H, \angle I M J=\angle H M D$, and $I M=M H$, the triangles $I M J$ and $H M D$ are congruent, and thus $I J=H D=A H$. + + +Comment. Instead of introducing the point $D$, one can complete the solution by using the law of sines in the triangles $I J M$ and $A M H$, yielding + +$$ +\frac{I J}{I M}=\frac{\sin \angle I M J}{\sin \angle M J I}=\frac{\sin \angle A M H}{\sin \angle H A M}=\frac{A H}{M H}=\frac{A H}{I M} . +$$ + +Solution 2. Obtain $\angle C G H=\angle H A C$ as in the previous solution. In the parallelogram $A B G H$ we have $\angle B A H=\angle H G B$. It follows that + +$$ +\angle H M C=\angle B A C=\angle B A H+\angle H A C=\angle H G B+\angle C G H=\angle C G B . +$$ + +So the right triangles $C M H$ and $C G B$ are similar. Also, in the circumcircle of triangle $G C I$ we have similar triangles $M I J$ and $M C G$. Therefore, + +$$ +\frac{I J}{C G}=\frac{M I}{M C}=\frac{M H}{M C}=\frac{G B}{G C}=\frac{A H}{C G} +$$ + +Hence $I J=A H$. + +G2. Let $A B C$ be a triangle inscribed into a circle $\Omega$ with center $O$. A circle $\Gamma$ with center $A$ meets the side $B C$ at points $D$ and $E$ such that $D$ lies between $B$ and $E$. Moreover, let $F$ and $G$ be the common points of $\Gamma$ and $\Omega$. We assume that $F$ lies on the arc $A B$ of $\Omega$ not containing $C$, and $G$ lies on the arc $A C$ of $\Omega$ not containing $B$. The circumcircles of the triangles $B D F$ and $C E G$ meet the sides $A B$ and $A C$ again at $K$ and $L$, respectively. Suppose that the lines $F K$ and $G L$ are distinct and intersect at $X$. Prove that the points $A, X$, and $O$ are collinear. +(Greece) +Solution 1. It suffices to prove that the lines $F K$ and $G L$ are symmetric about $A O$. Now the segments $A F$ and $A G$, being chords of $\Omega$ with the same length, are clearly symmetric with respect to $A O$. Hence it is enough to show + +$$ +\angle K F A=\angle A G L . +$$ + +Let us denote the circumcircles of $B D F$ and $C E G$ by $\omega_{B}$ and $\omega_{C}$, respectively. To prove (1), we start from + +$$ +\angle K F A=\angle D F G+\angle G F A-\angle D F K +$$ + +In view of the circles $\omega_{B}, \Gamma$, and $\Omega$, this may be rewritten as + +$$ +\angle K F A=\angle C E G+\angle G B A-\angle D B K=\angle C E G-\angle C B G . +$$ + +Due to the circles $\omega_{C}$ and $\Omega$, we obtain $\angle K F A=\angle C L G-\angle C A G=\angle A G L$. Thereby the problem is solved. + + +Figure 1 + +Solution 2. Again, we denote the circumcircle of $B D K F$ by $\omega_{B}$. In addition, we set $\alpha=$ $\angle B A C, \varphi=\angle A B F$, and $\psi=\angle E D A=\angle A E D$ (see Figure 2). Notice that $A F=A G$ entails $\varphi=\angle G C A$, so all three of $\alpha, \varphi$, and $\psi$ respect the "symmetry" between $B$ and $C$ of our configuration. Again, we reduce our task to proving (1). + +This time, we start from + +$$ +2 \angle K F A=2(\angle D F A-\angle D F K) . +$$ + +Since the triangle $A F D$ is isosceles, we have + +$$ +\angle D F A=\angle A D F=\angle E D F-\psi=\angle B F D+\angle E B F-\psi . +$$ + +Moreover, because of the circle $\omega_{B}$ we have $\angle D F K=\angle C B A$. Altogether, this yields + +$$ +2 \angle K F A=\angle D F A+(\angle B F D+\angle E B F-\psi)-2 \angle C B A, +$$ + +which simplifies to + +$$ +2 \angle K F A=\angle B F A+\varphi-\psi-\angle C B A . +$$ + +Now the quadrilateral $A F B C$ is cyclic, so this entails $2 \angle K F A=\alpha+\varphi-\psi$. +Due to the "symmetry" between $B$ and $C$ alluded to above, this argument also shows that $2 \angle A G L=\alpha+\varphi-\psi$. This concludes the proof of (1). + + +Figure 2 + +Comment 1. As the first solution shows, the assumption that $A$ be the center of $\Gamma$ may be weakened to the following one: The center of $\Gamma$ lies on the line $O A$. The second solution may be modified to yield the same result. + +Comment 2. It might be interesting to remark that $\angle G D K=90^{\circ}$. To prove this, let $G^{\prime}$ denote the point on $\Gamma$ diametrically opposite to $G$. Because of $\angle K D F=\angle K B F=\angle A G F=\angle G^{\prime} D F$, the points $D, K$, and $G^{\prime}$ are collinear, which leads to the desired result. Notice that due to symmetry we also have $\angle L E F=90^{\circ}$. + +Moreover, a standard argument shows that the triangles $A G L$ and $B G E$ are similar. By symmetry again, also the triangles $A F K$ and $C D F$ are similar. + +There are several ways to derive a solution from these facts. For instance, one may argue that + +$$ +\begin{aligned} +\angle K F A & =\angle B F A-\angle B F K=\angle B F A-\angle E D G^{\prime}=\left(180^{\circ}-\angle A G B\right)-\left(180^{\circ}-\angle G^{\prime} G E\right) \\ +& =\angle A G E-\angle A G B=\angle B G E=\angle A G L . +\end{aligned} +$$ + +Comment 3. The original proposal did not contain the point $X$ in the assumption and asked instead to prove that the lines $F K, G L$, and $A O$ are concurrent. This differs from the version given above only insofar as it also requires to show that these lines cannot be parallel. The Problem Selection Committee removed this part from the problem intending to make it thus more suitable for the Olympiad. + +For the sake of completeness, we would still like to sketch one possibility for proving $F K \nVdash A O$ here. As the points $K$ and $O$ lie in the angular region $\angle F A G$, it suffices to check $\angle K F A+\angle F A O<180^{\circ}$. Multiplying by 2 and making use of the formulae from the second solution, we see that this is equivalent to $(\alpha+\varphi-\psi)+\left(180^{\circ}-2 \varphi\right)<360^{\circ}$, which in turn is an easy consequence of $\alpha<180^{\circ}$. + +G3. Let $A B C$ be a triangle with $\angle C=90^{\circ}$, and let $H$ be the foot of the altitude from $C$. A point $D$ is chosen inside the triangle $C B H$ so that $C H$ bisects $A D$. Let $P$ be the intersection point of the lines $B D$ and $C H$. Let $\omega$ be the semicircle with diameter $B D$ that meets the segment $C B$ at an interior point. A line through $P$ is tangent to $\omega$ at $Q$. Prove that the lines $C Q$ and $A D$ meet on $\omega$. +(Georgia) +Solution 1. Let $K$ be the projection of $D$ onto $A B$; then $A H=H K$ (see Figure 1). Since $P H \| D K$, we have + +$$ +\frac{P D}{P B}=\frac{H K}{H B}=\frac{A H}{H B} +$$ + +Let $L$ be the projection of $Q$ onto $D B$. Since $P Q$ is tangent to $\omega$ and $\angle D Q B=\angle B L Q=$ $90^{\circ}$, we have $\angle P Q D=\angle Q B P=\angle D Q L$. Therefore, $Q D$ and $Q B$ are respectively the internal and the external bisectors of $\angle P Q L$. By the angle bisector theorem, we obtain + +$$ +\frac{P D}{D L}=\frac{P Q}{Q L}=\frac{P B}{B L} +$$ + +The relations (1) and (2) yield $\frac{A H}{H B}=\frac{P D}{P B}=\frac{D L}{L B}$. So, the spiral similarity $\tau$ centered at $B$ and sending $A$ to $D$ maps $H$ to $L$. Moreover, $\tau$ sends the semicircle with diameter $A B$ passing through $C$ to $\omega$. Due to $C H \perp A B$ and $Q L \perp D B$, it follows that $\tau(C)=Q$. + +Hence, the triangles $A B D$ and $C B Q$ are similar, so $\angle A D B=\angle C Q B$. This means that the lines $A D$ and $C Q$ meet at some point $T$, and this point satisfies $\angle B D T=\angle B Q T$. Therefore, $T$ lies on $\omega$, as needed. + + +Figure 1 + + +Figure 2 + +Comment 1. Since $\angle B A D=\angle B C Q$, the point $T$ lies also on the circumcircle of the triangle $A B C$. +Solution 2. Let $\Gamma$ be the circumcircle of $A B C$, and let $A D$ meet $\omega$ at $T$. Then $\angle A T B=$ $\angle A C B=90^{\circ}$, so $T$ lies on $\Gamma$ as well. As in the previous solution, let $K$ be the projection of $D$ onto $A B$; then $A H=H K$ (see Figure 2). + +Our goal now is to prove that the points $C, Q$, and $T$ are collinear. Let $C T$ meet $\omega$ again at $Q^{\prime}$. Then, it suffices to show that $P Q^{\prime}$ is tangent to $\omega$, or that $\angle P Q^{\prime} D=\angle Q^{\prime} B D$. + +Since the quadrilateral $B D Q^{\prime} T$ is cyclic and the triangles $A H C$ and $K H C$ are congruent, we have $\angle Q^{\prime} B D=\angle Q^{\prime} T D=\angle C T A=\angle C B A=\angle A C H=\angle H C K$. Hence, the right triangles $C H K$ and $B Q^{\prime} D$ are similar. This implies that $\frac{H K}{C K}=\frac{Q^{\prime} D}{B D}$, and thus $H K \cdot B D=C K \cdot Q^{\prime} D$. + +Notice that $P H \| D K$; therefore, we have $\frac{P D}{B D}=\frac{H K}{B K}$, and so $P D \cdot B K=H K \cdot B D$. Consequently, $P D \cdot B K=H K \cdot B D=C K \cdot Q^{\prime} D$, which yields $\frac{P D}{Q^{\prime} D}=\frac{C K}{B K}$. + +Since $\angle C K A=\angle K A C=\angle B D Q^{\prime}$, the triangles $C K B$ and $P D Q^{\prime}$ are similar, so $\angle P Q^{\prime} D=$ $\angle C B A=\angle Q^{\prime} B D$, as required. + +Comment 2. There exist several other ways to prove that $P Q^{\prime}$ is tangent to $\omega$. For instance, one may compute $\frac{P D}{P B}$ and $\frac{P Q^{\prime}}{P B}$ in terms of $A H$ and $H B$ to verify that $P Q^{\prime 2}=P D \cdot P B$, concluding that $P Q^{\prime}$ is tangent to $\omega$. + +Another possible approach is the following. As in Solution 2, we introduce the points $T$ and $Q^{\prime}$ and mention that the triangles $A B C$ and $D B Q^{\prime}$ are similar (see Figure 3). + +Let $M$ be the midpoint of $A D$, and let $L$ be the projection of $Q^{\prime}$ onto $A B$. Construct $E$ on the line $A B$ so that $E P$ is parallel to $A D$. Projecting from $P$, we get $(A, B ; H, E)=(A, D ; M, \infty)=-1$. Since $\frac{E A}{A B}=\frac{P D}{D B}$, the point $P$ is the image of $E$ under the similarity transform mapping $A B C$ to $D B Q^{\prime}$. Therefore, we have $(D, B ; L, P)=(A, B ; H, E)=-1$, which means that $Q^{\prime} D$ and $Q^{\prime} B$ are respectively the internal and the external bisectors of $\angle P Q^{\prime} L$. This implies that $P Q^{\prime}$ is tangent to $\omega$, as required. + + +Figure 3 + +Solution 3. Introduce the points $T$ and $Q^{\prime}$ as in the previous solution. Note that $T$ lies on the circumcircle of $A B C$. Here we present yet another proof that $P Q^{\prime}$ is tangent to $\omega$. + +Let $\Omega$ be the circle completing the semicircle $\omega$. Construct a point $F$ symmetric to $C$ with respect to $A B$. Let $S \neq T$ be the second intersection point of $F T$ and $\Omega$ (see Figure 4). + + +Figure 4 +Since $A C=A F$, we have $\angle D K C=\angle H C K=\angle C B A=\angle C T A=\angle D T S=180^{\circ}-$ $\angle S K D$. Thus, the points $C, K$, and $S$ are collinear. Notice also that $\angle Q^{\prime} K D=\angle Q^{\prime} T D=$ $\angle H C K=\angle K F H=180^{\circ}-\angle D K F$. This implies that the points $F, K$, and $Q^{\prime}$ are collinear. + +Applying PASCAL's theorem to the degenerate hexagon $K Q^{\prime} Q^{\prime} T S S$, we get that the tangents to $\Omega$ passing through $Q^{\prime}$ and $S$ intersect on $C F$. The relation $\angle Q^{\prime} T D=\angle D T S$ yields that $Q^{\prime}$ and $S$ are symmetric with respect to $B D$. Therefore, the two tangents also intersect on $B D$. Thus, the two tangents pass through $P$. Hence, $P Q^{\prime}$ is tangent to $\omega$, as needed. + +G4. Let $A B C$ be an acute triangle, and let $M$ be the midpoint of $A C$. A circle $\omega$ passing through $B$ and $M$ meets the sides $A B$ and $B C$ again at $P$ and $Q$, respectively. Let $T$ be the point such that the quadrilateral $B P T Q$ is a parallelogram. Suppose that $T$ lies on the circumcircle of the triangle $A B C$. Determine all possible values of $B T / B M$. +(Russia) +Answer. $\sqrt{2}$. +Solution 1. Let $S$ be the center of the parallelogram $B P T Q$, and let $B^{\prime} \neq B$ be the point on the ray $B M$ such that $B M=M B^{\prime}$ (see Figure 1). It follows that $A B C B^{\prime}$ is a parallelogram. Then, $\angle A B B^{\prime}=\angle P Q M$ and $\angle B B^{\prime} A=\angle B^{\prime} B C=\angle M P Q$, and so the triangles $A B B^{\prime}$ and $M Q P$ are similar. It follows that $A M$ and $M S$ are corresponding medians in these triangles. Hence, + +$$ +\angle S M P=\angle B^{\prime} A M=\angle B C A=\angle B T A . +$$ + +Since $\angle A C T=\angle P B T$ and $\angle T A C=\angle T B C=\angle B T P$, the triangles $T C A$ and $P B T$ are similar. Again, as $T M$ and $P S$ are corresponding medians in these triangles, we have + +$$ +\angle M T A=\angle T P S=\angle B Q P=\angle B M P . +$$ + +Now we deal separately with two cases. +Case 1. $\quad S$ does not lie on $B M$. Since the configuration is symmetric between $A$ and $C$, we may assume that $S$ and $A$ lie on the same side with respect to the line $B M$. + +Applying (1) and (2), we get + +$$ +\angle B M S=\angle B M P-\angle S M P=\angle M T A-\angle B T A=\angle M T B, +$$ + +and so the triangles $B S M$ and $B M T$ are similar. We now have $B M^{2}=B S \cdot B T=B T^{2} / 2$, so $B T=\sqrt{2} B M$. +Case 2. $\quad S$ lies on $B M$. It follows from (2) that $\angle B C A=\angle M T A=\angle B Q P=\angle B M P$ (see Figure 2). Thus, $P Q \| A C$ and $P M \| A T$. Hence, $B S / B M=B P / B A=B M / B T$, so $B T^{2}=2 B M^{2}$ and $B T=\sqrt{2} B M$. + + +Figure 1 + + +Figure 2 + +Comment 1. Here is another way to show that the triangles $B S M$ and $B M T$ are similar. Denote by $\Omega$ the circumcircle of the triangle $A B C$. Let $R$ be the second point of intersection of $\omega$ and $\Omega$, and let $\tau$ be the spiral similarity centered at $R$ mapping $\omega$ to $\Omega$. Then, one may show that $\tau$ maps each point $X$ on $\omega$ to a point $Y$ on $\Omega$ such that $B, X$, and $Y$ are collinear (see Figure 3). If we let $K$ and $L$ be the second points of intersection of $B M$ with $\Omega$ and of $B T$ with $\omega$, respectively, then it follows that the triangle $M K T$ is the image of $S M L$ under $\tau$. We now obtain $\angle B S M=\angle T M B$, which implies the desired result. + + +Figure 3 + + +Figure 4 + +Solution 2. Again, we denote by $\Omega$ the circumcircle of the triangle $A B C$. +Choose the points $X$ and $Y$ on the rays $B A$ and $B C$ respectively, so that $\angle M X B=\angle M B C$ and $\angle B Y M=\angle A B M$ (see Figure 4). Then the triangles $B M X$ and $Y M B$ are similar. Since $\angle X P M=\angle B Q M$, the points $P$ and $Q$ correspond to each other in these triangles. So, if $\overrightarrow{B P}=\mu \cdot \overrightarrow{B X}$, then $\overrightarrow{B Q}=(1-\mu) \cdot \overrightarrow{B Y}$. Thus + +$$ +\overrightarrow{B T}=\overrightarrow{B P}+\overrightarrow{B Q}=\overrightarrow{B Y}+\mu \cdot(\overrightarrow{B X}-\overrightarrow{B Y})=\overrightarrow{B Y}+\mu \cdot \overrightarrow{Y X} +$$ + +which means that $T$ lies on the line $X Y$. +Let $B^{\prime} \neq B$ be the point on the ray $B M$ such that $B M=M B^{\prime}$. Then $\angle M B^{\prime} A=$ $\angle M B C=\angle M X B$ and $\angle C B^{\prime} M=\angle A B M=\angle B Y M$. This means that the triangles $B M X$, $B A B^{\prime}, Y M B$, and $B^{\prime} C B$ are all similar; hence $B A \cdot B X=B M \cdot B B^{\prime}=B C \cdot B Y$. Thus there exists an inversion centered at $B$ which swaps $A$ with $X, M$ with $B^{\prime}$, and $C$ with $Y$. This inversion then swaps $\Omega$ with the line $X Y$, and hence it preserves $T$. Therefore, we have $B T^{2}=B M \cdot B B^{\prime}=2 B M^{2}$, and $B T=\sqrt{2} B M$. + +Solution 3. We begin with the following lemma. +Lemma. Let $A B C T$ be a cyclic quadrilateral. Let $P$ and $Q$ be points on the sides $B A$ and $B C$ respectively, such that $B P T Q$ is a parallelogram. Then $B P \cdot B A+B Q \cdot B C=B T^{2}$. +Proof. Let the circumcircle of the triangle $Q T C$ meet the line $B T$ again at $J$ (see Figure 5). The power of $B$ with respect to this circle yields + +$$ +B Q \cdot B C=B J \cdot B T +$$ + +We also have $\angle T J Q=180^{\circ}-\angle Q C T=\angle T A B$ and $\angle Q T J=\angle A B T$, and so the triangles $T J Q$ and $B A T$ are similar. We now have $T J / T Q=B A / B T$. Therefore, + +$$ +T J \cdot B T=T Q \cdot B A=B P \cdot B A +$$ + +Combining (3) and (4) now yields the desired result. +Let $X$ and $Y$ be the midpoints of $B A$ and $B C$ respectively (see Figure 6). Applying the lemma to the cyclic quadrilaterals $P B Q M$ and $A B C T$, we obtain + +$$ +B X \cdot B P+B Y \cdot B Q=B M^{2} +$$ + +and + +$$ +B P \cdot B A+B Q \cdot B C=B T^{2} +$$ + +Since $B A=2 B X$ and $B C=2 B Y$, we have $B T^{2}=2 B M^{2}$, and so $B T=\sqrt{2} B M$. + + +Comment 2. Here we give another proof of the lemma using Ptolemy's theorem. We readily have + +$$ +T C \cdot B A+T A \cdot B C=A C \cdot B T +$$ + +The lemma now follows from + +$$ +\frac{B P}{T C}=\frac{B Q}{T A}=\frac{B T}{A C}=\frac{\sin \angle B C T}{\sin \angle A B C} +$$ + +G5. Let $A B C$ be a triangle with $C A \neq C B$. Let $D, F$, and $G$ be the midpoints of the sides $A B, A C$, and $B C$, respectively. A circle $\Gamma$ passing through $C$ and tangent to $A B$ at $D$ meets the segments $A F$ and $B G$ at $H$ and $I$, respectively. The points $H^{\prime}$ and $I^{\prime}$ are symmetric to $H$ and $I$ about $F$ and $G$, respectively. The line $H^{\prime} I^{\prime}$ meets $C D$ and $F G$ at $Q$ and $M$, respectively. The line $C M$ meets $\Gamma$ again at $P$. Prove that $C Q=Q P$. +(El Salvador) +Solution 1. We may assume that $C A>C B$. Observe that $H^{\prime}$ and $I^{\prime}$ lie inside the segments $C F$ and $C G$, respectively. Therefore, $M$ lies outside $\triangle A B C$ (see Figure 1). + +Due to the powers of points $A$ and $B$ with respect to the circle $\Gamma$, we have + +$$ +C H^{\prime} \cdot C A=A H \cdot A C=A D^{2}=B D^{2}=B I \cdot B C=C I^{\prime} \cdot C B +$$ + +Therefore, $C H^{\prime} \cdot C F=C I^{\prime} \cdot C G$. Hence, the quadrilateral $H^{\prime} I^{\prime} G F$ is cyclic, and so $\angle I^{\prime} H^{\prime} C=$ $\angle C G F$. + +Let $D F$ and $D G$ meet $\Gamma$ again at $R$ and $S$, respectively. We claim that the points $R$ and $S$ lie on the line $H^{\prime} I^{\prime}$. + +Observe that $F H^{\prime} \cdot F A=F H \cdot F C=F R \cdot F D$. Thus, the quadrilateral $A D H^{\prime} R$ is cyclic, and hence $\angle R H^{\prime} F=\angle F D A=\angle C G F=\angle I^{\prime} H^{\prime} C$. Therefore, the points $R, H^{\prime}$, and $I^{\prime}$ are collinear. Similarly, the points $S, H^{\prime}$, and $I^{\prime}$ are also collinear, and so all the points $R, H^{\prime}, Q, I^{\prime}, S$, and $M$ are all collinear. + + +Figure 1 + + +Figure 2 + +Then, $\angle R S D=\angle R D A=\angle D F G$. Hence, the quadrilateral $R S G F$ is cyclic (see Figure 2). Therefore, $M H^{\prime} \cdot M I^{\prime}=M F \cdot M G=M R \cdot M S=M P \cdot M C$. Thus, the quadrilateral $C P I^{\prime} H^{\prime}$ is also cyclic. Let $\omega$ be its circumcircle. + +Notice that $\angle H^{\prime} C Q=\angle S D C=\angle S R C$ and $\angle Q C I^{\prime}=\angle C D R=\angle C S R$. Hence, $\triangle C H^{\prime} Q \sim \triangle R C Q$ and $\triangle C I^{\prime} Q \sim \triangle S C Q$, and therefore $Q H^{\prime} \cdot Q R=Q C^{2}=Q I^{\prime} \cdot Q S$. + +We apply the inversion with center $Q$ and radius $Q C$. Observe that the points $R, C$, and $S$ are mapped to $H^{\prime}, C$, and $I^{\prime}$, respectively. Therefore, the circumcircle $\Gamma$ of $\triangle R C S$ is mapped to the circumcircle $\omega$ of $\triangle H^{\prime} C I^{\prime}$. Since $P$ and $C$ belong to both circles and the point $C$ is preserved by the inversion, we have that $P$ is also mapped to itself. We then get $Q P^{2}=Q C^{2}$. Hence, $Q P=Q C$. + +Comment 1. The problem statement still holds when $\Gamma$ intersects the sides $C A$ and $C B$ outside segments $A F$ and $B G$, respectively. + +Solution 2. Let $X=H I \cap A B$, and let the tangent to $\Gamma$ at $C$ meet $A B$ at $Y$. Let $X C$ meet $\Gamma$ again at $X^{\prime}$ (see Figure 3). Projecting from $C, X$, and $C$ again, we have $(X, A ; D, B)=$ $\left(X^{\prime}, H ; D, I\right)=(C, I ; D, H)=(Y, B ; D, A)$. Since $A$ and $B$ are symmetric about $D$, it follows that $X$ and $Y$ are also symmetric about $D$. + +Now, Menelaus' theorem applied to $\triangle A B C$ with the line $H I X$ yields + +$$ +1=\frac{C H}{H A} \cdot \frac{B I}{I C} \cdot \frac{A X}{X B}=\frac{A H^{\prime}}{H^{\prime} C} \cdot \frac{C I^{\prime}}{I^{\prime} B} \cdot \frac{B Y}{Y A} . +$$ + +By the converse of Menelaus' theorem applied to $\triangle A B C$ with points $H^{\prime}, I^{\prime}, Y$, we get that the points $H^{\prime}, I^{\prime}, Y$ are collinear. + + +Figure 3 +Let $T$ be the midpoint of $C D$, and let $O$ be the center of $\Gamma$. Let $C M$ meet $T Y$ at $N$. To avoid confusion, we clean some superfluous details out of the picture (see Figure 4). + +Let $V=M T \cap C Y$. Since $M T \| Y D$ and $D T=T C$, we get $C V=V Y$. Then CevA's theorem applied to $\triangle C T Y$ with the point $M$ yields + +$$ +1=\frac{T Q}{Q C} \cdot \frac{C V}{V Y} \cdot \frac{Y N}{N T}=\frac{T Q}{Q C} \cdot \frac{Y N}{N T} +$$ + +Therefore, $\frac{T Q}{Q C}=\frac{T N}{N Y}$. So, $N Q \| C Y$, and thus $N Q \perp O C$. +Note that the points $O, N, T$, and $Y$ are collinear. Therefore, $C Q \perp O N$. So, $Q$ is the orthocenter of $\triangle O C N$, and hence $O Q \perp C P$. Thus, $Q$ lies on the perpendicular bisector of $C P$, and therefore $C Q=Q P$, as required. + + +Figure 4 + +Comment 2. The second part of Solution 2 provides a proof of the following more general statement, which does not involve a specific choice of $Q$ on $C D$. + +Let $Y C$ and $Y D$ be two tangents to a circle $\Gamma$ with center $O$ (see Figure 4). Let $\ell$ be the midline of $\triangle Y C D$ parallel to $Y D$. Let $Q$ and $M$ be two points on $C D$ and $\ell$, respectively, such that the line $Q M$ passes through $Y$. Then $O Q \perp C M$. + +G6. Let $A B C$ be an acute triangle with $A B>A C$, and let $\Gamma$ be its circumcircle. Let $H$, $M$, and $F$ be the orthocenter of the triangle, the midpoint of $B C$, and the foot of the altitude from $A$, respectively. Let $Q$ and $K$ be the two points on $\Gamma$ that satisfy $\angle A Q H=90^{\circ}$ and $\angle Q K H=90^{\circ}$. Prove that the circumcircles of the triangles $K Q H$ and $K F M$ are tangent to each other. +(Ukraine) +Solution 1. Let $A^{\prime}$ be the point diametrically opposite to $A$ on $\Gamma$. Since $\angle A Q A^{\prime}=90^{\circ}$ and $\angle A Q H=90^{\circ}$, the points $Q, H$, and $A^{\prime}$ are collinear. Similarly, if $Q^{\prime}$ denotes the point on $\Gamma$ diametrically opposite to $Q$, then $K, H$, and $Q^{\prime}$ are collinear. Let the line $A H F$ intersect $\Gamma$ again at $E$; it is known that $M$ is the midpoint of the segment $H A^{\prime}$ and that $F$ is the midpoint of $H E$. Let $J$ be the midpoint of $H Q^{\prime}$. + +Consider any point $T$ such that $T K$ is tangent to the circle $K Q H$ at $K$ with $Q$ and $T$ lying on different sides of $K H$ (see Figure 1). Then $\angle H K T=\angle H Q K$ and we are to prove that $\angle M K T=\angle C F K$. Thus it remains to show that $\angle H Q K=\angle C F K+\angle H K M$. Due to $\angle H Q K=90^{\circ}-\angle Q^{\prime} H A^{\prime}$ and $\angle C F K=90^{\circ}-\angle K F A$, this means the same as $\angle Q^{\prime} H A^{\prime}=$ $\angle K F A-\angle H K M$. Now, since the triangles $K H E$ and $A H Q^{\prime}$ are similar with $F$ and $J$ being the midpoints of corresponding sides, we have $\angle K F A=\angle H J A$, and analogously one may obtain $\angle H K M=\angle J Q H$. Thereby our task is reduced to verifying + +$$ +\angle Q^{\prime} H A^{\prime}=\angle H J A-\angle J Q H +$$ + + + +Figure 1 + + +Figure 2 + +To avoid confusion, let us draw a new picture at this moment (see Figure 2). Owing to $\angle Q^{\prime} H A^{\prime}=\angle J Q H+\angle H J Q$ and $\angle H J A=\angle Q J A+\angle H J Q$, we just have to show that $2 \angle J Q H=\angle Q J A$. To this end, it suffices to remark that $A Q A^{\prime} Q^{\prime}$ is a rectangle and that $J$, being defined to be the midpoint of $H Q^{\prime}$, has to lie on the mid parallel of $Q A^{\prime}$ and $Q^{\prime} A$. + +Solution 2. We define the points $A^{\prime}$ and $E$ and prove that the ray $M H$ passes through $Q$ in the same way as in the first solution. Notice that the points $A^{\prime}$ and $E$ can play analogous roles to the points $Q$ and $K$, respectively: point $A^{\prime}$ is the second intersection of the line $M H$ with $\Gamma$, and $E$ is the point on $\Gamma$ with the property $\angle H E A^{\prime}=90^{\circ}$ (see Figure 3). + +In the circles $K Q H$ and $E A^{\prime} H$, the line segments $H Q$ and $H A^{\prime}$ are diameters, respectively; so, these circles have a common tangent $t$ at $H$, perpendicular to $M H$. Let $R$ be the radical center of the circles $A B C, K Q H$ and $E A^{\prime} H$. Their pairwise radical axes are the lines $Q K$, $A^{\prime} E$ and the line $t$; they all pass through $R$. Let $S$ be the midpoint of $H R$; by $\angle Q K H=$ + + +Figure 3 +$\angle H E A^{\prime}=90^{\circ}$, the quadrilateral $H E R K$ is cyclic and its circumcenter is $S$; hence we have $S K=S E=S H$. The line $B C$, being the perpendicular bisector of $H E$, passes through $S$. + +The circle $H M F$ also is tangent to $t$ at $H$; from the power of $S$ with respect to the circle $H M F$ we have + +$$ +S M \cdot S F=S H^{2}=S K^{2} +$$ + +So, the power of $S$ with respect to the circles $K Q H$ and $K F M$ is $S K^{2}$. Therefore, the line segment $S K$ is tangent to both circles at $K$. + +G7. Let $A B C D$ be a convex quadrilateral, and let $P, Q, R$, and $S$ be points on the sides $A B, B C, C D$, and $D A$, respectively. Let the line segments $P R$ and $Q S$ meet at $O$. Suppose that each of the quadrilaterals $A P O S, B Q O P, C R O Q$, and $D S O R$ has an incircle. Prove that the lines $A C, P Q$, and $R S$ are either concurrent or parallel to each other. +(Bulgaria) +Solution 1. Denote by $\gamma_{A}, \gamma_{B}, \gamma_{C}$, and $\gamma_{D}$ the incircles of the quadrilaterals $A P O S, B Q O P$, $C R O Q$, and $D S O R$, respectively. + +We start with proving that the quadrilateral $A B C D$ also has an incircle which will be referred to as $\Omega$. Denote the points of tangency as in Figure 1. It is well-known that $Q Q_{1}=O O_{1}$ (if $B C \| P R$, this is obvious; otherwise, one may regard the two circles involved as the incircle and an excircle of the triangle formed by the lines $O Q, P R$, and $B C$ ). Similarly, $O O_{1}=P P_{1}$. Hence we have $Q Q_{1}=P P_{1}$. The other equalities of segment lengths marked in Figure 1 can be proved analogously. These equalities, together with $A P_{1}=A S_{1}$ and similar ones, yield $A B+C D=A D+B C$, as required. + + +Figure 1 + +Next, let us draw the lines parallel to $Q S$ through $P$ and $R$, and also draw the lines parallel to $P R$ through $Q$ and $S$. These lines form a parallelogram; denote its vertices by $A^{\prime}, B^{\prime}, C^{\prime}$, and $D^{\prime}$ as shown in Figure 2. + +Since the quadrilateral $A P O S$ has an incircle, we have $A P-A S=O P-O S=A^{\prime} S-A^{\prime} P$. It is well-known that in this case there also exists a circle $\omega_{A}$ tangent to the four rays $A P$, $A S, A^{\prime} P$, and $A^{\prime} S$. It is worth mentioning here that in case when, say, the lines $A B$ and $A^{\prime} B^{\prime}$ coincide, the circle $\omega_{A}$ is just tangent to $A B$ at $P$. We introduce the circles $\omega_{B}, \omega_{C}$, and $\omega_{D}$ in a similar manner. + +Assume that the radii of the circles $\omega_{A}$ and $\omega_{C}$ are different. Let $X$ be the center of the homothety having a positive scale factor and mapping $\omega_{A}$ to $\omega_{C}$. + +Now, Monge's theorem applied to the circles $\omega_{A}, \Omega$, and $\omega_{C}$ shows that the points $A, C$, and $X$ are collinear. Applying the same theorem to the circles $\omega_{A}, \omega_{B}$, and $\omega_{C}$, we see that the points $P, Q$, and $X$ are also collinear. Similarly, the points $R, S$, and $X$ are collinear, as required. + +If the radii of $\omega_{A}$ and $\omega_{C}$ are equal but these circles do not coincide, then the degenerate version of the same theorem yields that the three lines $A C, P Q$, and $R S$ are parallel to the line of centers of $\omega_{A}$ and $\omega_{C}$. + +Finally, we need to say a few words about the case when $\omega_{A}$ and $\omega_{C}$ coincide (and thus they also coincide with $\Omega, \omega_{B}$, and $\omega_{D}$ ). It may be regarded as the limit case in the following manner. + + +Figure 2 + +Let us fix the positions of $A, P, O$, and $S$ (thus we also fix the circles $\omega_{A}, \gamma_{A}, \gamma_{B}$, and $\gamma_{D}$ ). Now we vary the circle $\gamma_{C}$ inscribed into $\angle Q O R$; for each of its positions, one may reconstruct the lines $B C$ and $C D$ as the external common tangents to $\gamma_{B}, \gamma_{C}$ and $\gamma_{C}, \gamma_{D}$ different from $P R$ and $Q S$, respectively. After such variation, the circle $\Omega$ changes, so the result obtained above may be applied. + +Solution 2. Applying Menelaus' theorem to $\triangle A B C$ with the line $P Q$ and to $\triangle A C D$ with the line $R S$, we see that the line $A C$ meets $P Q$ and $R S$ at the same point (possibly at infinity) if and only if + +$$ +\frac{A P}{P B} \cdot \frac{B Q}{Q C} \cdot \frac{C R}{R D} \cdot \frac{D S}{S A}=1 +$$ + +So, it suffices to prove (1). +We start with the following result. +Lemma 1. Let $E F G H$ be a circumscribed quadrilateral, and let $M$ be its incenter. Then + +$$ +\frac{E F \cdot F G}{G H \cdot H E}=\frac{F M^{2}}{H M^{2}} +$$ + +Proof. Notice that $\angle E M H+\angle G M F=\angle F M E+\angle H M G=180^{\circ}, \angle F G M=\angle M G H$, and $\angle H E M=\angle M E F$ (see Figure 3). By the law of sines, we get + +$$ +\frac{E F}{F M} \cdot \frac{F G}{F M}=\frac{\sin \angle F M E \cdot \sin \angle G M F}{\sin \angle M E F \cdot \sin \angle F G M}=\frac{\sin \angle H M G \cdot \sin \angle E M H}{\sin \angle M G H \cdot \sin \angle H E M}=\frac{G H}{H M} \cdot \frac{H E}{H M} . +$$ + + + +Figure 3 + + +Figure 4 + +We denote by $I, J, K$, and $L$ the incenters of the quadrilaterals $A P O S, B Q O P, C R O Q$, and $D S O R$, respectively. Applying Lemma 1 to these four quadrilaterals we get + +$$ +\frac{A P \cdot P O}{O S \cdot S A} \cdot \frac{B Q \cdot Q O}{O P \cdot P B} \cdot \frac{C R \cdot R O}{O Q \cdot Q C} \cdot \frac{D S \cdot S O}{O R \cdot R D}=\frac{P I^{2}}{S I^{2}} \cdot \frac{Q J^{2}}{P J^{2}} \cdot \frac{R K^{2}}{Q K^{2}} \cdot \frac{S L^{2}}{R L^{2}} +$$ + +which reduces to + +$$ +\frac{A P}{P B} \cdot \frac{B Q}{Q C} \cdot \frac{C R}{R D} \cdot \frac{D S}{S A}=\frac{P I^{2}}{P J^{2}} \cdot \frac{Q J^{2}}{Q K^{2}} \cdot \frac{R K^{2}}{R L^{2}} \cdot \frac{S L^{2}}{S I^{2}} +$$ + +Next, we have $\angle I P J=\angle J O I=90^{\circ}$, and the line $O P$ separates $I$ and $J$ (see Figure 4). This means that the quadrilateral $I P J O$ is cyclic. Similarly, we get that the quadrilateral $J Q K O$ is cyclic with $\angle J Q K=90^{\circ}$. Thus, $\angle Q K J=\angle Q O J=\angle J O P=\angle J I P$. Hence, the right triangles $I P J$ and $K Q J$ are similar. Therefore, $\frac{P I}{P J}=\frac{Q K}{Q J}$. Likewise, we obtain $\frac{R K}{R L}=\frac{S I}{S L}$. These two equations together with (2) yield (1). +Comment. Instead of using the sine law, one may prove Lemma 1 by the following approach. + + +Figure 5 +Let $N$ be the point such that $\triangle N H G \sim \triangle M E F$ and such that $N$ and $M$ lie on different sides of the line $G H$, as shown in Figure 5. Then $\angle G N H+\angle H M G=\angle F M E+\angle H M G=180^{\circ}$. So, +the quadrilateral $G N H M$ is cyclic. Thus, $\angle M N H=\angle M G H=\angle F G M$ and $\angle H M N=\angle H G N=$ $\angle E F M=\angle M F G$. Hence, $\triangle H M N \sim \triangle M F G$. Therefore, $\frac{H M}{H G}=\frac{H M}{H N} \cdot \frac{H N}{H G}=\frac{M F}{M G} \cdot \frac{E M}{E F}$. Similarly, we obtain $\frac{H M}{H E}=\frac{M F}{M E} \cdot \frac{G M}{G F}$. By multiplying these two equations, we complete the proof. + +Solution 3. We present another approach for showing (1) from Solution 2. +Lemma 2. Let $E F G H$ and $E^{\prime} F^{\prime} G^{\prime} H^{\prime}$ be circumscribed quadrilaterals such that $\angle E+\angle E^{\prime}=$ $\angle F+\angle F^{\prime}=\angle G+\angle G^{\prime}=\angle H+\angle H^{\prime}=180^{\circ}$. Then + +$$ +\frac{E F \cdot G H}{F G \cdot H E}=\frac{E^{\prime} F^{\prime} \cdot G^{\prime} H^{\prime}}{F^{\prime} G^{\prime} \cdot H^{\prime} E^{\prime}} +$$ + +Proof. Let $M$ and $M^{\prime}$ be the incenters of $E F G H$ and $E^{\prime} F^{\prime} G^{\prime} H^{\prime}$, respectively. We use the notation [XYZ] for the area of a triangle $X Y Z$. + +Taking into account the relation $\angle F M E+\angle F^{\prime} M^{\prime} E^{\prime}=180^{\circ}$ together with the analogous ones, we get + +$$ +\begin{aligned} +\frac{E F \cdot G H}{F G \cdot H E} & =\frac{[M E F] \cdot[M G H]}{[M F G] \cdot[M H E]}=\frac{M E \cdot M F \cdot \sin \angle F M E \cdot M G \cdot M H \cdot \sin \angle H M G}{M F \cdot M G \cdot \sin \angle G M F \cdot M H \cdot M E \cdot \sin \angle E M H} \\ +& =\frac{M^{\prime} E^{\prime} \cdot M^{\prime} F^{\prime} \cdot \sin \angle F^{\prime} M^{\prime} E^{\prime} \cdot M^{\prime} G^{\prime} \cdot M^{\prime} H^{\prime} \cdot \sin \angle H^{\prime} M^{\prime} G^{\prime}}{M^{\prime} F^{\prime} \cdot M^{\prime} G^{\prime} \cdot \sin \angle G^{\prime} M^{\prime} F^{\prime} \cdot M^{\prime} H^{\prime} \cdot M^{\prime} E^{\prime} \cdot \sin \angle E^{\prime} M^{\prime} H^{\prime}}=\frac{E^{\prime} F^{\prime} \cdot G^{\prime} H^{\prime}}{F^{\prime} G^{\prime} \cdot H^{\prime} E^{\prime}} . +\end{aligned} +$$ + + + +Figure 6 +Denote by $h$ the homothety centered at $O$ that maps the incircle of $C R O Q$ to the incircle of $A P O S$. Let $Q^{\prime}=h(Q), C^{\prime}=h(C), R^{\prime}=h(R), O^{\prime}=O, S^{\prime}=S, A^{\prime}=A$, and $P^{\prime}=P$. Furthermore, define $B^{\prime}=A^{\prime} P^{\prime} \cap C^{\prime} Q^{\prime}$ and $D^{\prime}=A^{\prime} S^{\prime} \cap C^{\prime} R^{\prime}$ as shown in Figure 6. Then + +$$ +\frac{A P \cdot O S}{P O \cdot S A}=\frac{A^{\prime} P^{\prime} \cdot O^{\prime} S^{\prime}}{P^{\prime} O^{\prime} \cdot S^{\prime} A^{\prime}} +$$ + +holds trivially. We also have + +$$ +\frac{C R \cdot O Q}{R O \cdot Q C}=\frac{C^{\prime} R^{\prime} \cdot O^{\prime} Q^{\prime}}{R^{\prime} O^{\prime} \cdot Q^{\prime} C^{\prime}} +$$ + +by the similarity of the quadrilaterals $C R O Q$ and $C^{\prime} R^{\prime} O^{\prime} Q^{\prime}$. + +Next, consider the circumscribed quadrilaterals $B Q O P$ and $B^{\prime} Q^{\prime} O^{\prime} P^{\prime}$ whose incenters lie on different sides of the quadrilaterals' shared side line $O P=O^{\prime} P^{\prime}$. Observe that $B Q \| B^{\prime} Q^{\prime}$ and that $B^{\prime}$ and $Q^{\prime}$ lie on the lines $B P$ and $Q O$, respectively. It is now easy to see that the two quadrilaterals satisfy the hypotheses of Lemma 2. Thus, we deduce + +$$ +\frac{B Q \cdot O P}{Q O \cdot P B}=\frac{B^{\prime} Q^{\prime} \cdot O^{\prime} P^{\prime}}{Q^{\prime} O^{\prime} \cdot P^{\prime} B^{\prime}} +$$ + +Similarly, we get + +$$ +\frac{D S \cdot O R}{S O \cdot R D}=\frac{D^{\prime} S^{\prime} \cdot O^{\prime} R^{\prime}}{S^{\prime} O^{\prime} \cdot R^{\prime} D^{\prime}} +$$ + +Multiplying these four equations, we obtain + +$$ +\frac{A P}{P B} \cdot \frac{B Q}{Q C} \cdot \frac{C R}{R D} \cdot \frac{D S}{S A}=\frac{A^{\prime} P^{\prime}}{P^{\prime} B^{\prime}} \cdot \frac{B^{\prime} Q^{\prime}}{Q^{\prime} C^{\prime}} \cdot \frac{C^{\prime} R^{\prime}}{R^{\prime} D^{\prime}} \cdot \frac{D^{\prime} S^{\prime}}{S^{\prime} A^{\prime}} +$$ + +Finally, we apply BRIANChon's theorem to the circumscribed hexagon $A^{\prime} P^{\prime} R^{\prime} C^{\prime} Q^{\prime} S^{\prime}$ and deduce that the lines $A^{\prime} C^{\prime}, P^{\prime} Q^{\prime}$, and $R^{\prime} S^{\prime}$ are either concurrent or parallel to each other. So, by Menelaus' theorem, we obtain + +$$ +\frac{A^{\prime} P^{\prime}}{P^{\prime} B^{\prime}} \cdot \frac{B^{\prime} Q^{\prime}}{Q^{\prime} C^{\prime}} \cdot \frac{C^{\prime} R^{\prime}}{R^{\prime} D^{\prime}} \cdot \frac{D^{\prime} S^{\prime}}{S^{\prime} A^{\prime}}=1 +$$ + +This equation together with (3) yield (1). + +G8. A triangulation of a convex polygon $\Pi$ is a partitioning of $\Pi$ into triangles by diagonals having no common points other than the vertices of the polygon. We say that a triangulation is a Thaiangulation if all triangles in it have the same area. + +Prove that any two different Thaiangulations of a convex polygon $\Pi$ differ by exactly two triangles. (In other words, prove that it is possible to replace one pair of triangles in the first Thaiangulation with a different pair of triangles so as to obtain the second Thaiangulation.) +(Bulgaria) +Solution 1. We denote by [S] the area of a polygon $S$. +Recall that each triangulation of a convex $n$-gon has exactly $n-2$ triangles. This means that all triangles in any two Thaiangulations of a convex polygon $\Pi$ have the same area. + +Let $\mathcal{T}$ be a triangulation of a convex polygon $\Pi$. If four vertices $A, B, C$, and $D$ of $\Pi$ form a parallelogram, and $\mathcal{T}$ contains two triangles whose union is this parallelogram, then we say that $\mathcal{T}$ contains parallelogram $A B C D$. Notice here that if two Thaiangulations $\mathcal{T}_{1}$ and $\mathcal{T}_{2}$ of $\Pi$ differ by two triangles, then the union of these triangles is a quadrilateral each of whose diagonals bisects its area, i.e., a parallelogram. + +We start with proving two properties of triangulations. +Lemma 1. A triangulation of a convex polygon $\Pi$ cannot contain two parallelograms. +Proof. Arguing indirectly, assume that $P_{1}$ and $P_{2}$ are two parallelograms contained in some triangulation $\mathcal{T}$. If they have a common triangle in $\mathcal{T}$, then we may assume that $P_{1}$ consists of triangles $A B C$ and $A D C$ of $\mathcal{T}$, while $P_{2}$ consists of triangles $A D C$ and $C D E$ (see Figure 1). But then $B C\|A D\| C E$, so the three vertices $B, C$, and $E$ of $\Pi$ are collinear, which is absurd. + +Assume now that $P_{1}$ and $P_{2}$ contain no common triangle. Let $P_{1}=A B C D$. The sides $A B$, $B C, C D$, and $D A$ partition $\Pi$ into several parts, and $P_{2}$ is contained in one of them; we may assume that this part is cut off from $P_{1}$ by $A D$. Then one may label the vertices of $P_{2}$ by $X$, $Y, Z$, and $T$ so that the polygon $A B C D X Y Z T$ is convex (see Figure 2; it may happen that $D=X$ and/or $T=A$, but still this polygon has at least six vertices). But the sum of the external angles of this polygon at $B, C, Y$, and $Z$ is already $360^{\circ}$, which is impossible. A final contradiction. + + +Figure 1 + + +Figure 2 + + +Figure 3 + +Lemma 2. Every triangle in a Thaiangulation $\mathcal{T}$ of $\Pi$ contains a side of $\Pi$. +Proof. Let $A B C$ be a triangle in $\mathcal{T}$. Apply an affine transform such that $A B C$ maps to an equilateral triangle; let $A^{\prime} B^{\prime} C^{\prime}$ be the image of this triangle, and $\Pi^{\prime}$ be the image of $\Pi$. Clearly, $\mathcal{T}$ maps into a Thaiangulation $\mathcal{T}^{\prime}$ of $\Pi^{\prime}$. + +Assume that none of the sides of $\triangle A^{\prime} B^{\prime} C^{\prime}$ is a side of $\Pi^{\prime}$. Then $\mathcal{T}^{\prime}$ contains some other triangles with these sides, say, $A^{\prime} B^{\prime} Z, C^{\prime} A^{\prime} Y$, and $B^{\prime} C^{\prime} X$; notice that $A^{\prime} Z B^{\prime} X C^{\prime} Y$ is a convex hexagon (see Figure 3). The sum of its external angles at $X, Y$, and $Z$ is less than $360^{\circ}$. So one of these angles (say, at $Z$ ) is less than $120^{\circ}$, hence $\angle A^{\prime} Z B^{\prime}>60^{\circ}$. Then $Z$ lies on a circular arc subtended by $A^{\prime} B^{\prime}$ and having angular measure less than $240^{\circ}$; consequently, the altitude $Z H$ of $\triangle A^{\prime} B^{\prime} Z$ is less than $\sqrt{3} A^{\prime} B^{\prime} / 2$. Thus $\left[A^{\prime} B^{\prime} Z\right]<\left[A^{\prime} B^{\prime} C^{\prime}\right]$, and $\mathcal{T}^{\prime}$ is not a Thaiangulation. A contradiction. + +Now we pass to the solution. We say that a triangle in a triangulation of $\Pi$ is an ear if it contains two sides of $\Pi$. Note that each triangulation of a polygon contains some ear. + +Arguing indirectly, we choose a convex polygon $\Pi$ with the least possible number of sides such that some two Thaiangulations $\mathcal{T}_{1}$ and $\mathcal{T}_{2}$ of $\Pi$ violate the problem statement (thus $\Pi$ has at least five sides). Consider now any ear $A B C$ in $\mathcal{T}_{1}$, with $A C$ being a diagonal of $\Pi$. If $\mathcal{T}_{2}$ also contains $\triangle A B C$, then one may cut $\triangle A B C$ off from $\Pi$, getting a polygon with a smaller number of sides which also violates the problem statement. This is impossible; thus $\mathcal{T}_{2}$ does not contain $\triangle A B C$. + +Next, $\mathcal{T}_{1}$ contains also another triangle with side $A C$, say $\triangle A C D$. By Lemma 2 , this triangle contains a side of $\Pi$, so $D$ is adjacent to either $A$ or $C$ on the boundary of $\Pi$. We may assume that $D$ is adjacent to $C$. + +Assume that $\mathcal{T}_{2}$ does not contain the triangle $B C D$. Then it contains two different triangles $B C X$ and $C D Y$ (possibly, with $X=Y$ ); since these triangles have no common interior points, the polygon $A B C D Y X$ is convex (see Figure 4). But, since $[A B C]=[B C X]=$ $[A C D]=[C D Y]$, we get $A X \| B C$ and $A Y \| C D$ which is impossible. Thus $\mathcal{T}_{2}$ contains $\triangle B C D$. + +Therefore, $[A B D]=[A B C]+[A C D]-[B C D]=[A B C]$, and $A B C D$ is a parallelogram contained in $\mathcal{T}_{1}$. Let $\mathcal{T}^{\prime}$ be the Thaiangulation of $\Pi$ obtained from $\mathcal{T}_{1}$ by replacing the diagonal $A C$ with $B D$; then $\mathcal{T}^{\prime}$ is distinct from $\mathcal{T}_{2}$ (otherwise $\mathcal{T}_{1}$ and $\mathcal{T}_{2}$ would differ by two triangles). Moreover, $\mathcal{T}^{\prime}$ shares a common ear $B C D$ with $\mathcal{T}_{2}$. As above, cutting this ear away we obtain that $\mathcal{T}_{2}$ and $\mathcal{T}^{\prime}$ differ by two triangles forming a parallelogram different from $A B C D$. Thus $\mathcal{T}^{\prime}$ contains two parallelograms, which contradicts Lemma 1. + + +Figure 4 + + +Figure 5 + +Comment 1. Lemma 2 is equivalent to the well-known Erdős-Debrunner inequality stating that for any triangle $P Q R$ and any points $A, B, C$ lying on the sides $Q R, R P$, and $P Q$, respectively, we have + +$$ +[A B C] \geqslant \min \{[A B R],[B C P],[C A Q]\} +$$ + +To derive this inequality from Lemma 2, one may assume that (1) does not hold, and choose some points $X, Y$, and $Z$ inside the triangles $B C P, C A Q$, and $A B R$, respectively, so that $[A B C]=$ $[A B Z]=[B C X]=[C A Y]$. Then a convex hexagon $A Z B X C Y$ has a Thaiangulation containing $\triangle A B C$, which contradicts Lemma 2. + +Conversely, assume that a Thaiangulation $\mathcal{T}$ of $\Pi$ contains a triangle $A B C$ none of whose sides is a side of $\Pi$, and let $A B Z, A Y C$, and $X B C$ be other triangles in $\mathcal{T}$ containing the corresponding sides. Then $A Z B X C Y$ is a convex hexagon. + +Consider the lines through $A, B$, and $C$ parallel to $Y Z, Z X$, and $X Y$, respectively. They form a triangle $X^{\prime} Y^{\prime} Z^{\prime}$ similar to $\triangle X Y Z$ (see Figure 5). By (1) we have + +$$ +[A B C] \geqslant \min \left\{\left[A B Z^{\prime}\right],\left[B C X^{\prime}\right],\left[C A Y^{\prime}\right]\right\}>\min \{[A B Z],[B C X],[C A Y]\}, +$$ + +so $\mathcal{T}$ is not a Thaiangulation. + +Solution 2. We will make use of the preliminary observations from Solution 1, together with Lemma 1. + +Arguing indirectly, we choose a convex polygon $\Pi$ with the least possible number of sides such that some two Thaiangulations $\mathcal{T}_{1}$ and $\mathcal{T}_{2}$ of $\Pi$ violate the statement (thus $\Pi$ has at least five sides). Assume that $\mathcal{T}_{1}$ and $\mathcal{T}_{2}$ share a diagonal $d$ splitting $\Pi$ into two smaller polygons $\Pi_{1}$ and $\Pi_{2}$. Since the problem statement holds for any of them, the induced Thaiangulations of each of $\Pi_{i}$ differ by two triangles forming a parallelogram (the Thaiangulations induced on $\Pi_{i}$ by $\mathcal{T}_{1}$ and $T_{2}$ may not coincide, otherwise $\mathcal{T}_{1}$ and $\mathcal{T}_{2}$ would differ by at most two triangles). But both these parallelograms are contained in $\mathcal{T}_{1}$; this contradicts Lemma 1. Therefore, $\mathcal{T}_{1}$ and $\mathcal{T}_{2}$ share no diagonal. Hence they also share no triangle. + +We consider two cases. +Case 1. Assume that some vertex $B$ of $\Pi$ is an endpoint of some diagonal in $\mathcal{T}_{1}$, as well as an endpoint of some diagonal in $\mathcal{T}_{2}$. + +Let $A$ and $C$ be the vertices of $\Pi$ adjacent to $B$. Then $\mathcal{T}_{1}$ contains some triangles $A B X$ and $B C Y$, while $\mathcal{T}_{2}$ contains some triangles $A B X^{\prime}$ and $B C Y^{\prime}$. Here, some of the points $X$, $X^{\prime}, Y$, and $Y^{\prime}$ may coincide; however, in view of our assumption together with the fact that $\mathcal{T}_{1}$ and $\mathcal{T}_{2}$ share no triangle, all four triangles $A B X, B C Y, A B X^{\prime}$, and $B C Y^{\prime}$ are distinct. + +Since $[A B X]=[B C Y]=\left[A B X^{\prime}\right]=\left[B C Y^{\prime}\right]$, we have $X X^{\prime} \| A B$ and $Y Y^{\prime} \| B C$. Now, if $X=Y$, then $X^{\prime}$ and $Y^{\prime}$ lie on different lines passing through $X$ and are distinct from that point, so that $X^{\prime} \neq Y^{\prime}$. In this case, we may switch the two Thaiangulations. So, hereafter we assume that $X \neq Y$. + +In the convex pentagon $A B C Y X$ we have either $\angle B A X+\angle A X Y>180^{\circ}$ or $\angle X Y C+$ $\angle Y C B>180^{\circ}$ (or both); due to the symmetry, we may assume that the first inequality holds. Let $r$ be the ray emerging from $X$ and co-directed with $\overrightarrow{A B}$; our inequality shows that $r$ points to the interior of the pentagon (and thus to the interior of $\Pi$ ). Therefore, the ray opposite to $r$ points outside $\Pi$, so $X^{\prime}$ lies on $r$; moreover, $X^{\prime}$ lies on the "arc" $C Y$ of $\Pi$ not containing $X$. So the segments $X X^{\prime}$ and $Y B$ intersect (see Figure 6). + +Let $O$ be the intersection point of the rays $r$ and $B C$. Since the triangles $A B X^{\prime}$ and $B C Y^{\prime}$ have no common interior points, $Y^{\prime}$ must lie on the "arc" $C X^{\prime}$ which is situated inside the triangle $X B O$. Therefore, the line $Y Y^{\prime}$ meets two sides of $\triangle X B O$, none of which may be $X B$ (otherwise the diagonals $X B$ and $Y Y^{\prime}$ would share a common point). Thus $Y Y^{\prime}$ intersects $B O$, which contradicts $Y Y^{\prime} \| B C$. + + +Figure 6 + +Case 2. In the remaining case, each vertex of $\Pi$ is an endpoint of a diagonal in at most one of $\mathcal{T}_{1}$ and $\mathcal{T}_{2}$. On the other hand, a triangulation cannot contain two consecutive vertices with no diagonals from each. Therefore, the vertices of $\Pi$ alternatingly emerge diagonals in $\mathcal{T}_{1}$ and in $\mathcal{T}_{2}$. In particular, $\Pi$ has an even number of sides. + +Next, we may choose five consecutive vertices $A, B, C, D$, and $E$ of $\Pi$ in such a way that + +$$ +\angle A B C+\angle B C D>180^{\circ} \text { and } \angle B C D+\angle C D E>180^{\circ} . +$$ + +In order to do this, it suffices to choose three consecutive vertices $B, C$, and $D$ of $\Pi$ such that the sum of their external angles is at most $180^{\circ}$. This is possible, since $\Pi$ has at least six sides. + + +Figure 7 +We may assume that $\mathcal{T}_{1}$ has no diagonals from $B$ and $D$ (and thus contains the triangles $A B C$ and $C D E$ ), while $\mathcal{T}_{2}$ has no diagonals from $A, C$, and $E$ (and thus contains the triangle $B C D)$. Now, since $[A B C]=[B C D]=[C D E]$, we have $A D \| B C$ and $B E \| C D$ (see Figure 7). By (2) this yields that $A D>B C$ and $B E>C D$. Let $X=A C \cap B D$ and $Y=C E \cap B D$; then the inequalities above imply that $A X>C X$ and $E Y>C Y$. + +Finally, $\mathcal{T}_{2}$ must also contain some triangle $B D Z$ with $Z \neq C$; then the ray $C Z$ lies in the angle $A C E$. Since $[B C D]=[B D Z]$, the diagonal $B D$ bisects $C Z$. Together with the inequalities above, this yields that $Z$ lies inside the triangle $A C E$ (but $Z$ is distinct from $A$ and $E$ ), which is impossible. The final contradiction. + +Comment 2. Case 2 may also be accomplished with the use of Lemma 2. Indeed, since each triangulation of an $n$-gon contains $n-2$ triangles neither of which may contain three sides of $\Pi$, Lemma 2 yields that each Thaiangulation contains exactly two ears. But each vertex of $\Pi$ is a vertex of an ear either in $\mathcal{T}_{1}$ or in $\mathcal{T}_{2}$, so $\Pi$ cannot have more than four vertices. + +## Number Theory + +N1. Determine all positive integers $M$ for which the sequence $a_{0}, a_{1}, a_{2}, \ldots$, defined by $a_{0}=\frac{2 M+1}{2}$ and $a_{k+1}=a_{k}\left\lfloor a_{k}\right\rfloor$ for $k=0,1,2, \ldots$, contains at least one integer term. +(Luxembourg) +Answer. All integers $M \geqslant 2$. +Solution 1. Define $b_{k}=2 a_{k}$ for all $k \geqslant 0$. Then + +$$ +b_{k+1}=2 a_{k+1}=2 a_{k}\left\lfloor a_{k}\right\rfloor=b_{k}\left\lfloor\frac{b_{k}}{2}\right\rfloor . +$$ + +Since $b_{0}$ is an integer, it follows that $b_{k}$ is an integer for all $k \geqslant 0$. +Suppose that the sequence $a_{0}, a_{1}, a_{2}, \ldots$ does not contain any integer term. Then $b_{k}$ must be an odd integer for all $k \geqslant 0$, so that + +$$ +b_{k+1}=b_{k}\left\lfloor\frac{b_{k}}{2}\right\rfloor=\frac{b_{k}\left(b_{k}-1\right)}{2} +$$ + +Hence + +$$ +b_{k+1}-3=\frac{b_{k}\left(b_{k}-1\right)}{2}-3=\frac{\left(b_{k}-3\right)\left(b_{k}+2\right)}{2} +$$ + +for all $k \geqslant 0$. +Suppose that $b_{0}-3>0$. Then equation (2) yields $b_{k}-3>0$ for all $k \geqslant 0$. For each $k \geqslant 0$, define $c_{k}$ to be the highest power of 2 that divides $b_{k}-3$. Since $b_{k}-3$ is even for all $k \geqslant 0$, the number $c_{k}$ is positive for every $k \geqslant 0$. + +Note that $b_{k}+2$ is an odd integer. Therefore, from equation (2), we have that $c_{k+1}=c_{k}-1$. Thus, the sequence $c_{0}, c_{1}, c_{2}, \ldots$ of positive integers is strictly decreasing, a contradiction. So, $b_{0}-3 \leqslant 0$, which implies $M=1$. + +For $M=1$, we can check that the sequence is constant with $a_{k}=\frac{3}{2}$ for all $k \geqslant 0$. Therefore, the answer is $M \geqslant 2$. + +Solution 2. We provide an alternative way to show $M=1$ once equation (1) has been reached. We claim that $b_{k} \equiv 3\left(\bmod 2^{m}\right)$ for all $k \geqslant 0$ and $m \geqslant 1$. If this is true, then we would have $b_{k}=3$ for all $k \geqslant 0$ and hence $M=1$. + +To establish our claim, we proceed by induction on $m$. The base case $b_{k} \equiv 3(\bmod 2)$ is true for all $k \geqslant 0$ since $b_{k}$ is odd. Now suppose that $b_{k} \equiv 3\left(\bmod 2^{m}\right)$ for all $k \geqslant 0$. Hence $b_{k}=2^{m} d_{k}+3$ for some integer $d_{k}$. We have + +$$ +3 \equiv b_{k+1} \equiv\left(2^{m} d_{k}+3\right)\left(2^{m-1} d_{k}+1\right) \equiv 3 \cdot 2^{m-1} d_{k}+3 \quad\left(\bmod 2^{m}\right) +$$ + +so that $d_{k}$ must be even. This implies that $b_{k} \equiv 3\left(\bmod 2^{m+1}\right)$, as required. +Comment. The reason the number 3 which appears in both solutions is important, is that it is a nontrivial fixed point of the recurrence relation for $b_{k}$. + +N2. Let $a$ and $b$ be positive integers such that $a!b$ ! is a multiple of $a!+b!$. Prove that $3 a \geqslant 2 b+2$. +(United Kingdom) +Solution 1. If $a>b$, we immediately get $3 a \geqslant 2 b+2$. In the case $a=b$, the required inequality is equivalent to $a \geqslant 2$, which can be checked easily since $(a, b)=(1,1)$ does not satisfy $a!+b!\mid a!b!$. We now assume $aa$ !, which is impossible. We observe that $c!\mid M$ since $M$ is a product of $c$ consecutive integers. Thus $\operatorname{gcd}(1+M, c!)=1$, which implies + +$$ +1+M \left\lvert\, \frac{a!}{c!}=(c+1)(c+2) \cdots a\right. +$$ + +If $a \leqslant 2 c$, then $\frac{a!}{c!}$ is a product of $a-c \leqslant c$ integers not exceeding $a$ whereas $M$ is a product of $c$ integers exceeding $a$. Therefore, $1+M>\frac{a!}{c!}$, which is a contradiction. + +It remains to exclude the case $a=2 c+1$. Since $a+1=2(c+1)$, we have $c+1 \mid M$. Hence, we can deduce from (1) that $1+M \mid(c+2)(c+3) \cdots a$. Now $(c+2)(c+3) \cdots a$ is a product of $a-c-1=c$ integers not exceeding $a$; thus it is smaller than $1+M$. Again, we arrive at a contradiction. + +Comment 1. One may derive a weaker version of (1) and finish the problem as follows. After assuming $a \leqslant 2 c+1$, we have $\left\lfloor\frac{a}{2}\right\rfloor \leqslant c$, so $\left.\left\lfloor\frac{a}{2}\right\rfloor!\right\rvert\, M$. Therefore, + +$$ +1+M \left\lvert\,\left(\left\lfloor\frac{a}{2}\right\rfloor+1\right)\left(\left\lfloor\frac{a}{2}\right\rfloor+2\right) \cdots a\right. +$$ + +Observe that $\left(\left\lfloor\frac{a}{2}\right\rfloor+1\right)\left(\left\lfloor\frac{a}{2}\right\rfloor+2\right) \cdots a$ is a product of $\left\lceil\frac{a}{2}\right\rceil$ integers not exceeding $a$. This leads to a contradiction when $a$ is even since $\left\lceil\frac{a}{2}\right\rceil=\frac{a}{2} \leqslant c$ and $M$ is a product of $c$ integers exceeding $a$. + +When $a$ is odd, we can further deduce that $1+M \left\lvert\,\left(\frac{a+3}{2}\right)\left(\frac{a+5}{2}\right) \cdots a\right.$ since $\left.\left\lfloor\frac{a}{2}\right\rfloor+1=\frac{a+1}{2} \right\rvert\, a+1$. Now $\left(\frac{a+3}{2}\right)\left(\frac{a+5}{2}\right) \cdots a$ is a product of $\frac{a-1}{2} \leqslant c$ numbers not exceeding $a$, and we get a contradiction. + +Solution 2. As in Solution 1, we may assume that $aa+c$; otherwise, $a+1 \leqslant 2 c+2 \leqslant 2 p \leqslant a+c$ so $p \mid N-1$, again impossible. Thus, we have $p \in\left(\frac{a+c}{2}, a\right]$, and $p^{2} \nmid(a+c)$ ! since $2 p>a+c$. Therefore, $p^{2} \nmid N$ as well. + +If $a \leqslant c+2$, then the interval $\left(\frac{a+c}{2}, a\right]$ contains at most one integer and hence at most one prime number, which has to be $a$. Since $p^{2} \nmid N$, we must have $N=p=a$ or $N=1$, which is absurd since $N>a \geqslant 1$. Thus, we have $a \geqslant c+3$, and so $\frac{a+c+1}{2} \geqslant c+2$. It follows that $p$ lies in the interval $[c+2, a]$. + +Thus, every prime appearing in the prime factorization of $N$ lies in the interval $[c+2, a]$, and its exponent is exactly 1 . So we must have $N \mid(c+2)(c+3) \cdots a$. However, $(c+2)(c+3) \cdots a$ is a product of $a-c-1 \leqslant c$ numbers not exceeding $a$, so it is less than $N$. This is a contradiction. + +Comment 2. The original problem statement also asks to determine when the equality $3 a=2 b+2$ holds. It can be checked that the answer is $(a, b)=(2,2),(4,5)$. + +N3. Let $m$ and $n$ be positive integers such that $m>n$. Define $x_{k}=(m+k) /(n+k)$ for $k=$ $1,2, \ldots, n+1$. Prove that if all the numbers $x_{1}, x_{2}, \ldots, x_{n+1}$ are integers, then $x_{1} x_{2} \cdots x_{n+1}-1$ is divisible by an odd prime. +(Austria) +Solution. Assume that $x_{1}, x_{2}, \ldots, x_{n+1}$ are integers. Define the integers + +$$ +a_{k}=x_{k}-1=\frac{m+k}{n+k}-1=\frac{m-n}{n+k}>0 +$$ + +for $k=1,2, \ldots, n+1$. +Let $P=x_{1} x_{2} \cdots x_{n+1}-1$. We need to prove that $P$ is divisible by an odd prime, or in other words, that $P$ is not a power of 2 . To this end, we investigate the powers of 2 dividing the numbers $a_{k}$. + +Let $2^{d}$ be the largest power of 2 dividing $m-n$, and let $2^{c}$ be the largest power of 2 not exceeding $2 n+1$. Then $2 n+1 \leqslant 2^{c+1}-1$, and so $n+1 \leqslant 2^{c}$. We conclude that $2^{c}$ is one of the numbers $n+1, n+2, \ldots, 2 n+1$, and that it is the only multiple of $2^{c}$ appearing among these numbers. Let $\ell$ be such that $n+\ell=2^{c}$. Since $\frac{m-n}{n+\ell}$ is an integer, we have $d \geqslant c$. Therefore, $2^{d-c+1} \nmid a_{\ell}=\frac{m-n}{n+\ell}$, while $2^{d-c+1} \mid a_{k}$ for all $k \in\{1, \ldots, n+1\} \backslash\{\ell\}$. + +Computing modulo $2^{d-c+1}$, we get + +$$ +P=\left(a_{1}+1\right)\left(a_{2}+1\right) \cdots\left(a_{n+1}+1\right)-1 \equiv\left(a_{\ell}+1\right) \cdot 1^{n}-1 \equiv a_{\ell} \not \equiv 0 \quad\left(\bmod 2^{d-c+1}\right) +$$ + +Therefore, $2^{d-c+1} \nmid P$. +On the other hand, for any $k \in\{1, \ldots, n+1\} \backslash\{\ell\}$, we have $2^{d-c+1} \mid a_{k}$. So $P \geqslant a_{k} \geqslant 2^{d-c+1}$, and it follows that $P$ is not a power of 2 . + +Comment. Instead of attempting to show that $P$ is not a power of 2 , one may try to find an odd factor of $P$ (greater than 1) as follows: + +From $a_{k}=\frac{m-n}{n+k} \in \mathbb{Z}_{>0}$, we get that $m-n$ is divisible by $n+1, n+2, \ldots, 2 n+1$, and thus it is also divisible by their least common multiple $L$. So $m-n=q L$ for some positive integer $q$; hence $x_{k}=q \cdot \frac{L}{n+k}+1$. + +Then, since $n+1 \leqslant 2^{c}=n+\ell \leqslant 2 n+1 \leqslant 2^{c+1}-1$, we have $2^{c} \mid L$, but $2^{c+1} \nmid L$. So $\frac{L}{n+\ell}$ is odd, while $\frac{L}{n+k}$ is even for $k \neq \ell$. Computing modulo $2 q$ yields + +$$ +x_{1} x_{2} \cdots x_{n+1}-1 \equiv(q+1) \cdot 1^{n}-1 \equiv q \quad(\bmod 2 q) +$$ + +Thus, $x_{1} x_{2} \cdots x_{n+1}-1=2 q r+q=q(2 r+1)$ for some integer $r$. +Since $x_{1} x_{2} \cdots x_{n+1}-1 \geqslant x_{1} x_{2}-1 \geqslant(q+1)^{2}-1>q$, we have $r \geqslant 1$. This implies that $x_{1} x_{2} \cdots x_{n+1}-1$ is divisible by an odd prime. + +N4. Suppose that $a_{0}, a_{1}, \ldots$ and $b_{0}, b_{1}, \ldots$ are two sequences of positive integers satisfying $a_{0}, b_{0} \geqslant 2$ and + +$$ +a_{n+1}=\operatorname{gcd}\left(a_{n}, b_{n}\right)+1, \quad b_{n+1}=\operatorname{lcm}\left(a_{n}, b_{n}\right)-1 +$$ + +for all $n \geqslant 0$. Prove that the sequence $\left(a_{n}\right)$ is eventually periodic; in other words, there exist integers $N \geqslant 0$ and $t>0$ such that $a_{n+t}=a_{n}$ for all $n \geqslant N$. +(France) +Solution 1. Let $s_{n}=a_{n}+b_{n}$. Notice that if $a_{n} \mid b_{n}$, then $a_{n+1}=a_{n}+1, b_{n+1}=b_{n}-1$ and $s_{n+1}=s_{n}$. So, $a_{n}$ increases by 1 and $s_{n}$ does not change until the first index is reached with $a_{n} \nmid s_{n}$. Define + +$$ +W_{n}=\left\{m \in \mathbb{Z}_{>0}: m \geqslant a_{n} \text { and } m \nmid s_{n}\right\} \quad \text { and } \quad w_{n}=\min W_{n} +$$ + +Claim 1. The sequence $\left(w_{n}\right)$ is non-increasing. +Proof. If $a_{n} \mid b_{n}$ then $a_{n+1}=a_{n}+1$. Due to $a_{n} \mid s_{n}$, we have $a_{n} \notin W_{n}$. Moreover $s_{n+1}=s_{n}$; therefore, $W_{n+1}=W_{n}$ and $w_{n+1}=w_{n}$. + +Otherwise, if $a_{n} \nmid b_{n}$, then $a_{n} \nmid s_{n}$, so $a_{n} \in W_{n}$ and thus $w_{n}=a_{n}$. We show that $a_{n} \in W_{n+1}$; this implies $w_{n+1} \leqslant a_{n}=w_{n}$. By the definition of $W_{n+1}$, we need that $a_{n} \geqslant a_{n+1}$ and $a_{n} \nmid s_{n+1}$. The first relation holds because of $\operatorname{gcd}\left(a_{n}, b_{n}\right) \beta>\gamma . +$$ + +Depending on how large $a$ is, we divide the argument into two further cases. +Case 2.1. $\quad a=2$. +We first prove that $\gamma=0$. Assume for the sake of contradiction that $\gamma>0$. Then $c$ is even by (4) and, similarly, $b$ is even by (5) and (3). So the left-hand side of (2) is congruent to 2 modulo 4 , which is only possible if $b c=4$. As this contradicts (1), we have thereby shown that $\gamma=0$, i.e., that $c=2 b-1$. + +Now (3) yields $3 b-2=2^{\beta}$. Due to $b>2$ this is only possible if $\beta \geqslant 4$. If $\beta=4$, then we get $b=6$ and $c=2 \cdot 6-1=11$, which is a solution. It remains to deal with the case $\beta \geqslant 5$. Now (2) implies + +$$ +9 \cdot 2^{\alpha}=9 b(2 b-1)-18=(3 b-2)(6 b+1)-16=2^{\beta}\left(2^{\beta+1}+5\right)-16 +$$ + +and by $\beta \geqslant 5$ the right-hand side is not divisible by 32 . Thus $\alpha \leqslant 4$ and we get a contradiction to (5). + +Case 2.2. $\quad a \geqslant 3$. +Pick an integer $\vartheta \in\{-1,+1\}$ such that $c-\vartheta$ is not divisible by 4 . Now + +$$ +2^{\alpha}+\vartheta \cdot 2^{\beta}=\left(b c-a \vartheta^{2}\right)+\vartheta(c a-b)=(b+a \vartheta)(c-\vartheta) +$$ + +is divisible by $2^{\beta}$ and, consequently, $b+a \vartheta$ is divisible by $2^{\beta-1}$. On the other hand, $2^{\beta}=a c-b>$ $(a-1) c \geqslant 2 c$ implies in view of (1) that $a$ and $b$ are smaller than $2^{\beta-1}$. All this is only possible if $\vartheta=1$ and $a+b=2^{\beta-1}$. Now (3) yields + +$$ +a c-b=2(a+b) +$$ + +whence $4 b>a+3 b=a(c-1) \geqslant a b$, which in turn yields $a=3$. +So (6) simplifies to $c=b+2$ and (2) tells us that $b(b+2)-3=(b-1)(b+3)$ is a power of 2 . Consequently, the factors $b-1$ and $b+3$ are powers of 2 themselves. Since their difference is 4 , this is only possible if $b=5$ and thus $c=7$. Thereby the solution is complete. + +Solution 2. As in the beginning of the first solution, we observe that $a, b, c \geqslant 2$. Depending on the parities of $a, b$, and $c$ we distinguish three cases. + +Case 1. The numbers $a, b$, and $c$ are even. +Let $2^{A}, 2^{B}$, and $2^{C}$ be the largest powers of 2 dividing $a, b$, and $c$ respectively. We may assume without loss of generality that $1 \leqslant A \leqslant B \leqslant C$. Now $2^{B}$ is the highest power of 2 dividing $a c-b$, whence $a c-b=2^{B} \leqslant b$. Similarly, we deduce $b c-a=2^{A} \leqslant a$. Adding both estimates we get $(a+b) c \leqslant 2(a+b)$, whence $c \leqslant 2$. So $c=2$ and thus $A=B=C=1$; moreover, we must have had equality throughout, i.e., $a=2^{A}=2$ and $b=2^{B}=2$. We have thereby found the solution $(a, b, c)=(2,2,2)$. + +Case 2. The numbers $a, b$, and $c$ are odd. +If any two of these numbers are equal, say $a=b$, then $a c-b=a(c-1)$ has a nontrivial odd divisor and cannot be a power of 2 . Hence $a, b$, and $c$ are distinct. So we may assume without loss of generality that $a\beta$, and thus $2^{\beta}$ divides + +$$ +a \cdot 2^{\alpha}-b \cdot 2^{\beta}=a(b c-a)-b(a c-b)=b^{2}-a^{2}=(b+a)(b-a) +$$ + +Since $a$ is odd, it is not possible that both factors $b+a$ and $b-a$ are divisible by 4 . Consequently, one of them has to be a multiple of $2^{\beta-1}$. Hence one of the numbers $2(b+a)$ and $2(b-a)$ is divisible by $2^{\beta}$ and in either case we have + +$$ +a c-b=2^{\beta} \leqslant 2(a+b) +$$ + +This in turn yields $(a-1) b\beta$ denote the integers satisfying + +$$ +2^{\alpha}=b c-a \quad \text { and } \quad 2^{\beta}=a c-b +$$ + +If $\beta=0$ it would follow that $a c-b=a b-c=1$ and hence that $b=c=1$, which is absurd. So $\beta$ and $\alpha$ are positive and consequently $a$ and $b$ are even. Substituting $c=a b-1$ into (9) we obtain + +$$ +\begin{aligned} +2^{\alpha} & =a b^{2}-(a+b), \\ +\text { and } \quad 2^{\beta} & =a^{2} b-(a+b) . +\end{aligned} +$$ + +The addition of both equation yields $2^{\alpha}+2^{\beta}=(a b-2)(a+b)$. Now $a b-2$ is even but not divisible by 4 , so the highest power of 2 dividing $a+b$ is $2^{\beta-1}$. For this reason, the equations (10) and (11) show that the highest powers of 2 dividing either of the numbers $a b^{2}$ and $a^{2} b$ is likewise $2^{\beta-1}$. Thus there is an integer $\tau \geqslant 1$ together with odd integers $A, B$, and $C$ such that $a=2^{\tau} A, b=2^{\tau} B, a+b=2^{3 \tau} C$, and $\beta=1+3 \tau$. + +Notice that $A+B=2^{2 \tau} C \geqslant 4 C$. Moreover, (11) entails $A^{2} B-C=2$. Thus $8=$ $4 A^{2} B-4 C \geqslant 4 A^{2} B-A-B \geqslant A^{2}(3 B-1)$. Since $A$ and $B$ are odd with $A0$, this may be weakened to $p^{2} q+p-q \leqslant p+q$. Hence $p^{2} q \leqslant 2 q$, which is only possible if $p=1$. + +Going back to (13), we get + +$$ +\left(d^{2} q-q-1\right) \mid d^{2}(q-1) +$$ + +Now $2\left(d^{2} q-q-1\right) \leqslant d^{2}(q-1)$ would entail $d^{2}(q+1) \leqslant 2(q+1)$ and thus $d=1$. But this would tell us that $a=d p=1$, which is absurd. This argument proves $2\left(d^{2} q-q-1\right)>d^{2}(q-1)$ and in the light of (14) it follows that $d^{2} q-q-1=d^{2}(q-1)$, i.e., $q=d^{2}-1$. Plugging this together with $p=1$ into (12) we infer $2^{\beta}=d^{3}\left(d^{2}-2\right)$. Hence $d$ and $d^{2}-2$ are powers of 2 . Consequently, $d=2, q=3$, $a=2, b=6$, and $c=11$, as desired. + +N6. Let $\mathbb{Z}_{>0}$ denote the set of positive integers. Consider a function $f: \mathbb{Z}_{>0} \rightarrow \mathbb{Z}_{>0}$. For any $m, n \in \mathbb{Z}_{>0}$ we write $f^{n}(m)=\underbrace{f(f(\ldots f}_{n}(m) \ldots))$. Suppose that $f$ has the following two properties: +(i) If $m, n \in \mathbb{Z}_{>0}$, then $\frac{f^{n}(m)-m}{n} \in \mathbb{Z}_{>0}$; +(ii) The set $\mathbb{Z}_{>0} \backslash\left\{f(n) \mid n \in \mathbb{Z}_{>0}\right\}$ is finite. + +Prove that the sequence $f(1)-1, f(2)-2, f(3)-3, \ldots$ is periodic. +(Singapore) +Solution. We split the solution into three steps. In the first of them, we show that the function $f$ is injective and explain how this leads to a useful visualization of $f$. Then comes the second step, in which most of the work happens: its goal is to show that for any $n \in \mathbb{Z}_{>0}$ the sequence $n, f(n), f^{2}(n), \ldots$ is an arithmetic progression. Finally, in the third step we put everything together, thus solving the problem. +$\underline{\text { Step 1. We commence by checking that } f \text { is injective. For this purpose, we consider any }}$ $m, k \in \mathbb{Z}_{>0}$ with $f(m)=f(k)$. By $(i)$, every positive integer $n$ has the property that + +$$ +\frac{k-m}{n}=\frac{f^{n}(m)-m}{n}-\frac{f^{n}(k)-k}{n} +$$ + +is a difference of two integers and thus integral as well. But for $n=|k-m|+1$ this is only possible if $k=m$. Thereby, the injectivity of $f$ is established. + +Now recall that due to condition (ii) there are finitely many positive integers $a_{1}, \ldots, a_{k}$ such that $\mathbb{Z}_{>0}$ is the disjoint union of $\left\{a_{1}, \ldots, a_{k}\right\}$ and $\left\{f(n) \mid n \in \mathbb{Z}_{>0}\right\}$. Notice that by plugging $n=1$ into condition $(i)$ we get $f(m)>m$ for all $m \in \mathbb{Z}_{>0}$. + +We contend that every positive integer $n$ may be expressed uniquely in the form $n=f^{j}\left(a_{i}\right)$ for some $j \geqslant 0$ and $i \in\{1, \ldots, k\}$. The uniqueness follows from the injectivity of $f$. The existence can be proved by induction on $n$ in the following way. If $n \in\left\{a_{1}, \ldots, a_{k}\right\}$, then we may take $j=0$; otherwise there is some $n^{\prime} 0$; and $T=1$ and $A=0$ if $t=0$. For every integer $n \geqslant A$, the interval $\Delta_{n}=[n+1, n+T]$ contains exactly $T / T_{i}$ +elements of the $i^{\text {th }}$ row $(1 \leqslant i \leqslant t)$. Therefore, the number of elements from the last $(k-t)$ rows of the Table contained in $\Delta_{n}$ does not depend on $n \geqslant A$. It is not possible that none of these intervals $\Delta_{n}$ contains an element from the $k-t$ last rows, because infinitely many numbers appear in these rows. It follows that for each $n \geqslant A$ the interval $\Delta_{n}$ contains at least one member from these rows. + +This yields that for every positive integer $d$, the interval $[A+1, A+(d+1)(k-t) T]$ contains at least $(d+1)(k-t)$ elements from the last $k-t$ rows; therefore, there exists an index $x$ with $t+1 \leqslant x \leqslant k$, possibly depending on $d$, such that our interval contains at least $d+1$ elements from the $x^{\text {th }}$ row. In this situation we have + +$$ +f^{d}\left(a_{x}\right) \leqslant A+(d+1)(k-t) T . +$$ + +Finally, since there are finitely many possibilities for $x$, there exists an index $x \geqslant t+1$ such that the set + +$$ +X=\left\{d \in \mathbb{Z}_{>0} \mid f^{d}\left(a_{x}\right) \leqslant A+(d+1)(k-t) T\right\} +$$ + +is infinite. Thereby we have found the "dense row" promised above. +By assumption $(i)$, for every $d \in X$ the number + +$$ +\beta_{d}=\frac{f^{d}\left(a_{x}\right)-a_{x}}{d} +$$ + +is a positive integer not exceeding + +$$ +\frac{A+(d+1)(k-t) T}{d} \leqslant \frac{A d+2 d(k-t) T}{d}=A+2(k-t) T +$$ + +This leaves us with finitely many choices for $\beta_{d}$, which means that there exists a number $T_{x}$ such that the set + +$$ +Y=\left\{d \in X \mid \beta_{d}=T_{x}\right\} +$$ + +is infinite. Notice that we have $f^{d}\left(a_{x}\right)=a_{x}+d \cdot T_{x}$ for all $d \in Y$. +Now we are prepared to prove that the numbers in the $x^{\text {th }}$ row form an arithmetic progression, thus coming to a contradiction with our assumption. Let us fix any positive integer $j$. Since the set $Y$ is infinite, we can choose a number $y \in Y$ such that $y-j>\left|f^{j}\left(a_{x}\right)-\left(a_{x}+j T_{x}\right)\right|$. Notice that both numbers + +$$ +f^{y}\left(a_{x}\right)-f^{j}\left(a_{x}\right)=f^{y-j}\left(f^{j}\left(a_{x}\right)\right)-f^{j}\left(a_{x}\right) \quad \text { and } \quad f^{y}\left(a_{x}\right)-\left(a_{x}+j T_{x}\right)=(y-j) T_{x} +$$ + +are divisible by $y-j$. Thus, the difference between these numbers is also divisible by $y-j$. Since the absolute value of this difference is less than $y-j$, it has to vanish, so we get $f^{j}\left(a_{x}\right)=$ $a_{x}+j \cdot T_{x}$. + +Hence, it is indeed true that all rows of the Table are arithmetic progressions. +Step 3. Keeping the above notation in force, we denote the step of the $i^{\text {th }}$ row of the table by $T_{i}$. Now we claim that we have $f(n)-n=f(n+T)-(n+T)$ for all $n \in \mathbb{Z}_{>0}$, where + +$$ +T=\operatorname{lcm}\left(T_{1}, \ldots, T_{k}\right) +$$ + +To see this, let any $n \in \mathbb{Z}_{>0}$ be given and denote the index of the row in which it appears in the Table by $i$. Then we have $f^{j}(n)=n+j \cdot T_{i}$ for all $j \in \mathbb{Z}_{>0}$, and thus indeed + +$$ +f(n+T)-f(n)=f^{1+T / T_{i}}(n)-f(n)=\left(n+T+T_{i}\right)-\left(n+T_{i}\right)=T +$$ + +This concludes the solution. + +Comment 1. There are some alternative ways to complete the second part once the index $x$ corresponding to a "dense row" is found. For instance, one may show that for some integer $T_{x}^{*}$ the set + +$$ +Y^{*}=\left\{j \in \mathbb{Z}_{>0} \mid f^{j+1}\left(a_{x}\right)-f^{j}\left(a_{x}\right)=T_{x}^{*}\right\} +$$ + +is infinite, and then one may conclude with a similar divisibility argument. +Comment 2. It may be checked that, conversely, any way to fill out the Table with finitely many arithmetic progressions so that each positive integer appears exactly once, gives rise to a function $f$ satisfying the two conditions mentioned in the problem. For example, we may arrange the positive integers as follows: + +| 2 | 4 | 6 | 8 | 10 | $\ldots$ | +| :---: | :---: | :---: | :---: | :---: | :---: | +| 1 | 5 | 9 | 13 | 17 | $\ldots$ | +| 3 | 7 | 11 | 15 | 19 | $\ldots$ | + +This corresponds to the function + +$$ +f(n)= \begin{cases}n+2 & \text { if } n \text { is even } \\ n+4 & \text { if } n \text { is odd }\end{cases} +$$ + +As this example shows, it is not true that the function $n \mapsto f(n)-n$ has to be constant. + +N7. Let $\mathbb{Z}_{>0}$ denote the set of positive integers. For any positive integer $k$, a function $f: \mathbb{Z}_{>0} \rightarrow \mathbb{Z}_{>0}$ is called $k$-good if $\operatorname{gcd}(f(m)+n, f(n)+m) \leqslant k$ for all $m \neq n$. Find all $k$ such that there exists a $k$-good function. +(Canada) +Answer. $k \geqslant 2$. +Solution 1. For any function $f: \mathbb{Z}_{>0} \rightarrow \mathbb{Z}_{>0}$, let $G_{f}(m, n)=\operatorname{gcd}(f(m)+n, f(n)+m)$. Note that a $k$-good function is also $(k+1)$-good for any positive integer $k$. Hence, it suffices to show that there does not exist a 1-good function and that there exists a 2-good function. + +We first show that there is no 1 -good function. Suppose that there exists a function $f$ such that $G_{f}(m, n)=1$ for all $m \neq n$. Now, if there are two distinct even numbers $m$ and $n$ such that $f(m)$ and $f(n)$ are both even, then $2 \mid G_{f}(m, n)$, a contradiction. A similar argument holds if there are two distinct odd numbers $m$ and $n$ such that $f(m)$ and $f(n)$ are both odd. Hence we can choose an even $m$ and an odd $n$ such that $f(m)$ is odd and $f(n)$ is even. This also implies that $2 \mid G_{f}(m, n)$, a contradiction. + +We now construct a 2-good function. Define $f(n)=2^{g(n)+1}-n-1$, where $g$ is defined recursively by $g(1)=1$ and $g(n+1)=\left(2^{g(n)+1}\right)!$. + +For any positive integers $m>n$, set + +$$ +A=f(m)+n=2^{g(m)+1}-m+n-1, \quad B=f(n)+m=2^{g(n)+1}-n+m-1 +$$ + +We need to show that $\operatorname{gcd}(A, B) \leqslant 2$. First, note that $A+B=2^{g(m)+1}+2^{g(n)+1}-2$ is not divisible by 4 , so that $4 \nmid \operatorname{gcd}(A, B)$. Now we suppose that there is an odd prime $p$ for which $p \mid \operatorname{gcd}(A, B)$ and derive a contradiction. + +We first claim that $2^{g(m-1)+1} \geqslant B$. This is a rather weak bound; one way to prove it is as follows. Observe that $g(k+1)>g(k)$ and hence $2^{g(k+1)+1} \geqslant 2^{g(k)+1}+1$ for every positive integer $k$. By repeatedly applying this inequality, we obtain $2^{g(m-1)+1} \geqslant 2^{g(n)+1}+(m-1)-n=B$. + +Now, since $p \mid B$, we have $p-11$, introduce the set $X_{m}$ like in Solution 2 and define $f(m)$ so as to satisfy + +$$ +\begin{array}{rll} +f(m) \equiv f(m-p) & (\bmod p) & \text { for all } p \in X_{m} \text { with } p 10^{100}} \alpha_{i} . +$$ + +That is, $\mho(n)$ is the number of prime factors of $n$ greater than $10^{100}$, counted with multiplicity. +Find all strictly increasing functions $f: \mathbb{Z} \rightarrow \mathbb{Z}$ such that + +$$ +\mho(f(a)-f(b)) \leqslant \mho(a-b) \quad \text { for all integers } a \text { and } b \text { with } a>b . +$$ + +(Brazil) +Answer. $f(x)=a x+b$, where $b$ is an arbitrary integer, and $a$ is an arbitrary positive integer with $\mho(a)=0$. +Solution. A straightforward check shows that all the functions listed in the answer satisfy the problem condition. It remains to show the converse. + +Assume that $f$ is a function satisfying the problem condition. Notice that the function $g(x)=f(x)-f(0)$ also satisfies this condition. Replacing $f$ by $g$, we assume from now on that $f(0)=0$; then $f(n)>0$ for any positive integer $n$. Thus, we aim to prove that there exists a positive integer $a$ with $\mho(a)=0$ such that $f(n)=a n$ for all $n \in \mathbb{Z}$. + +We start by introducing some notation. Set $N=10^{100}$. We say that a prime $p$ is large if $p>N$, and $p$ is small otherwise; let $\mathcal{S}$ be the set of all small primes. Next, we say that a positive integer is large or small if all its prime factors are such (thus, the number 1 is the unique number which is both large and small). For a positive integer $k$, we denote the greatest large divisor of $k$ and the greatest small divisor of $k$ by $L(k)$ and $S(k)$, respectively; thus, $k=L(k) S(k)$. + +We split the proof into three steps. +Step 1. We prove that for every large $k$, we have $k|f(a)-f(b) \Longleftrightarrow k| a-b$. In other words, $L(f(a)-f(b))=L(a-b)$ for all integers $a$ and $b$ with $a>b$. + +We use induction on $k$. The base case $k=1$ is trivial. For the induction step, assume that $k_{0}$ is a large number, and that the statement holds for all large numbers $k$ with $k \ell$. But then + +$$ +\mho(f(x)-f(y)) \geqslant \mho\left(\operatorname{lcm}\left(k_{0}, \ell\right)\right)>\mho(\ell)=\mho(x-y), +$$ + +which is impossible. +Now we complete the induction step. By Claim 1, for every integer $a$ each of the sequences + +$$ +f(a), f(a+1), \ldots, f\left(a+k_{0}-1\right) \quad \text { and } \quad f(a+1), f(a+2), \ldots, f\left(a+k_{0}\right) +$$ + +forms a complete residue system modulo $k_{0}$. This yields $f(a) \equiv f\left(a+k_{0}\right)\left(\bmod k_{0}\right)$. Thus, $f(a) \equiv f(b)\left(\bmod k_{0}\right)$ whenever $a \equiv b\left(\bmod k_{0}\right)$. + +Finally, if $a \not \equiv b\left(\bmod k_{0}\right)$ then there exists an integer $b^{\prime}$ such that $b^{\prime} \equiv b\left(\bmod k_{0}\right)$ and $\left|a-b^{\prime}\right| N$. +Proof. Let $d$ be the product of all small primes, and let $\alpha$ be a positive integer such that $2^{\alpha}>f(N)$. Then, for every $p \in \mathcal{S}$ the numbers $f(0), f(1), \ldots, f(N)$ are distinct modulo $p^{\alpha}$. Set $P=d^{\alpha}$ and $c=P+f(N)$. + +Choose any integer $t>N$. Due to the choice of $\alpha$, for every $p \in \mathcal{S}$ there exists at most one nonnegative integer $i \leqslant N$ with $p^{\alpha} \mid f(t)-f(i)$. Since $|\mathcal{S}| |f(x)-a x|$. Since $n-x \equiv r-(r+1)=-1(\bmod N!)$, the number $|n-x|$ is large. Therefore, by Step 1 we have $f(x) \equiv f(n)=a n \equiv a x(\bmod n-x)$, so $n-x \mid f(x)-a x$. Due to the choice of $n$, this yields $f(x)=a x$. + +To complete Step 3, notice that the set $\mathcal{T}^{\prime}$ found in Step 2 contains infinitely many elements of some residue class $R_{i}$. Applying Claim 3, we successively obtain that $f(x)=a x$ for all $x \in R_{i+1}, R_{i+2}, \ldots, R_{i+N!}=R_{i}$. This finishes the solution. + +Comment 1. As the proposer also mentions, one may also consider the version of the problem where the condition (1) is replaced by the condition that $L(f(a)-f(b))=L(a-b)$ for all integers $a$ and $b$ with $a>b$. This allows to remove of Step 1 from the solution. + +Comment 2. Step 2 is the main step of the solution. We sketch several different approaches allowing to perform this step using statements which are weaker than Claim 2. +Approach 1. Let us again denote the product of all small primes by $d$. We focus on the values $f\left(d^{i}\right)$, $i \geqslant 0$. In view of Step 1, we have $L\left(f\left(d^{i}\right)-f\left(d^{k}\right)\right)=L\left(d^{i}-d^{k}\right)=d^{i-k}-1$ for all $i>k \geqslant 0$. + +Acting similarly to the beginning of the proof of Claim 2, one may choose a number $\alpha \geqslant 0$ such that the residues of the numbers $f\left(d^{i}\right), i=0,1, \ldots, N$, are distinct modulo $p^{\alpha}$ for each $p \in \mathcal{S}$. Then, for every $i>N$, there exists an exponent $k=k(i) \leqslant N$ such that $S\left(f\left(d^{i}\right)-f\left(d^{k}\right)\right) N$ such that $k(i)$ attains the same value $k_{0}$ for all $i \in I$, and such that, moreover, $S\left(f\left(d^{i}\right)-f\left(d^{k_{0}}\right)\right)$ attains the same value $s_{0}$ for all $i \in I$. Therefore, for all such $i$ we have + +$$ +f\left(d^{i}\right)=f\left(d^{k_{0}}\right)+L\left(f\left(d^{i}\right)-f\left(d^{k_{0}}\right)\right) \cdot S\left(f\left(d^{i}\right)-f\left(d^{k_{0}}\right)\right)=f\left(d^{k_{0}}\right)+\left(d^{i-k_{0}}-1\right) s_{0}, +$$ + +which means that $f$ is linear on the infinite set $\left\{d^{i}: i \in I\right\}$ (although with rational coefficients). +Finally, one may implement the relation $f\left(d^{i}\right) \equiv f(1)\left(\bmod d^{i}-1\right)$ in order to establish that in fact $f\left(d^{i}\right) / d^{i}$ is a (small and fixed) integer for all $i \in I$. + +Approach 2. Alternatively, one may start with the following lemma. +Lemma. There exists a positive constant $c$ such that + +$$ +L\left(\prod_{i=1}^{3 N}(f(k)-f(i))\right)=\prod_{i=1}^{3 N} L(f(k)-f(i)) \geqslant c(f(k))^{2 N} +$$ + +for all $k>3 N$. +Proof. Let $k$ be an integer with $k>3 N$. Set $\Pi=\prod_{i=1}^{3 N}(f(k)-f(i))$. +Notice that for every prime $p \in \mathcal{S}$, at most one of the numbers in the set + +$$ +\mathcal{H}=\{f(k)-f(i): 1 \leqslant i \leqslant 3 N\} +$$ + +is divisible by a power of $p$ which is greater than $f(3 N)$; we say that such elements of $\mathcal{H}$ are bad. Now, for each element $h \in \mathcal{H}$ which is not bad we have $S(h) \leqslant f(3 N)^{N}$, while the bad elements do not exceed $f(k)$. Moreover, there are less than $N$ bad elements in $\mathcal{H}$. Therefore, + +$$ +S(\Pi)=\prod_{h \in \mathcal{H}} S(h) \leqslant(f(3 N))^{3 N^{2}} \cdot(f(k))^{N} . +$$ + +This easily yields the lemma statement in view of the fact that $L(\Pi) S(\Pi)=\Pi \geqslant \mu(f(k))^{3 N}$ for some absolute constant $\mu$. + +As a corollary of the lemma, one may get a weaker version of Claim 2 stating that there exists a positive constant $C$ such that $f(k) \leqslant C k^{3 / 2}$ for all $k>3 N$. Indeed, from Step 1 we have + +$$ +k^{3 N} \geqslant \prod_{i=1}^{3 N} L(k-i)=\prod_{i=1}^{3 N} L(f(k)-f(i)) \geqslant c(f(k))^{2 N} +$$ + +so $f(k) \leqslant c^{-1 /(2 N)} k^{3 / 2}$. +To complete Step 2 now, set $a=f(1)$. Due to the estimates above, we may choose a positive integer $n_{0}$ such that $|f(n)-a n|<\frac{n(n-1)}{2}$ for all $n \geqslant n_{0}$. + +Take any $n \geqslant n_{0}$ with $n \equiv 2(\bmod N!)$. Then $L(f(n)-f(0))=L(n)=n / 2$ and $L(f(n)-f(1))=$ $L(n-1)=n-1$; these relations yield $f(n) \equiv f(0)=0 \equiv a n(\bmod n / 2)$ and $f(n) \equiv f(1)=a \equiv a n$ $(\bmod n-1)$, respectively. Thus, $\left.\frac{n(n-1)}{2} \right\rvert\, f(n)-a n$, which shows that $f(n)=a n$ in view of the estimate above. + +Comment 3. In order to perform Step 3, it suffices to establish the equality $f(n)=a n$ for any infinite set of values of $n$. However, if this set has some good structure, then one may find easier ways to complete this step. + +For instance, after showing, as in Approach 2 , that $f(n)=$ an for all $n \geqslant n_{0}$ with $n \equiv 2(\bmod N!)$, one may proceed as follows. Pick an arbitrary integer $x$ and take any large prime $p$ which is greater than $|f(x)-a x|$. By the Chinese Remainder Theorem, there exists a positive integer $n>\max \left(x, n_{0}\right)$ such that $n \equiv 2(\bmod N!)$ and $n \equiv x(\bmod p)$. By Step 1 , we have $f(x) \equiv f(n)=a n \equiv a x(\bmod p)$. Due to the choice of $p$, this is possible only if $f(x)=a x$. + +## CHIANG MAI, THAILAND 4-16 JULY 2015 + diff --git a/IMO/md/en-IMO2016SL.md b/IMO/md/en-IMO2016SL.md new file mode 100644 index 0000000000000000000000000000000000000000..318e37609f72f693af2a4a947a8093982fab1325 --- /dev/null +++ b/IMO/md/en-IMO2016SL.md @@ -0,0 +1,2426 @@ +## Shortlisted Problems with Solutions $57^{\text {th }}$ International Mathematical Olympiad Hong Kong, 2016 + +## Note of Confidentiality + +## The shortlisted problems should be kept strictly confidential until IMO 2017. + +## Contributing Countries + +The Organising Committee and the Problem Selection Committee of IMO 2016 thank the following 40 countries for contributing 121 problem proposals: + +Albania, Algeria, Armenia, Australia, Austria, Belarus, Belgium, Bulgaria, Colombia, Cyprus, Czech Republic, Denmark, Estonia, France, Georgia, Greece, Iceland, India, Iran, Ireland, Israel, Japan, Latvia, Luxembourg, Malaysia, Mexico, Mongolia, Netherlands, Philippines, Russia, Serbia, Slovakia, Slovenia, South Africa, Taiwan, Tanzania, Thailand, Trinidad and Tobago, Turkey, Ukraine. + +## Problem Selection Committee + + + +Front row from left: Yong-Gao Chen, Andy Liu, Tat Wing Leung (Chairman). +Back row from left: Yi-Jun Yao, Yun-Hao Fu, Yi-Jie He, +Zhongtao Wu, Heung Wing Joseph Lee, Chi Hong Chow, +Ka Ho Law, Tak Wing Ching. + +## Problems + +## Algebra + +A1. Let $a, b$ and $c$ be positive real numbers such that $\min \{a b, b c, c a\} \geqslant 1$. Prove that + +$$ +\sqrt[3]{\left(a^{2}+1\right)\left(b^{2}+1\right)\left(c^{2}+1\right)} \leqslant\left(\frac{a+b+c}{3}\right)^{2}+1 +$$ + +A2. Find the smallest real constant $C$ such that for any positive real numbers $a_{1}, a_{2}, a_{3}, a_{4}$ and $a_{5}$ (not necessarily distinct), one can always choose distinct subscripts $i, j, k$ and $l$ such that + +$$ +\left|\frac{a_{i}}{a_{j}}-\frac{a_{k}}{a_{l}}\right| \leqslant C +$$ + +A3. Find all integers $n \geqslant 3$ with the following property: for all real numbers $a_{1}, a_{2}, \ldots, a_{n}$ and $b_{1}, b_{2}, \ldots, b_{n}$ satisfying $\left|a_{k}\right|+\left|b_{k}\right|=1$ for $1 \leqslant k \leqslant n$, there exist $x_{1}, x_{2}, \ldots, x_{n}$, each of which is either -1 or 1 , such that + +$$ +\left|\sum_{k=1}^{n} x_{k} a_{k}\right|+\left|\sum_{k=1}^{n} x_{k} b_{k}\right| \leqslant 1 +$$ + +A4. Denote by $\mathbb{R}^{+}$the set of all positive real numbers. Find all functions $f: \mathbb{R}^{+} \rightarrow \mathbb{R}^{+}$such that + +$$ +x f\left(x^{2}\right) f(f(y))+f(y f(x))=f(x y)\left(f\left(f\left(x^{2}\right)\right)+f\left(f\left(y^{2}\right)\right)\right) +$$ + +for all positive real numbers $x$ and $y$. + +## A5. + +(a) Prove that for every positive integer $n$, there exists a fraction $\frac{a}{b}$ where $a$ and $b$ are integers satisfying $0k$, and announces them to the deputy leader and a contestant. The leader then secretly tells the deputy leader an $n$-digit binary string, and the deputy leader writes down all $n$-digit binary strings which differ from the leader's in exactly $k$ positions. (For example, if $n=3$ and $k=1$, and if the leader chooses 101, the deputy leader would write down 001, 111 and 100.) The contestant is allowed to look at the strings written by the deputy leader and guess the leader's string. What is the minimum number of guesses (in terms of $n$ and $k$ ) needed to guarantee the correct answer? + +C2. Find all positive integers $n$ for which all positive divisors of $n$ can be put into the cells of a rectangular table under the following constraints: + +- each cell contains a distinct divisor; +- the sums of all rows are equal; and +- the sums of all columns are equal. + +C3. Let $n$ be a positive integer relatively prime to 6 . We paint the vertices of a regular $n$-gon with three colours so that there is an odd number of vertices of each colour. Show that there exists an isosceles triangle whose three vertices are of different colours. +$\mathbf{C 4}$. Find all positive integers $n$ for which we can fill in the entries of an $n \times n$ table with the following properties: + +- each entry can be one of $I, M$ and $O$; +- in each row and each column, the letters $I, M$ and $O$ occur the same number of times; and +- in any diagonal whose number of entries is a multiple of three, the letters $I, M$ and $O$ occur the same number of times. + +C5. Let $n \geqslant 3$ be a positive integer. Find the maximum number of diagonals of a regular $n$-gon one can select, so that any two of them do not intersect in the interior or they are perpendicular to each other. + +C6. There are $n \geqslant 3$ islands in a city. Initially, the ferry company offers some routes between some pairs of islands so that it is impossible to divide the islands into two groups such that no two islands in different groups are connected by a ferry route. + +After each year, the ferry company will close a ferry route between some two islands $X$ and $Y$. At the same time, in order to maintain its service, the company will open new routes according to the following rule: for any island which is connected by a ferry route to exactly one of $X$ and $Y$, a new route between this island and the other of $X$ and $Y$ is added. + +Suppose at any moment, if we partition all islands into two nonempty groups in any way, then it is known that the ferry company will close a certain route connecting two islands from the two groups after some years. Prove that after some years there will be an island which is connected to all other islands by ferry routes. + +C7. Let $n \geqslant 2$ be an integer. In the plane, there are $n$ segments given in such a way that any two segments have an intersection point in the interior, and no three segments intersect at a single point. Jeff places a snail at one of the endpoints of each of the segments and claps his hands $n-1$ times. Each time when he claps his hands, all the snails move along their own segments and stay at the next intersection points until the next clap. Since there are $n-1$ intersection points on each segment, all snails will reach the furthest intersection points from their starting points after $n-1$ claps. +(a) Prove that if $n$ is odd then Jeff can always place the snails so that no two of them ever occupy the same intersection point. +(b) Prove that if $n$ is even then there must be a moment when some two snails occupy the same intersection point no matter how Jeff places the snails. + +C8. Let $n$ be a positive integer. Determine the smallest positive integer $k$ with the following property: it is possible to mark $k$ cells on a $2 n \times 2 n$ board so that there exists a unique partition of the board into $1 \times 2$ and $2 \times 1$ dominoes, none of which contains two marked cells. + +## Geometry + +G1. In a convex pentagon $A B C D E$, let $F$ be a point on $A C$ such that $\angle F B C=90^{\circ}$. Suppose triangles $A B F, A C D$ and $A D E$ are similar isosceles triangles with + +$$ +\angle F A B=\angle F B A=\angle D A C=\angle D C A=\angle E A D=\angle E D A +$$ + +Let $M$ be the midpoint of $C F$. Point $X$ is chosen such that $A M X E$ is a parallelogram. Show that $B D, E M$ and $F X$ are concurrent. + +G2. Let $A B C$ be a triangle with circumcircle $\Gamma$ and incentre $I$. Let $M$ be the midpoint of side $B C$. Denote by $D$ the foot of perpendicular from $I$ to side $B C$. The line through $I$ perpendicular to $A I$ meets sides $A B$ and $A C$ at $F$ and $E$ respectively. Suppose the circumcircle of triangle $A E F$ intersects $\Gamma$ at a point $X$ other than $A$. Prove that lines $X D$ and $A M$ meet on $\Gamma$. + +G3. Let $B=(-1,0)$ and $C=(1,0)$ be fixed points on the coordinate plane. A nonempty, bounded subset $S$ of the plane is said to be nice if +(i) there is a point $T$ in $S$ such that for every point $Q$ in $S$, the segment $T Q$ lies entirely in $S$; and +(ii) for any triangle $P_{1} P_{2} P_{3}$, there exists a unique point $A$ in $S$ and a permutation $\sigma$ of the indices $\{1,2,3\}$ for which triangles $A B C$ and $P_{\sigma(1)} P_{\sigma(2)} P_{\sigma(3)}$ are similar. + +Prove that there exist two distinct nice subsets $S$ and $S^{\prime}$ of the set $\{(x, y): x \geqslant 0, y \geqslant 0\}$ such that if $A \in S$ and $A^{\prime} \in S^{\prime}$ are the unique choices of points in (ii), then the product $B A \cdot B A^{\prime}$ is a constant independent of the triangle $P_{1} P_{2} P_{3}$. + +G4. Let $A B C$ be a triangle with $A B=A C \neq B C$ and let $I$ be its incentre. The line $B I$ meets $A C$ at $D$, and the line through $D$ perpendicular to $A C$ meets $A I$ at $E$. Prove that the reflection of $I$ in $A C$ lies on the circumcircle of triangle $B D E$. + +G5. Let $D$ be the foot of perpendicular from $A$ to the Euler line (the line passing through the circumcentre and the orthocentre) of an acute scalene triangle $A B C$. A circle $\omega$ with centre $S$ passes through $A$ and $D$, and it intersects sides $A B$ and $A C$ at $X$ and $Y$ respectively. Let $P$ be the foot of altitude from $A$ to $B C$, and let $M$ be the midpoint of $B C$. Prove that the circumcentre of triangle $X S Y$ is equidistant from $P$ and $M$. + +G6. Let $A B C D$ be a convex quadrilateral with $\angle A B C=\angle A D C<90^{\circ}$. The internal angle bisectors of $\angle A B C$ and $\angle A D C$ meet $A C$ at $E$ and $F$ respectively, and meet each other at point $P$. Let $M$ be the midpoint of $A C$ and let $\omega$ be the circumcircle of triangle $B P D$. Segments $B M$ and $D M$ intersect $\omega$ again at $X$ and $Y$ respectively. Denote by $Q$ the intersection point of lines $X E$ and $Y F$. Prove that $P Q \perp A C$. + +G7. Let $I$ be the incentre of a non-equilateral triangle $A B C, I_{A}$ be the $A$-excentre, $I_{A}^{\prime}$ be the reflection of $I_{A}$ in $B C$, and $l_{A}$ be the reflection of line $A I_{A}^{\prime}$ in $A I$. Define points $I_{B}, I_{B}^{\prime}$ and line $l_{B}$ analogously. Let $P$ be the intersection point of $l_{A}$ and $l_{B}$. +(a) Prove that $P$ lies on line $O I$ where $O$ is the circumcentre of triangle $A B C$. +(b) Let one of the tangents from $P$ to the incircle of triangle $A B C$ meet the circumcircle at points $X$ and $Y$. Show that $\angle X I Y=120^{\circ}$. + +G8. Let $A_{1}, B_{1}$ and $C_{1}$ be points on sides $B C, C A$ and $A B$ of an acute triangle $A B C$ respectively, such that $A A_{1}, B B_{1}$ and $C C_{1}$ are the internal angle bisectors of triangle $A B C$. Let $I$ be the incentre of triangle $A B C$, and $H$ be the orthocentre of triangle $A_{1} B_{1} C_{1}$. Show that + +$$ +A H+B H+C H \geqslant A I+B I+C I +$$ + +## Number Theory + +N1. For any positive integer $k$, denote the sum of digits of $k$ in its decimal representation by $S(k)$. Find all polynomials $P(x)$ with integer coefficients such that for any positive integer $n \geqslant 2016$, the integer $P(n)$ is positive and + +$$ +S(P(n))=P(S(n)) +$$ + +N2. Let $\tau(n)$ be the number of positive divisors of $n$. Let $\tau_{1}(n)$ be the number of positive divisors of $n$ which have remainders 1 when divided by 3 . Find all possible integral values of the fraction $\frac{\tau(10 n)}{\tau_{1}(10 n)}$. + +N3. Define $P(n)=n^{2}+n+1$. For any positive integers $a$ and $b$, the set + +$$ +\{P(a), P(a+1), P(a+2), \ldots, P(a+b)\} +$$ + +is said to be fragrant if none of its elements is relatively prime to the product of the other elements. Determine the smallest size of a fragrant set. + +N4. Let $n, m, k$ and $l$ be positive integers with $n \neq 1$ such that $n^{k}+m n^{l}+1$ divides $n^{k+l}-1$. Prove that + +- $m=1$ and $l=2 k$; or +- $l \mid k$ and $m=\frac{n^{k-l}-1}{n^{l}-1}$. + +N5. Let $a$ be a positive integer which is not a square number. Denote by $A$ the set of all positive integers $k$ such that + +$$ +k=\frac{x^{2}-a}{x^{2}-y^{2}} +$$ + +for some integers $x$ and $y$ with $x>\sqrt{a}$. Denote by $B$ the set of all positive integers $k$ such that (1) is satisfied for some integers $x$ and $y$ with $0 \leqslant x<\sqrt{a}$. Prove that $A=B$. + +N6. Denote by $\mathbb{N}$ the set of all positive integers. Find all functions $f: \mathbb{N} \rightarrow \mathbb{N}$ such that for all positive integers $m$ and $n$, the integer $f(m)+f(n)-m n$ is nonzero and divides $m f(m)+n f(n)$. + +N7. Let $n$ be an odd positive integer. In the Cartesian plane, a cyclic polygon $P$ with area $S$ is chosen. All its vertices have integral coordinates, and all squares of its side lengths are divisible by $n$. Prove that $2 S$ is an integer divisible by $n$. + +N8. Find all polynomials $P(x)$ of odd degree $d$ and with integer coefficients satisfying the following property: for each positive integer $n$, there exist $n$ positive integers $x_{1}, x_{2}, \ldots, x_{n}$ such that $\frac{1}{2}<\frac{P\left(x_{i}\right)}{P\left(x_{j}\right)}<2$ and $\frac{P\left(x_{i}\right)}{P\left(x_{j}\right)}$ is the $d$-th power of a rational number for every pair of indices $i$ and $j$ with $1 \leqslant i, j \leqslant n$. + +## Solutions + +## Algebra + +A1. Let $a, b$ and $c$ be positive real numbers such that $\min \{a b, b c, c a\} \geqslant 1$. Prove that + +$$ +\sqrt[3]{\left(a^{2}+1\right)\left(b^{2}+1\right)\left(c^{2}+1\right)} \leqslant\left(\frac{a+b+c}{3}\right)^{2}+1 +$$ + +Solution 1. We first show the following. + +- Claim. For any positive real numbers $x, y$ with $x y \geqslant 1$, we have + +$$ +\left(x^{2}+1\right)\left(y^{2}+1\right) \leqslant\left(\left(\frac{x+y}{2}\right)^{2}+1\right)^{2} +$$ + +Proof. Note that $x y \geqslant 1$ implies $\left(\frac{x+y}{2}\right)^{2}-1 \geqslant x y-1 \geqslant 0$. We find that $\left(x^{2}+1\right)\left(y^{2}+1\right)=(x y-1)^{2}+(x+y)^{2} \leqslant\left(\left(\frac{x+y}{2}\right)^{2}-1\right)^{2}+(x+y)^{2}=\left(\left(\frac{x+y}{2}\right)^{2}+1\right)^{2}$. + +Without loss of generality, assume $a \geqslant b \geqslant c$. This implies $a \geqslant 1$. Let $d=\frac{a+b+c}{3}$. Note that + +$$ +a d=\frac{a(a+b+c)}{3} \geqslant \frac{1+1+1}{3}=1 . +$$ + +Then we can apply (2) to the pair $(a, d)$ and the pair $(b, c)$. We get + +$$ +\left(a^{2}+1\right)\left(d^{2}+1\right)\left(b^{2}+1\right)\left(c^{2}+1\right) \leqslant\left(\left(\frac{a+d}{2}\right)^{2}+1\right)^{2}\left(\left(\frac{b+c}{2}\right)^{2}+1\right)^{2} +$$ + +Next, from + +$$ +\frac{a+d}{2} \cdot \frac{b+c}{2} \geqslant \sqrt{a d} \cdot \sqrt{b c} \geqslant 1 +$$ + +we can apply (2) again to the pair $\left(\frac{a+d}{2}, \frac{b+c}{2}\right)$. Together with (3), we have + +$$ +\left(a^{2}+1\right)\left(d^{2}+1\right)\left(b^{2}+1\right)\left(c^{2}+1\right) \leqslant\left(\left(\frac{a+b+c+d}{4}\right)^{2}+1\right)^{4}=\left(d^{2}+1\right)^{4} +$$ + +Therefore, $\left(a^{2}+1\right)\left(b^{2}+1\right)\left(c^{2}+1\right) \leqslant\left(d^{2}+1\right)^{3}$, and (1) follows by taking cube root of both sides. + +Comment. After justifying the Claim, one may also obtain (1) by mixing variables. Indeed, the function involved is clearly continuous, and hence it suffices to check that the condition $x y \geqslant 1$ is preserved under each mixing step. This is true since whenever $a b, b c, c a \geqslant 1$, we have + +$$ +\frac{a+b}{2} \cdot \frac{a+b}{2} \geqslant a b \geqslant 1 \quad \text { and } \quad \frac{a+b}{2} \cdot c \geqslant \frac{1+1}{2}=1 . +$$ + +Solution 2. Let $f(x)=\ln \left(1+x^{2}\right)$. Then the inequality (1) to be shown is equivalent to + +$$ +\frac{f(a)+f(b)+f(c)}{3} \leqslant f\left(\frac{a+b+c}{3}\right), +$$ + +while (2) becomes + +$$ +\frac{f(x)+f(y)}{2} \leqslant f\left(\frac{x+y}{2}\right) +$$ + +for $x y \geqslant 1$. +Without loss of generality, assume $a \geqslant b \geqslant c$. From the Claim in Solution 1, we have + +$$ +\frac{f(a)+f(b)+f(c)}{3} \leqslant \frac{f(a)+2 f\left(\frac{b+c}{2}\right)}{3} . +$$ + +Note that $a \geqslant 1$ and $\frac{b+c}{2} \geqslant \sqrt{b c} \geqslant 1$. Since + +$$ +f^{\prime \prime}(x)=\frac{2\left(1-x^{2}\right)}{\left(1+x^{2}\right)^{2}} +$$ + +we know that $f$ is concave on $[1, \infty)$. Then we can apply Jensen's Theorem to get + +$$ +\frac{f(a)+2 f\left(\frac{b+c}{2}\right)}{3} \leqslant f\left(\frac{a+2 \cdot \frac{b+c}{2}}{3}\right)=f\left(\frac{a+b+c}{3}\right) . +$$ + +This completes the proof. + +A2. Find the smallest real constant $C$ such that for any positive real numbers $a_{1}, a_{2}, a_{3}, a_{4}$ and $a_{5}$ (not necessarily distinct), one can always choose distinct subscripts $i, j, k$ and $l$ such that + +$$ +\left|\frac{a_{i}}{a_{j}}-\frac{a_{k}}{a_{l}}\right| \leqslant C . +$$ + +Answer. The smallest $C$ is $\frac{1}{2}$. +Solution. We first show that $C \leqslant \frac{1}{2}$. For any positive real numbers $a_{1} \leqslant a_{2} \leqslant a_{3} \leqslant a_{4} \leqslant a_{5}$, consider the five fractions + +$$ +\frac{a_{1}}{a_{2}}, \frac{a_{3}}{a_{4}}, \frac{a_{1}}{a_{5}}, \frac{a_{2}}{a_{3}}, \frac{a_{4}}{a_{5}} . +$$ + +Each of them lies in the interval $(0,1]$. Therefore, by the Pigeonhole Principle, at least three of them must lie in $\left(0, \frac{1}{2}\right]$ or lie in $\left(\frac{1}{2}, 1\right]$ simultaneously. In particular, there must be two consecutive terms in (2) which belong to an interval of length $\frac{1}{2}$ (here, we regard $\frac{a_{1}}{a_{2}}$ and $\frac{a_{4}}{a_{5}}$ as consecutive). In other words, the difference of these two fractions is less than $\frac{1}{2}$. As the indices involved in these two fractions are distinct, we can choose them to be $i, j, k, l$ and conclude that $C \leqslant \frac{1}{2}$. + +Next, we show that $C=\frac{1}{2}$ is best possible. Consider the numbers $1,2,2,2, n$ where $n$ is a large real number. The fractions formed by two of these numbers in ascending order are $\frac{1}{n}, \frac{2}{n}, \frac{1}{2}, \frac{2}{2}, \frac{2}{1}, \frac{n}{2}, \frac{n}{1}$. Since the indices $i, j, k, l$ are distinct, $\frac{1}{n}$ and $\frac{2}{n}$ cannot be chosen simultaneously. Therefore the minimum value of the left-hand side of (1) is $\frac{1}{2}-\frac{2}{n}$. When $n$ tends to infinity, this value approaches $\frac{1}{2}$, and so $C$ cannot be less than $\frac{1}{2}$. + +These conclude that $C=\frac{1}{2}$ is the smallest possible choice. +Comment. The conclusion still holds if $a_{1}, a_{2}, \ldots, a_{5}$ are pairwise distinct, since in the construction, we may replace the 2's by real numbers sufficiently close to 2 . + +There are two possible simplifications for this problem: +(i) the answer $C=\frac{1}{2}$ is given to the contestants; or +(ii) simply ask the contestants to prove the inequality (1) for $C=\frac{1}{2}$. + +A3. Find all integers $n \geqslant 3$ with the following property: for all real numbers $a_{1}, a_{2}, \ldots, a_{n}$ and $b_{1}, b_{2}, \ldots, b_{n}$ satisfying $\left|a_{k}\right|+\left|b_{k}\right|=1$ for $1 \leqslant k \leqslant n$, there exist $x_{1}, x_{2}, \ldots, x_{n}$, each of which is either -1 or 1 , such that + +$$ +\left|\sum_{k=1}^{n} x_{k} a_{k}\right|+\left|\sum_{k=1}^{n} x_{k} b_{k}\right| \leqslant 1 +$$ + +Answer. $n$ can be any odd integer greater than or equal to 3 . +Solution 1. For any even integer $n \geqslant 4$, we consider the case + +$$ +a_{1}=a_{2}=\cdots=a_{n-1}=b_{n}=0 \quad \text { and } \quad b_{1}=b_{2}=\cdots=b_{n-1}=a_{n}=1 +$$ + +The condition $\left|a_{k}\right|+\left|b_{k}\right|=1$ is satisfied for each $1 \leqslant k \leqslant n$. No matter how we choose each $x_{k}$, both sums $\sum_{k=1}^{n} x_{k} a_{k}$ and $\sum_{k=1}^{n} x_{k} b_{k}$ are odd integers. This implies $\left|\sum_{k=1}^{n} x_{k} a_{k}\right| \geqslant 1$ and $\left|\sum_{k=1}^{n} x_{k} b_{k}\right| \geqslant 1$, which shows (1) cannot hold. + +For any odd integer $n \geqslant 3$, we may assume without loss of generality $b_{k} \geqslant 0$ for $1 \leqslant k \leqslant n$ (this can be done by flipping the pair $\left(a_{k}, b_{k}\right)$ to $\left(-a_{k},-b_{k}\right)$ and $x_{k}$ to $-x_{k}$ if necessary) and $a_{1} \geqslant a_{2} \geqslant \cdots \geqslant a_{m} \geqslant 0>a_{m+1} \geqslant \cdots \geqslant a_{n}$. We claim that the choice $x_{k}=(-1)^{k+1}$ for $1 \leqslant k \leqslant n$ will work. Define + +$$ +s=\sum_{k=1}^{m} x_{k} a_{k} \quad \text { and } \quad t=-\sum_{k=m+1}^{n} x_{k} a_{k} . +$$ + +Note that + +$$ +s=\left(a_{1}-a_{2}\right)+\left(a_{3}-a_{4}\right)+\cdots \geqslant 0 +$$ + +by the assumption $a_{1} \geqslant a_{2} \geqslant \cdots \geqslant a_{m}$ (when $m$ is odd, there is a single term $a_{m}$ at the end, which is also positive). Next, we have + +$$ +s=a_{1}-\left(a_{2}-a_{3}\right)-\left(a_{4}-a_{5}\right)-\cdots \leqslant a_{1} \leqslant 1 +$$ + +Similarly, + +$$ +t=\left(-a_{n}+a_{n-1}\right)+\left(-a_{n-2}+a_{n-3}\right)+\cdots \geqslant 0 +$$ + +and + +$$ +t=-a_{n}+\left(a_{n-1}-a_{n-2}\right)+\left(a_{n-3}-a_{n-4}\right)+\cdots \leqslant-a_{n} \leqslant 1 . +$$ + +From the condition, we have $a_{k}+b_{k}=1$ for $1 \leqslant k \leqslant m$ and $-a_{k}+b_{k}=1$ for $m+1 \leqslant k \leqslant n$. It follows that $\sum_{k=1}^{n} x_{k} a_{k}=s-t$ and $\sum_{k=1}^{n} x_{k} b_{k}=1-s-t$. Hence it remains to prove + +$$ +|s-t|+|1-s-t| \leqslant 1 +$$ + +under the constraint $0 \leqslant s, t \leqslant 1$. By symmetry, we may assume $s \geqslant t$. If $1-s-t \geqslant 0$, then we have + +$$ +|s-t|+|1-s-t|=s-t+1-s-t=1-2 t \leqslant 1 +$$ + +If $1-s-t \leqslant 0$, then we have + +$$ +|s-t|+|1-s-t|=s-t-1+s+t=2 s-1 \leqslant 1 +$$ + +Hence, the inequality is true in both cases. +These show $n$ can be any odd integer greater than or equal to 3 . + +Solution 2. The even case can be handled in the same way as Solution 1. For the odd case, we prove by induction on $n$. + +Firstly, for $n=3$, we may assume without loss of generality $a_{1} \geqslant a_{2} \geqslant a_{3} \geqslant 0$ and $b_{1}=a_{1}-1$ (if $b_{1}=1-a_{1}$, we may replace each $b_{k}$ by $-b_{k}$ ). + +- Case 1. $b_{2}=a_{2}-1$ and $b_{3}=a_{3}-1$, in which case we take $\left(x_{1}, x_{2}, x_{3}\right)=(1,-1,1)$. + +Let $c=a_{1}-a_{2}+a_{3}$ so that $0 \leqslant c \leqslant 1$. Then $\left|b_{1}-b_{2}+b_{3}\right|=\left|a_{1}-a_{2}+a_{3}-1\right|=1-c$ and hence $|c|+\left|b_{1}-b_{2}+b_{3}\right|=1$. + +- Case 2. $b_{2}=1-a_{2}$ and $b_{3}=1-a_{3}$, in which case we take $\left(x_{1}, x_{2}, x_{3}\right)=(1,-1,1)$. + +Let $c=a_{1}-a_{2}+a_{3}$ so that $0 \leqslant c \leqslant 1$. Since $a_{3} \leqslant a_{2}$ and $a_{1} \leqslant 1$, we have + +$$ +c-1 \leqslant b_{1}-b_{2}+b_{3}=a_{1}+a_{2}-a_{3}-1 \leqslant 1-c +$$ + +This gives $\left|b_{1}-b_{2}+b_{3}\right| \leqslant 1-c$ and hence $|c|+\left|b_{1}-b_{2}+b_{3}\right| \leqslant 1$. + +- Case 3. $b_{2}=a_{2}-1$ and $b_{3}=1-a_{3}$, in which case we take $\left(x_{1}, x_{2}, x_{3}\right)=(-1,1,1)$. + +Let $c=-a_{1}+a_{2}+a_{3}$. If $c \geqslant 0$, then $a_{3} \leqslant 1$ and $a_{2} \leqslant a_{1}$ imply + +$$ +c-1 \leqslant-b_{1}+b_{2}+b_{3}=-a_{1}+a_{2}-a_{3}+1 \leqslant 1-c +$$ + +If $c<0$, then $a_{1} \leqslant a_{2}+1$ and $a_{3} \geqslant 0$ imply + +$$ +-c-1 \leqslant-b_{1}+b_{2}+b_{3}=-a_{1}+a_{2}-a_{3}+1 \leqslant 1+c +$$ + +In both cases, we get $\left|-b_{1}+b_{2}+b_{3}\right| \leqslant 1-|c|$ and hence $|c|+\left|-b_{1}+b_{2}+b_{3}\right| \leqslant 1$. + +- Case 4. $b_{2}=1-a_{2}$ and $b_{3}=a_{3}-1$, in which case we take $\left(x_{1}, x_{2}, x_{3}\right)=(-1,1,1)$. + +Let $c=-a_{1}+a_{2}+a_{3}$. If $c \geqslant 0$, then $a_{2} \leqslant 1$ and $a_{3} \leqslant a_{1}$ imply + +$$ +c-1 \leqslant-b_{1}+b_{2}+b_{3}=-a_{1}-a_{2}+a_{3}+1 \leqslant 1-c +$$ + +If $c<0$, then $a_{1} \leqslant a_{3}+1$ and $a_{2} \geqslant 0$ imply + +$$ +-c-1 \leqslant-b_{1}+b_{2}+b_{3}=-a_{1}-a_{2}+a_{3}+1 \leqslant 1+c +$$ + +In both cases, we get $\left|-b_{1}+b_{2}+b_{3}\right| \leqslant 1-|c|$ and hence $|c|+\left|-b_{1}+b_{2}+b_{3}\right| \leqslant 1$. +We have found $x_{1}, x_{2}, x_{3}$ satisfying (1) in each case for $n=3$. +Now, let $n \geqslant 5$ be odd and suppose the result holds for any smaller odd cases. Again we may assume $a_{k} \geqslant 0$ for each $1 \leqslant k \leqslant n$. By the Pigeonhole Principle, there are at least three indices $k$ for which $b_{k}=a_{k}-1$ or $b_{k}=1-a_{k}$. Without loss of generality, suppose $b_{k}=a_{k}-1$ for $k=1,2,3$. Again by the Pigeonhole Principle, as $a_{1}, a_{2}, a_{3}$ lies between 0 and 1 , the difference of two of them is at most $\frac{1}{2}$. By changing indices if necessary, we may assume $0 \leqslant d=a_{1}-a_{2} \leqslant \frac{1}{2}$. + +By the inductive hypothesis, we can choose $x_{3}, x_{4}, \ldots, x_{n}$ such that $a^{\prime}=\sum_{k=3}^{n} x_{k} a_{k}$ and $b^{\prime}=\sum_{k=3}^{n} x_{k} b_{k}$ satisfy $\left|a^{\prime}\right|+\left|b^{\prime}\right| \leqslant 1$. We may further assume $a^{\prime} \geqslant 0$. + +- Case 1. $b^{\prime} \geqslant 0$, in which case we take $\left(x_{1}, x_{2}\right)=(-1,1)$. + +We have $\left|-a_{1}+a_{2}+a^{\prime}\right|+\left|-\left(a_{1}-1\right)+\left(a_{2}-1\right)+b^{\prime}\right|=\left|-d+a^{\prime}\right|+\left|-d+b^{\prime}\right| \leqslant$ $\max \left\{a^{\prime}+b^{\prime}-2 d, a^{\prime}-b^{\prime}, b^{\prime}-a^{\prime}, 2 d-a^{\prime}-b^{\prime}\right\} \leqslant 1$ since $0 \leqslant a^{\prime}, b^{\prime}, a^{\prime}+b^{\prime} \leqslant 1$ and $0 \leqslant d \leqslant \frac{1}{2}$. + +- Case 2. $0>b^{\prime} \geqslant-a^{\prime}$, in which case we take $\left(x_{1}, x_{2}\right)=(-1,1)$. + +We have $\left|-a_{1}+a_{2}+a^{\prime}\right|+\left|-\left(a_{1}-1\right)+\left(a_{2}-1\right)+b^{\prime}\right|=\left|-d+a^{\prime}\right|+\left|-d+b^{\prime}\right|$. If $-d+a^{\prime} \geqslant 0$, this equals $a^{\prime}-b^{\prime}=\left|a^{\prime}\right|+\left|b^{\prime}\right| \leqslant 1$. If $-d+a^{\prime}<0$, this equals $2 d-a^{\prime}-b^{\prime} \leqslant 2 d \leqslant 1$. + +- Case 3. $b^{\prime}<-a^{\prime}$, in which case we take $\left(x_{1}, x_{2}\right)=(1,-1)$. + +We have $\left|a_{1}-a_{2}+a^{\prime}\right|+\left|\left(a_{1}-1\right)-\left(a_{2}-1\right)+b^{\prime}\right|=\left|d+a^{\prime}\right|+\left|d+b^{\prime}\right|$. If $d+b^{\prime} \geqslant 0$, this equals $2 d+a^{\prime}+b^{\prime}<2 d \leqslant 1$. If $d+b^{\prime}<0$, this equals $a^{\prime}-b^{\prime}=\left|a^{\prime}\right|+\left|b^{\prime}\right| \leqslant 1$. + +Therefore, we have found $x_{1}, x_{2}, \ldots, x_{n}$ satisfying (1) in each case. By induction, the property holds for all odd integers $n \geqslant 3$. + +A4. Denote by $\mathbb{R}^{+}$the set of all positive real numbers. Find all functions $f: \mathbb{R}^{+} \rightarrow \mathbb{R}^{+}$such that + +$$ +x f\left(x^{2}\right) f(f(y))+f(y f(x))=f(x y)\left(f\left(f\left(x^{2}\right)\right)+f\left(f\left(y^{2}\right)\right)\right) +$$ + +for all positive real numbers $x$ and $y$. +Answer. $f(x)=\frac{1}{x}$ for any $x \in \mathbb{R}^{+}$. + hence $f(1)=1$. Swapping $x$ and $y$ in (1) and comparing with (1) again, we find + +$$ +x f\left(x^{2}\right) f(f(y))+f(y f(x))=y f\left(y^{2}\right) f(f(x))+f(x f(y)) . +$$ + +Taking $y=1$ in (2), we have $x f\left(x^{2}\right)+f(f(x))=f(f(x))+f(x)$, that is, + +$$ +f\left(x^{2}\right)=\frac{f(x)}{x} +$$ + +Take $y=1$ in (1) and apply (3) to $x f\left(x^{2}\right)$. We get $f(x)+f(f(x))=f(x)\left(f\left(f\left(x^{2}\right)\right)+1\right)$, which implies + +$$ +f\left(f\left(x^{2}\right)\right)=\frac{f(f(x))}{f(x)} +$$ + +For any $x \in \mathbb{R}^{+}$, we find that + +$$ +f\left(f(x)^{2}\right) \stackrel{(3)}{=} \frac{f(f(x))}{f(x)} \stackrel{(4)}{=} f\left(f\left(x^{2}\right)\right) \stackrel{(3)}{=} f\left(\frac{f(x)}{x}\right) +$$ + +It remains to show the following key step. + +- Claim. The function $f$ is injective. + +Proof. Using (3) and (4), we rewrite (1) as + +$$ +f(x) f(f(y))+f(y f(x))=f(x y)\left(\frac{f(f(x))}{f(x)}+\frac{f(f(y))}{f(y)}\right) . +$$ + +Take $x=y$ in (6) and apply (3). This gives $f(x) f(f(x))+f(x f(x))=2 \frac{f(f(x))}{x}$, which means + +$$ +f(x f(x))=f(f(x))\left(\frac{2}{x}-f(x)\right) +$$ + +Using (3), equation (2) can be rewritten as + +$$ +f(x) f(f(y))+f(y f(x))=f(y) f(f(x))+f(x f(y)) +$$ + +Suppose $f(x)=f(y)$ for some $x, y \in \mathbb{R}^{+}$. Then (8) implies + +$$ +f(y f(y))=f(y f(x))=f(x f(y))=f(x f(x)) +$$ + +Using (7), this gives + +$$ +f(f(y))\left(\frac{2}{y}-f(y)\right)=f(f(x))\left(\frac{2}{x}-f(x)\right) +$$ + +Noting $f(x)=f(y)$, we find $x=y$. This establishes the injectivity. + +By the Claim and (5), we get the only possible solution $f(x)=\frac{1}{x}$. It suffices to check that this is a solution. Indeed, the left-hand side of (1) becomes + +$$ +x \cdot \frac{1}{x^{2}} \cdot y+\frac{x}{y}=\frac{y}{x}+\frac{x}{y}, +$$ + +while the right-hand side becomes + +$$ +\frac{1}{x y}\left(x^{2}+y^{2}\right)=\frac{x}{y}+\frac{y}{x} . +$$ + +The two sides agree with each other. +Solution 2. Taking $x=y=1$ in (1), we get $f(1) f(f(1))+f(f(1))=2 f(1) f(f(1))$ and hence $f(1)=1$. Putting $x=1$ in (1), we have $f(f(y))+f(y)=f(y)\left(1+f\left(f\left(y^{2}\right)\right)\right)$ so that + +$$ +f(f(y))=f(y) f\left(f\left(y^{2}\right)\right) +$$ + +Putting $y=1$ in (1), we get $x f\left(x^{2}\right)+f(f(x))=f(x)\left(f\left(f\left(x^{2}\right)\right)+1\right)$. Using (9), this gives + +$$ +x f\left(x^{2}\right)=f(x) +$$ + +Replace $y$ by $\frac{1}{x}$ in (1). Then we have + +$$ +x f\left(x^{2}\right) f\left(f\left(\frac{1}{x}\right)\right)+f\left(\frac{f(x)}{x}\right)=f\left(f\left(x^{2}\right)\right)+f\left(f\left(\frac{1}{x^{2}}\right)\right) . +$$ + +The relation (10) shows $f\left(\frac{f(x)}{x}\right)=f\left(f\left(x^{2}\right)\right)$. Also, using (9) with $y=\frac{1}{x}$ and using (10) again, the last equation reduces to + +$$ +f(x) f\left(\frac{1}{x}\right)=1 +$$ + +Replace $x$ by $\frac{1}{x}$ and $y$ by $\frac{1}{y}$ in (1) and apply (11). We get + +$$ +\frac{1}{x f\left(x^{2}\right) f(f(y))}+\frac{1}{f(y f(x))}=\frac{1}{f(x y)}\left(\frac{1}{f\left(f\left(x^{2}\right)\right)}+\frac{1}{f\left(f\left(y^{2}\right)\right)}\right) . +$$ + +Clearing denominators, we can use (1) to simplify the numerators and obtain + +$$ +f(x y)^{2} f\left(f\left(x^{2}\right)\right) f\left(f\left(y^{2}\right)\right)=x f\left(x^{2}\right) f(f(y)) f(y f(x)) +$$ + +Using (9) and (10), this is the same as + +$$ +f(x y)^{2} f(f(x))=f(x)^{2} f(y) f(y f(x)) +$$ + +Substitute $y=f(x)$ in (12) and apply (10) (with $x$ replaced by $f(x)$ ). We have + +$$ +f(x f(x))^{2}=f(x) f(f(x)) +$$ + +Taking $y=x$ in (12), squaring both sides, and using (10) and (13), we find that + +$$ +f(f(x))=x^{4} f(x)^{3} +$$ + +Finally, we combine (9), (10) and (14) to get + +$$ +y^{4} f(y)^{3} \stackrel{(14)}{=} f(f(y)) \stackrel{(9)}{=} f(y) f\left(f\left(y^{2}\right)\right) \stackrel{(14)}{=} f(y) y^{8} f\left(y^{2}\right)^{3} \stackrel{(10)}{=} y^{5} f(y)^{4}, +$$ + +which implies $f(y)=\frac{1}{y}$. This is a solution by the checking in Solution 1. + +## A5. + +(a) Prove that for every positive integer $n$, there exists a fraction $\frac{a}{b}$ where $a$ and $b$ are integers satisfying $02016$ or $4 k
2$ for $0 \leqslant j \leqslant 503$ in this case. So each term in the product lies strictly between 0 and 1 , and the whole product must be less than 1 , which is impossible. + +- Case 4. $4 k+2 \frac{n+1}{2}$, we have $|l(x)|>|r(x)|$. + +If $n \equiv 3(\bmod 4)$, one may leave $l(x)=(x-1)(x-2) \cdots\left(x-\frac{n+1}{2}\right)$ on the left-hand side and $r(x)=\left(x-\frac{n+3}{2}\right)\left(x-\frac{x+5}{2}\right) \cdots(x-n)$ on the right-hand side. For $x<1$ or $\frac{n+1}{2} 0>r(x)$. For $1 \frac{n+3}{2}$, we have $|l(x)|>|r(x)|$. + +If $n \equiv 1(\bmod 4)$, as the proposer mentioned, the situation is a bit more out of control. Since the construction for $n-1 \equiv 0(\bmod 4)$ works, the answer can be either $n$ or $n-1$. For $n=5$, we can leave the products $(x-1)(x-2)(x-3)(x-4)$ and $(x-5)$. For $n=9$, the only example that works is $l(x)=(x-1)(x-2)(x-9)$ and $r(x)=(x-3)(x-4) \cdots(x-8)$, while there seems to be no such partition for $n=13$. + +A7. Denote by $\mathbb{R}$ the set of all real numbers. Find all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ such that $f(0) \neq 0$ and + +$$ +f(x+y)^{2}=2 f(x) f(y)+\max \left\{f\left(x^{2}\right)+f\left(y^{2}\right), f\left(x^{2}+y^{2}\right)\right\} +$$ + +for all real numbers $x$ and $y$. + +## Answer. + +- $f(x)=-1$ for any $x \in \mathbb{R}$; or +- $f(x)=x-1$ for any $x \in \mathbb{R}$. + +Solution 1. Taking $x=y=0$ in (1), we get $f(0)^{2}=2 f(0)^{2}+\max \{2 f(0), f(0)\}$. If $f(0)>0$, then $f(0)^{2}+2 f(0)=0$ gives no positive solution. If $f(0)<0$, then $f(0)^{2}+f(0)=0$ gives $f(0)=-1$. Putting $y=0$ in (1), we have $f(x)^{2}=-2 f(x)+f\left(x^{2}\right)$, which is the same as $(f(x)+1)^{2}=f\left(x^{2}\right)+1$. Let $g(x)=f(x)+1$. Then for any $x \in \mathbb{R}$, we have + +$$ +g\left(x^{2}\right)=g(x)^{2} \geqslant 0 +$$ + +From (1), we find that $f(x+y)^{2} \geqslant 2 f(x) f(y)+f\left(x^{2}\right)+f\left(y^{2}\right)$. In terms of $g$, this becomes $(g(x+y)-1)^{2} \geqslant 2(g(x)-1)(g(y)-1)+g\left(x^{2}\right)+g\left(y^{2}\right)-2$. Using (2), this means + +$$ +(g(x+y)-1)^{2} \geqslant(g(x)+g(y)-1)^{2}-1 +$$ + +Putting $x=1$ in (2), we get $g(1)=0$ or 1 . The two cases are handled separately. + +- Case 1. $g(1)=0$, which is the same as $f(1)=-1$. + +We put $x=-1$ and $y=0$ in (1). This gives $f(-1)^{2}=-2 f(-1)-1$, which forces $f(-1)=-1$. Next, we take $x=-1$ and $y=1$ in (1) to get $1=2+\max \{-2, f(2)\}$. This clearly implies $1=2+f(2)$ and hence $f(2)=-1$, that is, $g(2)=0$. From (2), we can prove inductively that $g\left(2^{2^{n}}\right)=g(2)^{2^{n}}=0$ for any $n \in \mathbb{N}$. Substitute $y=2^{2^{n}}-x$ in (3). We obtain + +$$ +\left(g(x)+g\left(2^{2^{n}}-x\right)-1\right)^{2} \leqslant\left(g\left(2^{2^{n}}\right)-1\right)^{2}+1=2 +$$ + +For any fixed $x \geqslant 0$, we consider $n$ to be sufficiently large so that $2^{2^{n}}-x>0$. From (2), this implies $g\left(2^{2^{n}}-x\right) \geqslant 0$ so that $g(x) \leqslant 1+\sqrt{2}$. Using (2) again, we get + +$$ +g(x)^{2^{n}}=g\left(x^{2^{n}}\right) \leqslant 1+\sqrt{2} +$$ + +for any $n \in \mathbb{N}$. Therefore, $|g(x)| \leqslant 1$ for any $x \geqslant 0$. +If there exists $a \in \mathbb{R}$ for which $g(a) \neq 0$, then for sufficiently large $n$ we must have $g\left(\left(a^{2}\right)^{\frac{1}{2^{n}}}\right)=g\left(a^{2}\right)^{\frac{1}{2^{n}}}>\frac{1}{2}$. By taking $x=-y=-\left(a^{2}\right)^{\frac{1}{2^{n}}}$ in (1), we obtain + +$$ +\begin{aligned} +1 & =2 f(x) f(-x)+\max \left\{2 f\left(x^{2}\right), f\left(2 x^{2}\right)\right\} \\ +& =2(g(x)-1)(g(-x)-1)+\max \left\{2\left(g\left(x^{2}\right)-1\right), g\left(2 x^{2}\right)-1\right\} \\ +& \leqslant 2\left(-\frac{1}{2}\right)\left(-\frac{1}{2}\right)+0=\frac{1}{2} +\end{aligned} +$$ + +since $|g(-x)|=|g(x)| \in\left(\frac{1}{2}, 1\right]$ by (2) and the choice of $x$, and since $g(z) \leqslant 1$ for $z \geqslant 0$. This yields a contradiction and hence $g(x)=0$ must hold for any $x$. This means $f(x)=-1$ for any $x \in \mathbb{R}$, which clearly satisfies (1). + +- Case 2. $g(1)=1$, which is the same as $f(1)=0$. + +We put $x=-1$ and $y=1$ in (1) to get $1=\max \{0, f(2)\}$. This clearly implies $f(2)=1$ and hence $g(2)=2$. Setting $x=2 n$ and $y=2$ in (3), we have + +$$ +(g(2 n+2)-1)^{2} \geqslant(g(2 n)+1)^{2}-1 +$$ + +By induction on $n$, it is easy to prove that $g(2 n) \geqslant n+1$ for all $n \in \mathbb{N}$. For any real number $a>1$, we choose a large $n \in \mathbb{N}$ and take $k$ to be the positive integer such that $2 k \leqslant a^{2^{n}}<2 k+2$. From (2) and (3), we have + +$$ +\left(g(a)^{2^{n}}-1\right)^{2}+1=\left(g\left(a^{2^{n}}\right)-1\right)^{2}+1 \geqslant\left(g(2 k)+g\left(a^{2^{n}}-2 k\right)-1\right)^{2} \geqslant k^{2}>\frac{1}{4}\left(a^{2^{n}}-2\right)^{2} +$$ + +since $g\left(a^{2^{n}}-2 k\right) \geqslant 0$. For large $n$, this clearly implies $g(a)^{2^{n}}>1$. Thus, + +$$ +\left(g(a)^{2^{n}}\right)^{2}>\left(g(a)^{2^{n}}-1\right)^{2}+1>\frac{1}{4}\left(a^{2^{n}}-2\right)^{2} +$$ + +This yields + +$$ +g(a)^{2^{n}}>\frac{1}{2}\left(a^{2^{n}}-2\right) +$$ + +Note that + +$$ +\frac{a^{2^{n}}}{a^{2^{n}}-2}=1+\frac{2}{a^{2^{n}}-2} \leqslant\left(1+\frac{2}{2^{n}\left(a^{2^{n}}-2\right)}\right)^{2^{n}} +$$ + +by binomial expansion. This can be rewritten as + +$$ +\left(a^{2^{n}}-2\right)^{\frac{1}{2^{n}}} \geqslant \frac{a}{1+\frac{2}{2^{n}\left(a^{2^{n}}-2\right)}} +$$ + +Together with (4), we conclude $g(a) \geqslant a$ by taking $n$ sufficiently large. +Consider $x=n a$ and $y=a>1$ in (3). This gives $(g((n+1) a)-1)^{2} \geqslant(g(n a)+g(a)-1)^{2}-1$. By induction on $n$, it is easy to show $g(n a) \geqslant(n-1)(g(a)-1)+a$ for any $n \in \mathbb{N}$. We choose a large $n \in \mathbb{N}$ and take $k$ to be the positive integer such that $k a \leqslant 2^{2^{n}}<(k+1) a$. Using (2) and (3), we have +$2^{2^{n+1}}>\left(2^{2^{n}}-1\right)^{2}+1=\left(g\left(2^{2^{n}}\right)-1\right)^{2}+1 \geqslant\left(g\left(2^{2^{n}}-k a\right)+g(k a)-1\right)^{2} \geqslant((k-1)(g(a)-1)+a-1)^{2}$, from which it follows that + +$$ +2^{2^{n}} \geqslant(k-1)(g(a)-1)+a-1>\frac{2^{2^{n}}}{a}(g(a)-1)-2(g(a)-1)+a-1 +$$ + +holds for sufficiently large $n$. Hence, we must have $\frac{g(a)-1}{a} \leqslant 1$, which implies $g(a) \leqslant a+1$ for any $a>1$. Then for large $n \in \mathbb{N}$, from (3) and (2) we have + +$$ +4 a^{2^{n+1}}=\left(2 a^{2^{n}}\right)^{2} \geqslant\left(g\left(2 a^{2^{n}}\right)-1\right)^{2} \geqslant\left(2 g\left(a^{2^{n}}\right)-1\right)^{2}-1=\left(2 g(a)^{2^{n}}-1\right)^{2}-1 +$$ + +This implies + +$$ +2 a^{2^{n}}>\frac{1}{2}\left(1+\sqrt{4 a^{2^{n+1}}+1}\right) \geqslant g(a)^{2^{n}} +$$ + +When $n$ tends to infinity, this forces $g(a) \leqslant a$. Together with $g(a) \geqslant a$, we get $g(a)=a$ for all real numbers $a>1$, that is, $f(a)=a-1$ for all $a>1$. + +Finally, for any $x \in \mathbb{R}$, we choose $y$ sufficiently large in (1) so that $y, x+y>1$. This gives $(x+y-1)^{2}=2 f(x)(y-1)+\max \left\{f\left(x^{2}\right)+y^{2}-1, x^{2}+y^{2}-1\right\}$, which can be rewritten as + +$$ +2(x-1-f(x)) y=-x^{2}+2 x-2-2 f(x)+\max \left\{f\left(x^{2}\right), x^{2}\right\} +$$ + +As the right-hand side is fixed, this can only hold for all large $y$ when $f(x)=x-1$. We now check that this function satisfies (1). Indeed, we have + +$$ +\begin{aligned} +f(x+y)^{2} & =(x+y-1)^{2}=2(x-1)(y-1)+\left(x^{2}+y^{2}-1\right) \\ +& =2 f(x) f(y)+\max \left\{f\left(x^{2}\right)+f\left(y^{2}\right), f\left(x^{2}+y^{2}\right)\right\} . +\end{aligned} +$$ + +Solution 2. Taking $x=y=0$ in (1), we get $f(0)^{2}=2 f(0)^{2}+\max \{2 f(0), f(0)\}$. If $f(0)>0$, then $f(0)^{2}+2 f(0)=0$ gives no positive solution. If $f(0)<0$, then $f(0)^{2}+f(0)=0$ gives $f(0)=-1$. Putting $y=0$ in (1), we have + +$$ +f(x)^{2}=-2 f(x)+f\left(x^{2}\right) +$$ + +Replace $x$ by $-x$ in (5) and compare with (5) again. We get $f(x)^{2}+2 f(x)=f(-x)^{2}+2 f(-x)$, which implies + +$$ +f(x)=f(-x) \quad \text { or } \quad f(x)+f(-x)=-2 +$$ + +Taking $x=y$ and $x=-y$ respectively in (1) and comparing the two equations obtained, we have + +$$ +f(2 x)^{2}-2 f(x)^{2}=1-2 f(x) f(-x) . +$$ + +Combining (6) and (7) to eliminate $f(-x)$, we find that $f(2 x)$ can be $\pm 1$ (when $f(x)=f(-x)$ ) or $\pm(2 f(x)+1)$ (when $f(x)+f(-x)=-2$ ). + +We prove the following. + +- Claim. $f(x)+f(-x)=-2$ for any $x \in \mathbb{R}$. + +Proof. Suppose there exists $a \in \mathbb{R}$ such that $f(a)+f(-a) \neq-2$. Then $f(a)=f(-a) \neq-1$ and we may assume $a>0$. We first show that $f(a) \neq 1$. Suppose $f(a)=1$. Consider $y=a$ in (7). We get $f(2 a)^{2}=1$. Taking $x=y=a$ in (1), we have $1=2+\max \left\{2 f\left(a^{2}\right), f\left(2 a^{2}\right)\right\}$. From (5), $f\left(a^{2}\right)=3$ so that $1 \geqslant 2+6$. This is impossible, and thus $f(a) \neq 1$. + +As $f(a) \neq \pm 1$, we have $f(a)= \pm\left(2 f\left(\frac{a}{2}\right)+1\right)$. Similarly, $f(-a)= \pm\left(2 f\left(-\frac{a}{2}\right)+1\right)$. These two expressions are equal since $f(a)=f(-a)$. If $f\left(\frac{a}{2}\right)=f\left(-\frac{a}{2}\right)$, then the above argument works when we replace $a$ by $\frac{a}{2}$. In particular, we have $f(a)^{2}=f\left(2 \cdot \frac{a}{2}\right)^{2}=1$, which is a contradiction. Therefore, (6) forces $f\left(\frac{a}{2}\right)+f\left(-\frac{a}{2}\right)=-2$. Then we get + +$$ +\pm\left(2 f\left(\frac{a}{2}\right)+1\right)= \pm\left(-2 f\left(\frac{a}{2}\right)-3\right) . +$$ + +For any choices of the two signs, we either get a contradiction or $f\left(\frac{a}{2}\right)=-1$, in which case $f\left(\frac{a}{2}\right)=f\left(-\frac{a}{2}\right)$ and hence $f(a)= \pm 1$ again. Therefore, there is no such real number $a$ and the Claim follows. + +Replace $x$ and $y$ by $-x$ and $-y$ in (1) respectively and compare with (1). We get + +$$ +f(x+y)^{2}-2 f(x) f(y)=f(-x-y)^{2}-2 f(-x) f(-y) +$$ + +Using the Claim, this simplifies to $f(x+y)=f(x)+f(y)+1$. In addition, (5) can be rewritten as $(f(x)+1)^{2}=f\left(x^{2}\right)+1$. Therefore, the function $g$ defined by $g(x)=f(x)+1$ satisfies $g(x+y)=g(x)+g(y)$ and $g(x)^{2}=g\left(x^{2}\right)$. The latter relation shows $g(y)$ is nonnegative for $y \geqslant 0$. For such a function satisfying the Cauchy Equation $g(x+y)=g(x)+g(y)$, it must be monotonic increasing and hence $g(x)=c x$ for some constant $c$. + +From $(c x)^{2}=g(x)^{2}=g\left(x^{2}\right)=c x^{2}$, we get $c=0$ or 1 , which corresponds to the two functions $f(x)=-1$ and $f(x)=x-1$ respectively, both of which are solutions to (1) as checked in Solution 1. + +Solution 3. As in Solution 2, we find that $f(0)=-1$, + +$$ +(f(x)+1)^{2}=f\left(x^{2}\right)+1 +$$ + +and + +$$ +f(x)=f(-x) \quad \text { or } \quad f(x)+f(-x)=-2 +$$ + +for any $x \in \mathbb{R}$. We shall show that one of the statements in (9) holds for all $x \in \mathbb{R}$. Suppose $f(a)=f(-a)$ but $f(a)+f(-a) \neq-2$, while $f(b) \neq f(-b)$ but $f(b)+f(-b)=-2$. Clearly, $a, b \neq 0$ and $f(a), f(b) \neq-1$. + +Taking $y=a$ and $y=-a$ in (1) respectively and comparing the two equations obtained, we have $f(x+a)^{2}=f(x-a)^{2}$, that is, $f(x+a)= \pm f(x-a)$. This implies $f(x+2 a)= \pm f(x)$ for all $x \in \mathbb{R}$. Putting $x=b$ and $x=-2 a-b$ respectively, we find $f(2 a+b)= \pm f(b)$ and $f(-2 a-b)= \pm f(-b)= \pm(-2-f(b))$. Since $f(b) \neq-1$, the term $\pm(-2-f(b))$ is distinct from $\pm f(b)$ in any case. So $f(2 a+b) \neq f(-2 a-b)$. From (9), we must have $f(2 a+b)+f(-2 a-b)=-2$. Note that we also have $f(b)+f(-b)=-2$ where $|f(b)|,|f(-b)|$ are equal to $|f(2 a+b)|,|f(-2 a-b)|$ respectively. The only possible case is $f(2 a+b)=f(b)$ and $f(-2 a-b)=f(-b)$. + +Applying the argument to $-a$ instead of $a$ and using induction, we have $f(2 k a+b)=f(b)$ and $f(2 k a-b)=f(-b)$ for any integer $k$. Note that $f(b)+f(-b)=-2$ and $f(b) \neq-1$ imply one of $f(b), f(-b)$ is less than -1 . Without loss of generality, assume $f(b)<-1$. We consider $x=\sqrt{2 k a+b}$ in (8) for sufficiently large $k$ so that + +$$ +(f(x)+1)^{2}=f(2 k a+b)+1=f(b)+1<0 +$$ + +yields a contradiction. Therefore, one of the statements in (9) must hold for all $x \in \mathbb{R}$. + +- Case 1. $f(x)=f(-x)$ for any $x \in \mathbb{R}$. + +For any $a \in \mathbb{R}$, setting $x=y=\frac{a}{2}$ and $x=-y=\frac{a}{2}$ in (1) respectively and comparing these, we obtain $f(a)^{2}=f(0)^{2}=1$, which means $f(a)= \pm 1$ for all $a \in \mathbb{R}$. If $f(a)=1$ for some $a$, we may assume $a>0$ since $f(a)=f(-a)$. Taking $x=y=\sqrt{a}$ in (1), we get + +$$ +f(2 \sqrt{a})^{2}=2 f(\sqrt{a})^{2}+\max \{2, f(2 a)\}=2 f(\sqrt{a})^{2}+2 +$$ + +Note that the left-hand side is $\pm 1$ while the right-hand side is an even integer. This is a contradiction. Therefore, $f(x)=-1$ for all $x \in \mathbb{R}$, which is clearly a solution. + +- Case 2. $f(x)+f(-x)=-2$ for any $x \in \mathbb{R}$. + +This case can be handled in the same way as in Solution 2, which yields another solution $f(x)=x-1$. + +A8. Determine the largest real number $a$ such that for all $n \geqslant 1$ and for all real numbers $x_{0}, x_{1}, \ldots, x_{n}$ satisfying $0=x_{0} 4 \sum_{k=1}^{n} \frac{k+1}{x_{k}} . +$$ + +This shows (1) holds for $a=\frac{4}{9}$. +Next, we show that $a=\frac{4}{9}$ is the optimal choice. Consider the sequence defined by $x_{0}=0$ and $x_{k}=x_{k-1}+k(k+1)$ for $k \geqslant 1$, that is, $x_{k}=\frac{1}{3} k(k+1)(k+2)$. Then the left-hand side of (1) equals + +$$ +\sum_{k=1}^{n} \frac{1}{k(k+1)}=\sum_{k=1}^{n}\left(\frac{1}{k}-\frac{1}{k+1}\right)=1-\frac{1}{n+1} +$$ + +while the right-hand side equals + +$$ +a \sum_{k=1}^{n} \frac{k+1}{x_{k}}=3 a \sum_{k=1}^{n} \frac{1}{k(k+2)}=\frac{3}{2} a \sum_{k=1}^{n}\left(\frac{1}{k}-\frac{1}{k+2}\right)=\frac{3}{2}\left(1+\frac{1}{2}-\frac{1}{n+1}-\frac{1}{n+2}\right) a . +$$ + +When $n$ tends to infinity, the left-hand side tends to 1 while the right-hand side tends to $\frac{9}{4} a$. Therefore $a$ has to be at most $\frac{4}{9}$. + +Hence the largest value of $a$ is $\frac{4}{9}$. +Solution 2. We shall give an alternative method to establish (1) with $a=\frac{4}{9}$. We define $y_{k}=x_{k}-x_{k-1}>0$ for $1 \leqslant k \leqslant n$. By the Cauchy-Schwarz Inequality, for $1 \leqslant k \leqslant n$, we have + +$$ +\left(y_{1}+y_{2}+\cdots+y_{k}\right)\left(\sum_{j=1}^{k} \frac{1}{y_{j}}\binom{j+1}{2}^{2}\right) \geqslant\left(\binom{2}{2}+\binom{3}{2}+\cdots+\binom{k+1}{2}\right)^{2}=\binom{k+2}{3}^{2} +$$ + +This can be rewritten as + +$$ +\frac{k+1}{y_{1}+y_{2}+\cdots+y_{k}} \leqslant \frac{36}{k^{2}(k+1)(k+2)^{2}}\left(\sum_{j=1}^{k} \frac{1}{y_{j}}\binom{j+1}{2}^{2}\right) . +$$ + +Summing (3) over $k=1,2, \ldots, n$, we get + +$$ +\frac{2}{y_{1}}+\frac{3}{y_{1}+y_{2}}+\cdots+\frac{n+1}{y_{1}+y_{2}+\cdots+y_{n}} \leqslant \frac{c_{1}}{y_{1}}+\frac{c_{2}}{y_{2}}+\cdots+\frac{c_{n}}{y_{n}} +$$ + +where for $1 \leqslant m \leqslant n$, + +$$ +\begin{aligned} +c_{m} & =36\binom{m+1}{2}^{2} \sum_{k=m}^{n} \frac{1}{k^{2}(k+1)(k+2)^{2}} \\ +& =\frac{9 m^{2}(m+1)^{2}}{4} \sum_{k=m}^{n}\left(\frac{1}{k^{2}(k+1)^{2}}-\frac{1}{(k+1)^{2}(k+2)^{2}}\right) \\ +& =\frac{9 m^{2}(m+1)^{2}}{4}\left(\frac{1}{m^{2}(m+1)^{2}}-\frac{1}{(n+1)^{2}(n+2)^{2}}\right)<\frac{9}{4} . +\end{aligned} +$$ + +From (4), the inequality (1) holds for $a=\frac{4}{9}$. This is also the upper bound as can be verified in the same way as Solution 1. + +## Combinatorics + +C1. The leader of an IMO team chooses positive integers $n$ and $k$ with $n>k$, and announces them to the deputy leader and a contestant. The leader then secretly tells the deputy leader an $n$-digit binary string, and the deputy leader writes down all $n$-digit binary strings which differ from the leader's in exactly $k$ positions. (For example, if $n=3$ and $k=1$, and if the leader chooses 101, the deputy leader would write down 001, 111 and 100.) The contestant is allowed to look at the strings written by the deputy leader and guess the leader's string. What is the minimum number of guesses (in terms of $n$ and $k$ ) needed to guarantee the correct answer? + +Answer. The minimum number of guesses is 2 if $n=2 k$ and 1 if $n \neq 2 k$. +Solution 1. Let $X$ be the binary string chosen by the leader and let $X^{\prime}$ be the binary string of length $n$ every digit of which is different from that of $X$. The strings written by the deputy leader are the same as those in the case when the leader's string is $X^{\prime}$ and $k$ is changed to $n-k$. In view of this, we may assume $k \geqslant \frac{n}{2}$. Also, for the particular case $k=\frac{n}{2}$, this argument shows that the strings $X$ and $X^{\prime}$ cannot be distinguished, and hence in that case the contestant has to guess at least twice. + +It remains to show that the number of guesses claimed suffices. Consider any string $Y$ which differs from $X$ in $m$ digits where $0 2$, the deputy leader would write down the same strings if the leader's string $X$ is replaced by $X^{\prime}$ obtained by changing each digit of $X$. This shows at least 2 guesses are needed. We shall show that 2 guesses suffice in this case. Suppose the first two digits of the leader's string are the same. Then among the strings written by the deputy leader, the prefices 01 and 10 will occur $\binom{2 k-2}{k-1}$ times each, while the prefices 00 and 11 will occur $\binom{2 k-2}{k}$ times each. The two numbers are interchanged if the first two digits of the leader's string are different. Since $\binom{2 k-2}{k-1} \neq\binom{ 2 k-2}{k}$, the contestant can tell whether the first two digits of the leader's string are the same or not. He can work out the relation of the first digit and the +other digits in the same way and reduce the leader's string to only 2 possibilities. The proof is complete. + +C2. Find all positive integers $n$ for which all positive divisors of $n$ can be put into the cells of a rectangular table under the following constraints: + +- each cell contains a distinct divisor; +- the sums of all rows are equal; and +- the sums of all columns are equal. + +Answer. 1. +Solution 1. Suppose all positive divisors of $n$ can be arranged into a rectangular table of size $k \times l$ where the number of rows $k$ does not exceed the number of columns $l$. Let the sum of numbers in each column be $s$. Since $n$ belongs to one of the columns, we have $s \geqslant n$, where equality holds only when $n=1$. + +For $j=1,2, \ldots, l$, let $d_{j}$ be the largest number in the $j$-th column. Without loss of generality, assume $d_{1}>d_{2}>\cdots>d_{l}$. Since these are divisors of $n$, we have + +$$ +d_{l} \leqslant \frac{n}{l} +$$ + +As $d_{l}$ is the maximum entry of the $l$-th column, we must have + +$$ +d_{l} \geqslant \frac{s}{k} \geqslant \frac{n}{k} . +$$ + +The relations (1) and (2) combine to give $\frac{n}{l} \geqslant \frac{n}{k}$, that is, $k \geqslant l$. Together with $k \leqslant l$, we conclude that $k=l$. Then all inequalities in (1) and (2) are equalities. In particular, $s=n$ and so $n=1$, in which case the conditions are clearly satisfied. + +Solution 2. Clearly $n=1$ works. Then we assume $n>1$ and let its prime factorization be $n=p_{1}^{r_{1}} p_{2}^{r_{2}} \cdots p_{t}^{r_{t}}$. Suppose the table has $k$ rows and $l$ columns with $1 n$. Therefore, we have + +$$ +\begin{aligned} +\left(r_{1}+1\right)\left(r_{2}+1\right) \cdots\left(r_{t}+1\right) & =k l \leqslant l^{2}<\left(\frac{\sigma(n)}{n}\right)^{2} \\ +& =\left(1+\frac{1}{p_{1}}+\cdots+\frac{1}{p_{1}^{r_{1}}}\right)^{2} \cdots\left(1+\frac{1}{p_{t}}+\cdots+\frac{1}{p_{t}^{r_{t}}}\right)^{2} +\end{aligned} +$$ + +This can be rewritten as + +$$ +f\left(p_{1}, r_{1}\right) f\left(p_{2}, r_{2}\right) \cdots f\left(p_{t}, r_{t}\right)<1 +$$ + +where + +$$ +f(p, r)=\frac{r+1}{\left(1+\frac{1}{p}+\cdots+\frac{1}{p^{r}}\right)^{2}}=\frac{(r+1)\left(1-\frac{1}{p}\right)^{2}}{\left(1-\frac{1}{p^{r+1}}\right)^{2}} +$$ + +Direct computation yields + +$$ +f(2,1)=\frac{8}{9}, \quad f(2,2)=\frac{48}{49}, \quad f(3,1)=\frac{9}{8} . +$$ + +Also, we find that + +$$ +\begin{aligned} +& f(2, r) \geqslant\left(1-\frac{1}{2^{r+1}}\right)^{-2}>1 \quad \text { for } r \geqslant 3 \\ +& f(3, r) \geqslant \frac{4}{3}\left(1-\frac{1}{3^{r+1}}\right)^{-2}>\frac{4}{3}>\frac{9}{8} \quad \text { for } r \geqslant 2, \text { and } \\ +& f(p, r) \geqslant \frac{32}{25}\left(1-\frac{1}{p^{r+1}}\right)^{-2}>\frac{32}{25}>\frac{9}{8} \quad \text { for } p \geqslant 5 +\end{aligned} +$$ + +From these values and bounds, it is clear that (3) holds only when $n=2$ or 4 . In both cases, it is easy to see that the conditions are not satisfied. Hence, the only possible $n$ is 1 . + +C3. Let $n$ be a positive integer relatively prime to 6 . We paint the vertices of a regular $n$-gon with three colours so that there is an odd number of vertices of each colour. Show that there exists an isosceles triangle whose three vertices are of different colours. + +Solution. For $k=1,2,3$, let $a_{k}$ be the number of isosceles triangles whose vertices contain exactly $k$ colours. Suppose on the contrary that $a_{3}=0$. Let $b, c, d$ be the number of vertices of the three different colours respectively. We now count the number of pairs $(\triangle, E)$ where $\triangle$ is an isosceles triangle and $E$ is a side of $\triangle$ whose endpoints are of different colours. + +On the one hand, since we have assumed $a_{3}=0$, each triangle in the pair must contain exactly two colours, and hence each triangle contributes twice. Thus the number of pairs is $2 a_{2}$ 。 + +On the other hand, if we pick any two vertices $A, B$ of distinct colours, then there are three isosceles triangles having these as vertices, two when $A B$ is not the base and one when $A B$ is the base since $n$ is odd. Note that the three triangles are all distinct as $(n, 3)=1$. In this way, we count the number of pairs to be $3(b c+c d+d b)$. However, note that $2 a_{2}$ is even while $3(b c+c d+d b)$ is odd, as each of $b, c, d$ is. This yields a contradiction and hence $a_{3} \geqslant 1$. + +Comment. A slightly stronger version of this problem is to replace the condition $(n, 6)=1$ by $n$ being odd (where equilateral triangles are regarded as isosceles triangles). In that case, the only difference in the proof is that by fixing any two vertices $A, B$, one can find exactly one or three isosceles triangles having these as vertices. But since only parity is concerned in the solution, the proof goes the same way. + +The condition that there is an odd number of vertices of each colour is necessary, as can be seen from the following example. Consider $n=25$ and we label the vertices $A_{0}, A_{1}, \ldots, A_{24}$. Suppose colour 1 is used for $A_{0}$, colour 2 is used for $A_{5}, A_{10}, A_{15}, A_{20}$, while colour 3 is used for the remaining vertices. Then any isosceles triangle having colours 1 and 2 must contain $A_{0}$ and one of $A_{5}, A_{10}, A_{15}, A_{20}$. Clearly, the third vertex must have index which is a multiple of 5 so it is not of colour 3 . + +C4. Find all positive integers $n$ for which we can fill in the entries of an $n \times n$ table with the following properties: + +- each entry can be one of $I, M$ and $O$; +- in each row and each column, the letters $I, M$ and $O$ occur the same number of times; and +- in any diagonal whose number of entries is a multiple of three, the letters $I, M$ and $O$ occur the same number of times. + +Answer. $n$ can be any multiple of 9 . +Solution. We first show that such a table exists when $n$ is a multiple of 9 . Consider the following $9 \times 9$ table. + +$$ +\left(\begin{array}{ccccccccc} +I & I & I & M & M & M & O & O & O \\ +M & M & M & O & O & O & I & I & I \\ +O & O & O & I & I & I & M & M & M \\ +I & I & I & M & M & M & O & O & O \\ +M & M & M & O & O & O & I & I & I \\ +O & O & O & I & I & I & M & M & M \\ +I & I & I & M & M & M & O & O & O \\ +M & M & M & O & O & O & I & I & I \\ +O & O & O & I & I & I & M & M & M +\end{array}\right) +$$ + +It is a direct checking that the table (1) satisfies the requirements. For $n=9 k$ where $k$ is a positive integer, we form an $n \times n$ table using $k \times k$ copies of (1). For each row and each column of the table of size $n$, since there are three $I$ 's, three $M$ 's and three $O$ 's for any nine consecutive entries, the numbers of $I, M$ and $O$ are equal. In addition, every diagonal of the large table whose number of entries is divisible by 3 intersects each copy of (1) at a diagonal with number of entries divisible by 3 (possibly zero). Therefore, every such diagonal also contains the same number of $I, M$ and $O$. + +Next, consider any $n \times n$ table for which the requirements can be met. As the number of entries of each row should be a multiple of 3 , we let $n=3 k$ where $k$ is a positive integer. We divide the whole table into $k \times k$ copies of $3 \times 3$ blocks. We call the entry at the centre of such a $3 \times 3$ square a vital entry. We also call any row, column or diagonal that contains at least one vital entry a vital line. We compute the number of pairs $(l, c)$ where $l$ is a vital line and $c$ is an entry belonging to $l$ that contains the letter $M$. We let this number be $N$. + +On the one hand, since each vital line contains the same number of $I, M$ and $O$, it is obvious that each vital row and each vital column contain $k$ occurrences of $M$. For vital diagonals in either direction, we count there are exactly + +$$ +1+2+\cdots+(k-1)+k+(k-1)+\cdots+2+1=k^{2} +$$ + +occurrences of $M$. Therefore, we have $N=4 k^{2}$. + +On the other hand, there are $3 k^{2}$ occurrences of $M$ in the whole table. Note that each entry belongs to exactly 1 or 4 vital lines. Therefore, $N$ must be congruent to $3 k^{2} \bmod 3$. + +From the double counting, we get $4 k^{2} \equiv 3 k^{2}(\bmod 3)$, which forces $k$ to be a multiple of 3. Therefore, $n$ has to be a multiple of 9 and the proof is complete. + +C5. Let $n \geqslant 3$ be a positive integer. Find the maximum number of diagonals of a regular $n$-gon one can select, so that any two of them do not intersect in the interior or they are perpendicular to each other. + +Answer. $n-2$ if $n$ is even and $n-3$ if $n$ is odd. + +Solution 1. We consider two cases according to the parity of $n$. + +- Case 1. $n$ is odd. + +We first claim that no pair of diagonals is perpendicular. Suppose $A, B, C, D$ are vertices where $A B$ and $C D$ are perpendicular, and let $E$ be the vertex lying on the perpendicular bisector of $A B$. Let $E^{\prime}$ be the opposite point of $E$ on the circumcircle of the regular polygon. Since $E C=E^{\prime} D$ and $C, D, E$ are vertices of the regular polygon, $E^{\prime}$ should also belong to the polygon. This contradicts the fact that a regular polygon with an odd number of vertices does not contain opposite points on the circumcircle. + + +Therefore in the odd case we can only select diagonals which do not intersect. In the maximal case these diagonals should divide the regular $n$-gon into $n-2$ triangles, so we can select at most $n-3$ diagonals. This can be done, for example, by selecting all diagonals emanated from a particular vertex. + +- Case 2. $n$ is even. + +If there is no intersection, then the proof in the odd case works. Suppose there are two perpendicular diagonals selected. We consider the set $S$ of all selected diagonals parallel to one of them which intersect with some selected diagonals. Suppose $S$ contains $k$ diagonals and the number of distinct endpoints of the $k$ diagonals is $l$. + +Firstly, consider the longest diagonal in one of the two directions in $S$. No other diagonal in $S$ can start from either endpoint of that diagonal, since otherwise it has to meet another longer diagonal in $S$. The same holds true for the other direction. Ignoring these two longest diagonals and their four endpoints, the remaining $k-2$ diagonals share $l-4$ endpoints where each endpoint can belong to at most two diagonals. This gives $2(l-4) \geqslant 2(k-2)$, so that $k \leqslant l-2$. + + +Consider a group of consecutive vertices of the regular $n$-gon so that each of the two outermost vertices is an endpoint of a diagonal in $S$, while the interior points are not. There are $l$ such groups. We label these groups $P_{1}, P_{2}, \ldots, P_{l}$ in this order. We claim that each selected diagonal outside $S$ must connect vertices of the same group $P_{i}$. Consider any diagonal $d$ joining vertices from distinct groups $P_{i}$ and $P_{j}$. Let $d_{1}$ and $d_{2}$ be two diagonals in $S$ each having one of the outermost points of $P_{i}$ as endpoint. Then $d$ must meet either $d_{1}, d_{2}$ or a diagonal in $S$ which is perpendicular to both $d_{1}$ and $d_{2}$. In any case $d$ should belong to $S$ by definition, which is a contradiction. + +Within the same group $P_{i}$, there are no perpendicular diagonals since the vertices belong to the same side of a diameter of the circumcircle. Hence there can be at most $\left|P_{i}\right|-2$ selected diagonals within $P_{i}$, including the one joining the two outermost points of $P_{i}$ when $\left|P_{i}\right|>2$. Therefore, the maximum number of diagonals selected is + +$$ +\sum_{i=1}^{l}\left(\left|P_{i}\right|-2\right)+k=\sum_{i=1}^{l}\left|P_{i}\right|-2 l+k=(n+l)-2 l+k=n-l+k \leqslant n-2 +$$ + +This upper bound can be attained as follows. We take any vertex $A$ and let $A^{\prime}$ be the vertex for which $A A^{\prime}$ is a diameter of the circumcircle. If we select all diagonals emanated from $A$ together with the diagonal $d^{\prime}$ joining the two neighbouring vertices of $A^{\prime}$, then the only pair of diagonals that meet each other is $A A^{\prime}$ and $d^{\prime}$, which are perpendicular to each other. In total we can take $n-2$ diagonals. + + +Solution 2. The constructions and the odd case are the same as Solution 1. Instead of dealing separately with the case where $n$ is even, we shall prove by induction more generally that we can select at most $n-2$ diagonals for any cyclic $n$-gon with circumcircle $\Gamma$. + +The base case $n=3$ is trivial since there is no diagonal at all. Suppose the upper bound holds for any cyclic polygon with fewer than $n$ sides. For a cyclic $n$-gon, if there is a selected diagonal which does not intersect any other selected diagonal, then this diagonal divides the $n$-gon into an $m$-gon and an $l$-gon (with $m+l=n+2$ ) so that each selected diagonal belongs to one of them. Without loss of generality, we may assume the $m$-gon lies on the same side of a diameter of $\Gamma$. Then no two selected diagonals of the $m$-gon can intersect, and hence we can select at most $m-3$ diagonals. Also, we can apply the inductive hypothesis to the $l$-gon. This shows the maximum number of selected diagonals is $(m-3)+(l-2)+1=n-2$. + +It remains to consider the case when all selected diagonals meet at least one other selected diagonal. Consider a pair of selected perpendicular diagonals $d_{1}, d_{2}$. They divide the circumference of $\Gamma$ into four arcs, each of which lies on the same side of a diameter of $\Gamma$. If there are two selected diagonals intersecting each other and neither is parallel to $d_{1}$ or $d_{2}$, then their endpoints must belong to the same arc determined by $d_{1}, d_{2}$, and hence they cannot be perpendicular. This violates the condition, and hence all selected diagonals must have the same direction as one of $d_{1}, d_{2}$. + + +Take the longest selected diagonal in one of the two directions. We argue as in Solution 1 that its endpoints do not belong to any other selected diagonal. The same holds true for the longest diagonal in the other direction. Apart from these four endpoints, each of the remaining $n-4$ vertices can belong to at most two selected diagonals. Thus we can select at most $\frac{1}{2}(2(n-4)+4)=n-2$ diagonals. Then the proof follows by induction. + +C6. There are $n \geqslant 3$ islands in a city. Initially, the ferry company offers some routes between some pairs of islands so that it is impossible to divide the islands into two groups such that no two islands in different groups are connected by a ferry route. + +After each year, the ferry company will close a ferry route between some two islands $X$ and $Y$. At the same time, in order to maintain its service, the company will open new routes according to the following rule: for any island which is connected by a ferry route to exactly one of $X$ and $Y$, a new route between this island and the other of $X$ and $Y$ is added. + +Suppose at any moment, if we partition all islands into two nonempty groups in any way, then it is known that the ferry company will close a certain route connecting two islands from the two groups after some years. Prove that after some years there will be an island which is connected to all other islands by ferry routes. + +Solution. Initially, we pick any pair of islands $A$ and $B$ which are connected by a ferry route and put $A$ in set $\mathcal{A}$ and $B$ in set $\mathcal{B}$. From the condition, without loss of generality there must be another island which is connected to $A$. We put such an island $C$ in set $\mathcal{B}$. We say that two sets of islands form a network if each island in one set is connected to each island in the other set. + +Next, we shall included all islands to $\mathcal{A} \cup \mathcal{B}$ one by one. Suppose we have two sets $\mathcal{A}$ and $\mathcal{B}$ which form a network where $3 \leqslant|\mathcal{A} \cup \mathcal{B}| \angle C B A$. This shows $S$ and $O_{1}$ lie on different sides of $X Y$. As $S^{\prime}$ lies on ray $S O_{1}$, it follows that $S$ and $S^{\prime}$ cannot lie on the same side of $X Y$. Therefore, $S$ and $S^{\prime}$ are symmetric with respect to $X Y$. + +Let $d$ be the diameter of the circumcircle of triangle $X S Y$. As $S S^{\prime}$ is twice the distance from $S$ to $X Y$ and $S X=S Y$, we have $S S^{\prime}=2 \frac{S X^{2}}{d}$. It follows from (1) that $d=2 S O_{1}$. As $S O_{1}$ is the perpendicular bisector of $X Y$, point $O_{1}^{d}$ is the circumcentre of triangle $X S Y$. + +Solution 2. Denote the orthocentre and circumcentre of triangle $A B C$ by $H$ and $O$ respectively. Let $O_{1}$ be the circumcentre of triangle $X S Y$. Consider two other possible positions of $S$. We name them $S^{\prime}$ and $S^{\prime \prime}$ and define the analogous points $X^{\prime}, Y^{\prime}, O_{1}^{\prime}, X^{\prime \prime}, Y^{\prime \prime} O_{1}^{\prime \prime}$ accordingly. Note that $S, S^{\prime}, S^{\prime \prime}$ lie on the perpendicular bisector of $A D$. + +As $X X^{\prime}$ and $Y Y^{\prime}$ meet at $A$ and the circumcircles of triangles $A X Y$ and $A X^{\prime} Y^{\prime}$ meet at $D$, there is a spiral similarity with centre $D$ mapping $X Y$ to $X^{\prime} Y^{\prime}$. We find that + +$$ +\measuredangle S X Y=\frac{\pi}{2}-\measuredangle Y A X=\frac{\pi}{2}-\measuredangle Y^{\prime} A X^{\prime}=\measuredangle S^{\prime} X^{\prime} Y^{\prime} +$$ + +and similarly $\measuredangle S Y X=\measuredangle S^{\prime} Y^{\prime} X^{\prime}$. This shows triangles $S X Y$ and $S^{\prime} X^{\prime} Y^{\prime}$ are directly similar. Then the spiral similarity with centre $D$ takes points $S, X, Y, O_{1}$ to $S^{\prime}, X^{\prime}, Y^{\prime}, O_{1}^{\prime}$. Similarly, there is a spiral similarity with centre $D$ mapping $S, X, Y, O_{1}$ to $S^{\prime \prime}, X^{\prime \prime}, Y^{\prime \prime}, O_{1}^{\prime \prime}$. From these, we see that there is a spiral similarity taking the corresponding points $S, S^{\prime}, S^{\prime \prime}$ to points $O_{1}, O_{1}^{\prime}, O_{1}^{\prime \prime}$. In particular, $O_{1}, O_{1}^{\prime}, O_{1}^{\prime \prime}$ are collinear. + + +It now suffices to show that $O_{1}$ lies on the perpendicular bisector of $P M$ for two special cases. + +Firstly, we take $S$ to be the midpoint of $A H$. Then $X$ and $Y$ are the feet of altitudes from $C$ and $B$ respectively. It is well-known that the circumcircle of triangle $X S Y$ is the nine-point circle of triangle $A B C$. Then $O_{1}$ is the nine-point centre and $O_{1} P=O_{1} M$. Indeed, $P$ and $M$ also lies on the nine-point circle. + +Secondly, we take $S^{\prime}$ to be the midpoint of $A O$. Then $X^{\prime}$ and $Y^{\prime}$ are the midpoints of $A B$ and $A C$ respectively. Then $X^{\prime} Y^{\prime} / / B C$. Clearly, $S^{\prime}$ lies on the perpendicular bisector of $P M$. This shows the perpendicular bisectors of $X^{\prime} Y^{\prime}$ and $P M$ coincide. Hence, we must have $O_{1}^{\prime} P=O_{1}^{\prime} M$. + + +G6. Let $A B C D$ be a convex quadrilateral with $\angle A B C=\angle A D C<90^{\circ}$. The internal angle bisectors of $\angle A B C$ and $\angle A D C$ meet $A C$ at $E$ and $F$ respectively, and meet each other at point $P$. Let $M$ be the midpoint of $A C$ and let $\omega$ be the circumcircle of triangle $B P D$. Segments $B M$ and $D M$ intersect $\omega$ again at $X$ and $Y$ respectively. Denote by $Q$ the intersection point of lines $X E$ and $Y F$. Prove that $P Q \perp A C$. + +## Solution 1. + + + +Let $\omega_{1}$ be the circumcircle of triangle $A B C$. We first prove that $Y$ lies on $\omega_{1}$. Let $Y^{\prime}$ be the point on ray $M D$ such that $M Y^{\prime} \cdot M D=M A^{2}$. Then triangles $M A Y^{\prime}$ and $M D A$ are oppositely similar. Since $M C^{2}=M A^{2}=M Y^{\prime} \cdot M D$, triangles $M C Y^{\prime}$ and $M D C$ are also oppositely similar. Therefore, using directed angles, we have + +$$ +\measuredangle A Y^{\prime} C=\measuredangle A Y^{\prime} M+\measuredangle M Y^{\prime} C=\measuredangle M A D+\measuredangle D C M=\measuredangle C D A=\measuredangle A B C +$$ + +so that $Y^{\prime}$ lies on $\omega_{1}$. +Let $Z$ be the intersection point of lines $B C$ and $A D$. Since $\measuredangle P D Z=\measuredangle P B C=\measuredangle P B Z$, point $Z$ lies on $\omega$. In addition, from $\measuredangle Y^{\prime} B Z=\measuredangle Y^{\prime} B C=\measuredangle Y^{\prime} A C=\measuredangle Y^{\prime} A M=\measuredangle Y^{\prime} D Z$, we also know that $Y^{\prime}$ lies on $\omega$. Note that $\angle A D C$ is acute implies $M A \neq M D$ so $M Y^{\prime} \neq M D$. Therefore, $Y^{\prime}$ is the second intersection of $D M$ and $\omega$. Then $Y^{\prime}=Y$ and hence $Y$ lies on $\omega_{1}$. + +Next, by the Angle Bisector Theorem and the similar triangles, we have + +$$ +\frac{F A}{F C}=\frac{A D}{C D}=\frac{A D}{A M} \cdot \frac{C M}{C D}=\frac{Y A}{Y M} \cdot \frac{Y M}{Y C}=\frac{Y A}{Y C} +$$ + +Hence, $F Y$ is the internal angle bisector of $\angle A Y C$. +Let $B^{\prime}$ be the second intersection of the internal angle bisector of $\angle C B A$ and $\omega_{1}$. Then $B^{\prime}$ is the midpoint of arc $A C$ not containing $B$. Therefore, $Y B^{\prime}$ is the external angle bisector of $\angle A Y C$, so that $B^{\prime} Y \perp F Y$. + +Denote by $l$ the line through $P$ parallel to $A C$. Suppose $l$ meets line $B^{\prime} Y$ at $S$. From + +$$ +\begin{aligned} +\measuredangle P S Y & =\measuredangle\left(A C, B^{\prime} Y\right)=\measuredangle A C Y+\measuredangle C Y B^{\prime}=\measuredangle A C Y+\measuredangle C A B^{\prime}=\measuredangle A C Y+\measuredangle B^{\prime} C A \\ +& =\measuredangle B^{\prime} C Y=\measuredangle B^{\prime} B Y=\measuredangle P B Y +\end{aligned} +$$ + +the point $S$ lies on $\omega$. Similarly, the line through $X$ perpendicular to $X E$ also passes through the second intersection of $l$ and $\omega$, which is the point $S$. From $Q Y \perp Y S$ and $Q X \perp X S$, point $Q$ lies on $\omega$ and $Q S$ is a diameter of $\omega$. Therefore, $P Q \perp P S$ so that $P Q \perp A C$. + +Solution 2. Denote by $\omega_{1}$ and $\omega_{2}$ the circumcircles of triangles $A B C$ and $A D C$ respectively. Since $\angle A B C=\angle A D C$, we know that $\omega_{1}$ and $\omega_{2}$ are symmetric with respect to the midpoint $M$ of $A C$. + +Firstly, we show that $X$ lies on $\omega_{2}$. Let $X_{1}$ be the second intersection of ray $M B$ and $\omega_{2}$ and $X^{\prime}$ be its symmetric point with respect to $M$. Then $X^{\prime}$ lies on $\omega_{1}$ and $X^{\prime} A X_{1} C$ is a parallelogram. Hence, we have + +$$ +\begin{aligned} +\measuredangle D X_{1} B & =\measuredangle D X_{1} A+\measuredangle A X_{1} B=\measuredangle D C A+\measuredangle A X_{1} X^{\prime}=\measuredangle D C A+\measuredangle C X^{\prime} X_{1} \\ +& =\measuredangle D C A+\measuredangle C A B=\measuredangle(C D, A B) . +\end{aligned} +$$ + + + +Also, we have + +$$ +\measuredangle D P B=\measuredangle P D C+\angle(C D, A B)+\measuredangle A B P=\angle(C D, A B) . +$$ + +These yield $\measuredangle D X_{1} B=\measuredangle D P B$ and hence $X_{1}$ lies on $\omega$. It follows that $X_{1}=X$ and $X$ lies on $\omega_{2}$. Similarly, $Y$ lies on $\omega_{1}$. + +Next, we prove that $Q$ lies on $\omega$. Suppose the perpendicular bisector of $A C$ meet $\omega_{1}$ at $B^{\prime}$ and $M_{1}$ and meet $\omega_{2}$ at $D^{\prime}$ and $M_{2}$, so that $B, M_{1}$ and $D^{\prime}$ lie on the same side of $A C$. Note that $B^{\prime}$ lies on the angle bisector of $\angle A B C$ and similarly $D^{\prime}$ lies on $D P$. + +If we denote the area of $W_{1} W_{2} W_{3}$ by $\left[W_{1} W_{2} W_{3}\right]$, then + +$$ +\frac{B A \cdot X^{\prime} A}{B C \cdot X^{\prime} C}=\frac{\frac{1}{2} B A \cdot X^{\prime} A \sin \angle B A X^{\prime}}{\frac{1}{2} B C \cdot X^{\prime} C \sin \angle B C X^{\prime}}=\frac{\left[B A X^{\prime}\right]}{\left[B C X^{\prime}\right]}=\frac{M A}{M C}=1 +$$ + +As $B E$ is the angle bisector of $\angle A B C$, we have + +$$ +\frac{E A}{E C}=\frac{B A}{B C}=\frac{X^{\prime} C}{X^{\prime} A}=\frac{X A}{X C} +$$ + +Therefore, $X E$ is the angle bisector of $\angle A X C$, so that $M_{2}$ lies on the line joining $X, E, Q$. Analogously, $M_{1}, F, Q, Y$ are collinear. Thus, + +$$ +\begin{aligned} +\measuredangle X Q Y & =\measuredangle M_{2} Q M_{1}=\measuredangle Q M_{2} M_{1}+\measuredangle M_{2} M_{1} Q=\measuredangle X M_{2} D^{\prime}+\measuredangle B^{\prime} M_{1} Y \\ +& =\measuredangle X D D^{\prime}+\measuredangle B^{\prime} B Y=\measuredangle X D P+\measuredangle P B Y=\measuredangle X B P+\measuredangle P B Y=\measuredangle X B Y, +\end{aligned} +$$ + +which implies $Q$ lies on $\omega$. +Finally, as $M_{1}$ and $M_{2}$ are symmetric with respect to $M$, the quadrilateral $X^{\prime} M_{2} X M_{1}$ is a parallelogram. Consequently, + +$$ +\measuredangle X Q P=\measuredangle X B P=\measuredangle X^{\prime} B B^{\prime}=\measuredangle X^{\prime} M_{1} B^{\prime}=\measuredangle X M_{2} M_{1} . +$$ + +This shows $Q P / / M_{2} M_{1}$. As $M_{2} M_{1} \perp A C$, we get $Q P \perp A C$. +Solution 3. We first state two results which will be needed in our proof. + +- Claim 1. In $\triangle X^{\prime} Y^{\prime} Z^{\prime}$ with $X^{\prime} Y^{\prime} \neq X^{\prime} Z^{\prime}$, let $N^{\prime}$ be the midpoint of $Y^{\prime} Z^{\prime}$ and $W^{\prime}$ be the foot of internal angle bisector from $X^{\prime}$. Then $\tan ^{2} \measuredangle W^{\prime} X^{\prime} Z^{\prime}=\tan \measuredangle N^{\prime} X^{\prime} W^{\prime} \tan \measuredangle Z^{\prime} W^{\prime} X^{\prime}$. + +Proof. + + +Without loss of generality, assume $X^{\prime} Y^{\prime}>X^{\prime} Z^{\prime}$. Then $W^{\prime}$ lies between $N^{\prime}$ and $Z^{\prime}$. The signs of both sides agree so it suffices to establish the relation for ordinary angles. Let $\angle W^{\prime} X^{\prime} Z^{\prime}=\alpha, \angle N^{\prime} X^{\prime} W^{\prime}=\beta$ and $\angle Z^{\prime} W^{\prime} X^{\prime}=\gamma$. We have + +$$ +\frac{\sin (\gamma-\alpha)}{\sin (\alpha-\beta)}=\frac{N^{\prime} X^{\prime}}{N^{\prime} Y^{\prime}}=\frac{N^{\prime} X^{\prime}}{N^{\prime} Z^{\prime}}=\frac{\sin (\gamma+\alpha)}{\sin (\alpha+\beta)} +$$ + +This implies + +$$ +\frac{\tan \gamma-\tan \alpha}{\tan \gamma+\tan \alpha}=\frac{\sin \gamma \cos \alpha-\cos \gamma \sin \alpha}{\sin \gamma \cos \alpha+\cos \gamma \sin \alpha}=\frac{\sin \alpha \cos \beta-\cos \alpha \sin \beta}{\sin \alpha \cos \beta+\cos \alpha \sin \beta}=\frac{\tan \alpha-\tan \beta}{\tan \alpha+\tan \beta} +$$ + +Expanding and simplifying, we get the desired result $\tan ^{2} \alpha=\tan \beta \tan \gamma$. + +- Claim 2. Let $A^{\prime} B^{\prime} C^{\prime} D^{\prime}$ be a quadrilateral inscribed in circle $\Gamma$. Let diagonals $A^{\prime} C^{\prime}$ and $B^{\prime} D^{\prime}$ meet at $E^{\prime}$, and $F^{\prime}$ be the intersection of lines $A^{\prime} B^{\prime}$ and $C^{\prime} D^{\prime}$. Let $M^{\prime}$ be the midpoint of $E^{\prime} F^{\prime}$. Then the power of $M^{\prime}$ with respect to $\Gamma$ is equal to $\left(M^{\prime} E^{\prime}\right)^{2}$. + +Proof. + + +Let $O^{\prime}$ be the centre of $\Gamma$ and let $\Gamma^{\prime}$ be the circle with centre $M^{\prime}$ passing through $E^{\prime}$. Let $F_{1}$ be the inversion image of $F^{\prime}$ with respect to $\Gamma$. It is well-known that $E^{\prime}$ lies on the polar of $F^{\prime}$ with respect to $\Gamma$. This shows $E^{\prime} F_{1} \perp O^{\prime} F^{\prime}$ and hence $F_{1}$ lies on $\Gamma^{\prime}$. It follows that the inversion image of $\Gamma^{\prime}$ with respect to $\Gamma$ is $\Gamma^{\prime}$ itself. This shows $\Gamma^{\prime}$ is orthogonal to $\Gamma$, and thus the power of $M^{\prime}$ with respect to $\Gamma$ is the square of radius of $\Gamma^{\prime}$, which is $\left(M^{\prime} E^{\prime}\right)^{2}$. + +We return to the main problem. Let $Z$ be the intersection of lines $A D$ and $B C$, and $W$ be the intersection of lines $A B$ and $C D$. Since $\measuredangle P D Z=\measuredangle P B C=\measuredangle P B Z$, point $Z$ lies on $\omega$. Similarly, $W$ lies on $\omega$. Applying Claim 2 to the cyclic quadrilateral $Z B D W$, we know that the power of $M$ with respect to $\omega$ is $M A^{2}$. Hence, $M X \cdot M B=M A^{2}$. + +Suppose the line through $B$ perpendicular to $B E$ meets line $A C$ at $T$. Then $B E$ and $B T$ are the angle bisectors of $\angle C B A$. This shows $(T, E ; A, C)$ is harmonic. Thus, we have $M E \cdot M T=M A^{2}=M X \cdot M B$. It follows that $E, T, B, X$ are concyclic. + + +The result is trivial for the special case $A D=C D$ since $P, Q$ lie on the perpendicular bisector of $A C$ in that case. Similarly, the case $A B=C B$ is trivial. It remains to consider the general cases where we can apply Claim 1 in the latter part of the proof. + +Let the projections from $P$ and $Q$ to $A C$ be $P^{\prime}$ and $Q^{\prime}$ respectively. Then $P Q \perp A C$ if and only if $P^{\prime}=Q^{\prime}$ if and only if $\frac{E P^{\prime}}{F P^{\prime}}=\frac{E Q^{\prime}}{F Q^{\prime}}$ in terms of directed lengths. Note that + +$$ +\frac{E P^{\prime}}{F P^{\prime}}=\frac{\tan \measuredangle E F P}{\tan \measuredangle F E P}=\frac{\tan \measuredangle A F D}{\tan \measuredangle A E B} +$$ + +Next, we have $\frac{E Q^{\prime}}{F Q^{\prime}}=\frac{\tan \measuredangle E F Q}{\tan \measuredangle F E Q}$ where $\measuredangle F E Q=\measuredangle T E X=\measuredangle T B X=\frac{\pi}{2}+\measuredangle E B M$ and by symmetry $\measuredangle E F Q=\frac{\pi}{2}+\measuredangle F D M$. Combining all these, it suffices to show + +$$ +\frac{\tan \measuredangle A F D}{\tan \measuredangle A E B}=\frac{\tan \measuredangle M B E}{\tan \measuredangle M D F} +$$ + +We now apply Claim 1 twice to get + +$$ +\tan \measuredangle A F D \tan \measuredangle M D F=\tan ^{2} \measuredangle F D C=\tan ^{2} \measuredangle E B A=\tan \measuredangle M B E \tan \measuredangle A E B . +$$ + +The result then follows. + +G7. Let $I$ be the incentre of a non-equilateral triangle $A B C, I_{A}$ be the $A$-excentre, $I_{A}^{\prime}$ be the reflection of $I_{A}$ in $B C$, and $l_{A}$ be the reflection of line $A I_{A}^{\prime}$ in $A I$. Define points $I_{B}, I_{B}^{\prime}$ and line $l_{B}$ analogously. Let $P$ be the intersection point of $l_{A}$ and $l_{B}$. +(a) Prove that $P$ lies on line $O I$ where $O$ is the circumcentre of triangle $A B C$. +(b) Let one of the tangents from $P$ to the incircle of triangle $A B C$ meet the circumcircle at points $X$ and $Y$. Show that $\angle X I Y=120^{\circ}$. + +## Solution 1. + +(a) Let $A^{\prime}$ be the reflection of $A$ in $B C$ and let $M$ be the second intersection of line $A I$ and the circumcircle $\Gamma$ of triangle $A B C$. As triangles $A B A^{\prime}$ and $A O C$ are isosceles with $\angle A B A^{\prime}=2 \angle A B C=\angle A O C$, they are similar to each other. Also, triangles $A B I_{A}$ and $A I C$ are similar. Therefore we have + +$$ +\frac{A A^{\prime}}{A I_{A}}=\frac{A A^{\prime}}{A B} \cdot \frac{A B}{A I_{A}}=\frac{A C}{A O} \cdot \frac{A I}{A C}=\frac{A I}{A O} +$$ + +Together with $\angle A^{\prime} A I_{A}=\angle I A O$, we find that triangles $A A^{\prime} I_{A}$ and $A I O$ are similar. + + +Denote by $P^{\prime}$ the intersection of line $A P$ and line $O I$. Using directed angles, we have + +$$ +\begin{aligned} +\measuredangle M A P^{\prime} & =\measuredangle I_{A}^{\prime} A I_{A}=\measuredangle I_{A}^{\prime} A A^{\prime}-\measuredangle I_{A} A A^{\prime}=\measuredangle A A^{\prime} I_{A}-\measuredangle(A M, O M) \\ +& =\measuredangle A I O-\measuredangle A M O=\measuredangle M O P^{\prime} . +\end{aligned} +$$ + +This shows $M, O, A, P^{\prime}$ are concyclic. + +Denote by $R$ and $r$ the circumradius and inradius of triangle $A B C$. Then + +$$ +I P^{\prime}=\frac{I A \cdot I M}{I O}=\frac{I O^{2}-R^{2}}{I O} +$$ + +is independent of $A$. Hence, $B P$ also meets line $O I$ at the same point $P^{\prime}$ so that $P^{\prime}=P$, and $P$ lies on $O I$. +(b) By Poncelet's Porism, the other tangents to the incircle of triangle $A B C$ from $X$ and $Y$ meet at a point $Z$ on $\Gamma$. Let $T$ be the touching point of the incircle to $X Y$, and let $D$ be the midpoint of $X Y$. We have + +$$ +\begin{aligned} +O D & =I T \cdot \frac{O P}{I P}=r\left(1+\frac{O I}{I P}\right)=r\left(1+\frac{O I^{2}}{O I \cdot I P}\right)=r\left(1+\frac{R^{2}-2 R r}{R^{2}-I O^{2}}\right) \\ +& =r\left(1+\frac{R^{2}-2 R r}{2 R r}\right)=\frac{R}{2}=\frac{O X}{2} +\end{aligned} +$$ + +This shows $\angle X Z Y=60^{\circ}$ and hence $\angle X I Y=120^{\circ}$. + +## Solution 2. + +(a) Note that triangles $A I_{B} C$ and $I_{A} B C$ are similar since their corresponding interior angles are equal. Therefore, the four triangles $A I_{B}^{\prime} C, A I_{B} C, I_{A} B C$ and $I_{A}^{\prime} B C$ are all similar. From $\triangle A I_{B}^{\prime} C \sim \triangle I_{A}^{\prime} B C$, we get $\triangle A I_{A}^{\prime} C \sim \triangle I_{B}^{\prime} B C$. From $\measuredangle A B P=\measuredangle I_{B}^{\prime} B C=\measuredangle A I_{A}^{\prime} C$ and $\measuredangle B A P=\measuredangle I_{A}^{\prime} A C$, the triangles $A B P$ and $A I_{A}^{\prime} C$ are directly similar. + + +Consider the inversion with centre $A$ and radius $\sqrt{A B \cdot A C}$ followed by the reflection in $A I$. Then $B$ and $C$ are mapped to each other, and $I$ and $I_{A}$ are mapped to each other. + +From the similar triangles obtained, we have $A P \cdot A I_{A}^{\prime}=A B \cdot A C$ so that $P$ is mapped to $I_{A}^{\prime}$ under the transformation. In addition, line $A O$ is mapped to the altitude from $A$, and hence $O$ is mapped to the reflection of $A$ in $B C$, which we call point $A^{\prime}$. Note that $A A^{\prime} I_{A} I_{A}^{\prime}$ is an isosceles trapezoid, which shows it is inscribed in a circle. The preimage of this circle is a straight line, meaning that $O, I, P$ are collinear. +(b) Denote by $R$ and $r$ the circumradius and inradius of triangle $A B C$. Note that by the above transformation, we have $\triangle A P O \sim \triangle A A^{\prime} I_{A}^{\prime}$ and $\triangle A A^{\prime} I_{A} \sim \triangle A I O$. Therefore, we find that + +$$ +P O=A^{\prime} I_{A}^{\prime} \cdot \frac{A O}{A I_{A}^{\prime}}=A I_{A} \cdot \frac{A O}{A^{\prime} I_{A}}=\frac{A I_{A}}{A^{\prime} I_{A}} \cdot A O=\frac{A O}{I O} \cdot A O +$$ + +This shows $P O \cdot I O=R^{2}$, and it follows that $P$ and $I$ are mapped to each other under the inversion with respect to the circumcircle $\Gamma$ of triangle $A B C$. Then $P X \cdot P Y$, which is the power of $P$ with respect to $\Gamma$, equals $P I \cdot P O$. This yields $X, I, O, Y$ are concyclic. + +Let $T$ be the touching point of the incircle to $X Y$, and let $D$ be the midpoint of $X Y$. Then + +$$ +O D=I T \cdot \frac{P O}{P I}=r \cdot \frac{P O}{P O-I O}=r \cdot \frac{R^{2}}{R^{2}-I O^{2}}=r \cdot \frac{R^{2}}{2 R r}=\frac{R}{2} +$$ + +This shows $\angle D O X=60^{\circ}$ and hence $\angle X I Y=\angle X O Y=120^{\circ}$. +Comment. A simplification of this problem is to ask part (a) only. Note that the question in part (b) implicitly requires $P$ to lie on $O I$, or otherwise the angle is not uniquely determined as we can find another tangent from $P$ to the incircle. + +G8. Let $A_{1}, B_{1}$ and $C_{1}$ be points on sides $B C, C A$ and $A B$ of an acute triangle $A B C$ respectively, such that $A A_{1}, B B_{1}$ and $C C_{1}$ are the internal angle bisectors of triangle $A B C$. Let $I$ be the incentre of triangle $A B C$, and $H$ be the orthocentre of triangle $A_{1} B_{1} C_{1}$. Show that + +$$ +A H+B H+C H \geqslant A I+B I+C I +$$ + +Solution. Without loss of generality, assume $\alpha=\angle B A C \leqslant \beta=\angle C B A \leqslant \gamma=\angle A C B$. Denote by $a, b, c$ the lengths of $B C, C A, A B$ respectively. We first show that triangle $A_{1} B_{1} C_{1}$ is acute. + +Choose points $D$ and $E$ on side $B C$ such that $B_{1} D / / A B$ and $B_{1} E$ is the internal angle bisector of $\angle B B_{1} C$. As $\angle B_{1} D B=180^{\circ}-\beta$ is obtuse, we have $B B_{1}>B_{1} D$. Thus, + +$$ +\frac{B E}{E C}=\frac{B B_{1}}{B_{1} C}>\frac{D B_{1}}{B_{1} C}=\frac{B A}{A C}=\frac{B A_{1}}{A_{1} C} +$$ + +Therefore, $B E>B A_{1}$ and $\frac{1}{2} \angle B B_{1} C=\angle B B_{1} E>\angle B B_{1} A_{1}$. Similarly, $\frac{1}{2} \angle B B_{1} A>\angle B B_{1} C_{1}$. It follows that + +$$ +\angle A_{1} B_{1} C_{1}=\angle B B_{1} A_{1}+\angle B B_{1} C_{1}<\frac{1}{2}\left(\angle B B_{1} C+\angle B B_{1} A\right)=90^{\circ} +$$ + +is acute. By symmetry, triangle $A_{1} B_{1} C_{1}$ is acute. +Let $B B_{1}$ meet $A_{1} C_{1}$ at $F$. From $\alpha \leqslant \gamma$, we get $a \leqslant c$, which implies + +$$ +B A_{1}=\frac{c a}{b+c} \leqslant \frac{a c}{a+b}=B C_{1} +$$ + +and hence $\angle B C_{1} A_{1} \leqslant \angle B A_{1} C_{1}$. As $B F$ is the internal angle bisector of $\angle A_{1} B C_{1}$, this shows $\angle B_{1} F C_{1}=\angle B F A_{1} \leqslant 90^{\circ}$. Hence, $H$ lies on the same side of $B B_{1}$ as $C_{1}$. This shows $H$ lies inside triangle $B B_{1} C_{1}$. Similarly, from $\alpha \leqslant \beta$ and $\beta \leqslant \gamma$, we know that $H$ lies inside triangles $C C_{1} B_{1}$ and $A A_{1} C_{1}$. + + +As $\alpha \leqslant \beta \leqslant \gamma$, we have $\alpha \leqslant 60^{\circ} \leqslant \gamma$. Then $\angle B I C \leqslant 120^{\circ} \leqslant \angle A I B$. Firstly, suppose $\angle A I C \geqslant 120^{\circ}$. + +Rotate points $B, I, H$ through $60^{\circ}$ about $A$ to $B^{\prime}, I^{\prime}, H^{\prime}$ so that $B^{\prime}$ and $C$ lie on different sides of $A B$. Since triangle $A I^{\prime} I$ is equilateral, we have + +$$ +A I+B I+C I=I^{\prime} I+B^{\prime} I^{\prime}+I C=B^{\prime} I^{\prime}+I^{\prime} I+I C . +$$ + +Similarly, + +$$ +A H+B H+C H=H^{\prime} H+B^{\prime} H^{\prime}+H C=B^{\prime} H^{\prime}+H^{\prime} H+H C +$$ + +As $\angle A I I^{\prime}=\angle A I^{\prime} I=60^{\circ}, \angle A I^{\prime} B^{\prime}=\angle A I B \geqslant 120^{\circ}$ and $\angle A I C \geqslant 120^{\circ}$, the quadrilateral $B^{\prime} I^{\prime} I C$ is convex and lies on the same side of $B^{\prime} C$ as $A$. + +Next, since $H$ lies inside triangle $A C C_{1}, H$ lies outside $B^{\prime} I^{\prime} I C$. Also, $H$ lying inside triangle $A B I$ implies $H^{\prime}$ lies inside triangle $A B^{\prime} I^{\prime}$. This shows $H^{\prime}$ lies outside $B^{\prime} I^{\prime} I C$ and hence the convex quadrilateral $B^{\prime} I^{\prime} I C$ is contained inside the quadrilateral $B^{\prime} H^{\prime} H C$. It follows that the perimeter of $B^{\prime} I^{\prime} I C$ cannot exceed the perimeter of $B^{\prime} H^{\prime} H C$. From (1) and (2), we conclude that + +$$ +A H+B H+C H \geqslant A I+B I+C I +$$ + +For the case $\angle A I C<120^{\circ}$, we can rotate $B, I, H$ through $60^{\circ}$ about $C$ to $B^{\prime}, I^{\prime}, H^{\prime}$ so that $B^{\prime}$ and $A$ lie on different sides of $B C$. The proof is analogous to the previous case and we still get the desired inequality. + +## Number Theory + +N1. For any positive integer $k$, denote the sum of digits of $k$ in its decimal representation by $S(k)$. Find all polynomials $P(x)$ with integer coefficients such that for any positive integer $n \geqslant 2016$, the integer $P(n)$ is positive and + +$$ +S(P(n))=P(S(n)) +$$ + +Answer. + +- $P(x)=c$ where $1 \leqslant c \leqslant 9$ is an integer; or +- $P(x)=x$. + +Solution 1. We consider three cases according to the degree of $P$. + +- Case 1. $P(x)$ is a constant polynomial. + +Let $P(x)=c$ where $c$ is an integer constant. Then (1) becomes $S(c)=c$. This holds if and only if $1 \leqslant c \leqslant 9$. + +- Case 2. $\operatorname{deg} P=1$. + +We have the following observation. For any positive integers $m, n$, we have + +$$ +S(m+n) \leqslant S(m)+S(n) +$$ + +and equality holds if and only if there is no carry in the addition $m+n$. +Let $P(x)=a x+b$ for some integers $a, b$ where $a \neq 0$. As $P(n)$ is positive for large $n$, we must have $a \geqslant 1$. The condition (1) becomes $S(a n+b)=a S(n)+b$ for all $n \geqslant 2016$. Setting $n=2025$ and $n=2020$ respectively, we get + +$$ +S(2025 a+b)-S(2020 a+b)=(a S(2025)+b)-(a S(2020)+b)=5 a +$$ + +On the other hand, (2) implies + +$$ +S(2025 a+b)=S((2020 a+b)+5 a) \leqslant S(2020 a+b)+S(5 a) +$$ + +These give $5 a \leqslant S(5 a)$. As $a \geqslant 1$, this holds only when $a=1$, in which case (1) reduces to $S(n+b)=S(n)+b$ for all $n \geqslant 2016$. Then we find that + +$$ +S(n+1+b)-S(n+b)=(S(n+1)+b)-(S(n)+b)=S(n+1)-S(n) +$$ + +If $b>0$, we choose $n$ such that $n+1+b=10^{k}$ for some sufficiently large $k$. Note that all the digits of $n+b$ are 9 's, so that the left-hand side of (3) equals $1-9 k$. As $n$ is a positive integer less than $10^{k}-1$, we have $S(n)<9 k$. Therefore, the right-hand side of (3) is at least $1-(9 k-1)=2-9 k$, which is a contradiction. + +The case $b<0$ can be handled similarly by considering $n+1$ to be a large power of 10 . Therefore, we conclude that $P(x)=x$, in which case (1) is trivially satisfied. + +- Case 3. $\operatorname{deg} P \geqslant 2$. + +Suppose the leading term of $P$ is $a_{d} n^{d}$ where $a_{d} \neq 0$. Clearly, we have $a_{d}>0$. Consider $n=10^{k}-1$ in (1). We get $S(P(n))=P(9 k)$. Note that $P(n)$ grows asymptotically as fast as $n^{d}$, so $S(P(n))$ grows asymptotically as no faster than a constant multiple of $k$. On the other hand, $P(9 k)$ grows asymptotically as fast as $k^{d}$. This shows the two sides of the last equation cannot be equal for sufficiently large $k$ since $d \geqslant 2$. + +Therefore, we conclude that $P(x)=c$ where $1 \leqslant c \leqslant 9$ is an integer, or $P(x)=x$. +Solution 2. Let $P(x)=a_{d} x^{d}+a_{d-1} x^{d-1}+\cdots+a_{0}$. Clearly $a_{d}>0$. There exists an integer $m \geqslant 1$ such that $\left|a_{i}\right|<10^{m}$ for all $0 \leqslant i \leqslant d$. Consider $n=9 \times 10^{k}$ for a sufficiently large integer $k$ in (1). If there exists an index $0 \leqslant i \leqslant d-1$ such that $a_{i}<0$, then all digits of $P(n)$ in positions from $10^{i k+m+1}$ to $10^{(i+1) k-1}$ are all 9 's. Hence, we have $S(P(n)) \geqslant 9(k-m-1)$. On the other hand, $P(S(n))=P(9)$ is a fixed constant. Therefore, (1) cannot hold for large $k$. This shows $a_{i} \geqslant 0$ for all $0 \leqslant i \leqslant d-1$. + +Hence, $P(n)$ is an integer formed by the nonnegative integers $a_{d} \times 9^{d}, a_{d-1} \times 9^{d-1}, \ldots, a_{0}$ by inserting some zeros in between. This yields + +$$ +S(P(n))=S\left(a_{d} \times 9^{d}\right)+S\left(a_{d-1} \times 9^{d-1}\right)+\cdots+S\left(a_{0}\right) . +$$ + +Combining with (1), we have + +$$ +S\left(a_{d} \times 9^{d}\right)+S\left(a_{d-1} \times 9^{d-1}\right)+\cdots+S\left(a_{0}\right)=P(9)=a_{d} \times 9^{d}+a_{d-1} \times 9^{d-1}+\cdots+a_{0} +$$ + +As $S(m) \leqslant m$ for any positive integer $m$, with equality when $1 \leqslant m \leqslant 9$, this forces each $a_{i} \times 9^{i}$ to be a positive integer between 1 and 9 . In particular, this shows $a_{i}=0$ for $i \geqslant 2$ and hence $d \leqslant 1$. Also, we have $a_{1} \leqslant 1$ and $a_{0} \leqslant 9$. If $a_{1}=1$ and $1 \leqslant a_{0} \leqslant 9$, we take $n=10^{k}+\left(10-a_{0}\right)$ for sufficiently large $k$ in (1). This yields a contradiction since + +$$ +S(P(n))=S\left(10^{k}+10\right)=2 \neq 11=P\left(11-a_{0}\right)=P(S(n)) +$$ + +The zero polynomial is also rejected since $P(n)$ is positive for large $n$. The remaining candidates are $P(x)=x$ or $P(x)=a_{0}$ where $1 \leqslant a_{0} \leqslant 9$, all of which satisfy (1), and hence are the only solutions. + +N2. Let $\tau(n)$ be the number of positive divisors of $n$. Let $\tau_{1}(n)$ be the number of positive divisors of $n$ which have remainders 1 when divided by 3 . Find all possible integral values of the fraction $\frac{\tau(10 n)}{\tau_{1}(10 n)}$. + +Answer. All composite numbers together with 2. +Solution. In this solution, we always use $p_{i}$ to denote primes congruent to $1 \bmod 3$, and use $q_{j}$ to denote primes congruent to $2 \bmod 3$. When we express a positive integer $m$ using its prime factorization, we also include the special case $m=1$ by allowing the exponents to be zeros. We first compute $\tau_{1}(m)$ for a positive integer $m$. + +- Claim. Let $m=3^{x} p_{1}^{a_{1}} p_{2}^{a_{2}} \cdots p_{s}^{a_{s}} q_{1}^{b_{1}} q_{2}^{b_{2}} \cdots q_{t}^{b_{t}}$ be the prime factorization of $m$. Then + +$$ +\tau_{1}(m)=\prod_{i=1}^{s}\left(a_{i}+1\right)\left\lceil\frac{1}{2} \prod_{j=1}^{t}\left(b_{j}+1\right)\right\rceil . +$$ + +Proof. To choose a divisor of $m$ congruent to $1 \bmod 3$, it cannot have the prime divisor 3, while there is no restriction on choosing prime factors congruent to $1 \bmod 3$. Also, we have to choose an even number of prime factors (counted with multiplicity) congruent to $2 \bmod 3$. + +If $\prod_{j=1}^{t}\left(b_{j}+1\right)$ is even, then we may assume without loss of generality $b_{1}+1$ is even. We can choose the prime factors $q_{2}, q_{3}, \ldots, q_{t}$ freely in $\prod_{j=2}^{t}\left(b_{j}+1\right)$ ways. Then the parity of the number of $q_{1}$ is uniquely determined, and hence there are $\frac{1}{2}\left(b_{1}+1\right)$ ways to choose the exponent of $q_{1}$. Hence (1) is verified in this case. + +If $\prod_{j=1}^{t}\left(b_{j}+1\right)$ is odd, we use induction on $t$ to count the number of choices. When $t=1$, there are $\left\lceil\frac{b_{1}+1}{2}\right\rceil$ choices for which the exponent is even and $\left\lfloor\frac{b_{1}+1}{2}\right\rfloor$ choices for which the exponent is odd. For the inductive step, we find that there are + +$$ +\left\lceil\frac{1}{2} \prod_{j=1}^{t-1}\left(b_{j}+1\right)\right\rceil \cdot\left\lceil\frac{b_{t}+1}{2}\right\rceil+\left\lfloor\frac{1}{2} \prod_{j=1}^{t-1}\left(b_{j}+1\right)\right\rfloor \cdot\left\lfloor\frac{b_{t}+1}{2}\right\rfloor=\left\lceil\frac{1}{2} \prod_{j=1}^{t}\left(b_{j}+1\right)\right\rceil +$$ + +choices with an even number of prime factors and hence $\left\lfloor\frac{1}{2} \prod_{j=1}^{t}\left(b_{j}+1\right)\right\rfloor$ choices with an odd number of prime factors. Hence (1) is also true in this case. + +Let $n=3^{x} 2^{y} 5^{z} p_{1}^{a_{1}} p_{2}^{a_{2}} \cdots p_{s}^{a_{s}} q_{1}^{b_{1}} q_{2}^{b_{2}} \cdots q_{t}^{b_{t}}$. Using the well-known formula for computing the divisor function, we get + +$$ +\tau(10 n)=(x+1)(y+2)(z+2) \prod_{i=1}^{s}\left(a_{i}+1\right) \prod_{j=1}^{t}\left(b_{j}+1\right) +$$ + +By the Claim, we have + +$$ +\tau_{1}(10 n)=\prod_{i=1}^{s}\left(a_{i}+1\right)\left\lceil\frac{1}{2}(y+2)(z+2) \prod_{j=1}^{t}\left(b_{j}+1\right)\right\rceil +$$ + +If $c=(y+2)(z+2) \prod_{j=1}^{t}\left(b_{j}+1\right)$ is even, then (2) and (3) imply + +$$ +\frac{\tau(10 n)}{\tau_{1}(10 n)}=2(x+1) +$$ + +In this case $\frac{\tau(10 n)}{\tau_{1}(10 n)}$ can be any even positive integer as $x$ runs through all nonnegative integers. +If $c$ is odd, which means $y, z$ are odd and each $b_{j}$ is even, then (2) and (3) imply + +$$ +\frac{\tau(10 n)}{\tau_{1}(10 n)}=\frac{2(x+1) c}{c+1} +$$ + +For this to be an integer, we need $c+1$ divides $2(x+1)$ since $c$ and $c+1$ are relatively prime. Let $2(x+1)=k(c+1)$. Then (4) reduces to + +$$ +\frac{\tau(10 n)}{\tau_{1}(10 n)}=k c=k(y+2)(z+2) \prod_{j=1}^{t}\left(b_{j}+1\right) +$$ + +Noting that $y, z$ are odd, the integers $y+2$ and $z+2$ are at least 3 . This shows the integer in this case must be composite. On the other hand, for any odd composite number $a b$ with $a, b \geqslant 3$, we may simply take $n=3^{\frac{a b-1}{2}} \cdot 2^{a-2} \cdot 5^{b-2}$ so that $\frac{\tau(10 n)}{\tau_{1}(10 n)}=a b$ from (5). + +We conclude that the fraction can be any even integer or any odd composite number. Equivalently, it can be 2 or any composite number. + +N3. Define $P(n)=n^{2}+n+1$. For any positive integers $a$ and $b$, the set + +$$ +\{P(a), P(a+1), P(a+2), \ldots, P(a+b)\} +$$ + +is said to be fragrant if none of its elements is relatively prime to the product of the other elements. Determine the smallest size of a fragrant set. + +Answer. 6. +Solution. We have the following observations. +(i) $(P(n), P(n+1))=1$ for any $n$. + +We have $(P(n), P(n+1))=\left(n^{2}+n+1, n^{2}+3 n+3\right)=\left(n^{2}+n+1,2 n+2\right)$. Noting that $n^{2}+n+1$ is odd and $\left(n^{2}+n+1, n+1\right)=(1, n+1)=1$, the claim follows. +(ii) $(P(n), P(n+2))=1$ for $n \not \equiv 2(\bmod 7)$ and $(P(n), P(n+2))=7$ for $n \equiv 2(\bmod 7)$. + +From $(2 n+7) P(n)-(2 n-1) P(n+2)=14$ and the fact that $P(n)$ is odd, $(P(n), P(n+2))$ must be a divisor of 7 . The claim follows by checking $n \equiv 0,1, \ldots, 6(\bmod 7)$ directly. +(iii) $(P(n), P(n+3))=1$ for $n \not \equiv 1(\bmod 3)$ and $3 \mid(P(n), P(n+3))$ for $n \equiv 1(\bmod 3)$. + +From $(n+5) P(n)-(n-1) P(n+3)=18$ and the fact that $P(n)$ is odd, $(P(n), P(n+3))$ must be a divisor of 9 . The claim follows by checking $n \equiv 0,1,2(\bmod 3)$ directly. + +Suppose there exists a fragrant set with at most 5 elements. We may assume it contains exactly 5 elements $P(a), P(a+1), \ldots, P(a+4)$ since the following argument also works with fewer elements. Consider $P(a+2)$. From (i), it is relatively prime to $P(a+1)$ and $P(a+3)$. Without loss of generality, assume $(P(a), P(a+2))>1$. From (ii), we have $a \equiv 2(\bmod 7)$. The same observation implies $(P(a+1), P(a+3))=1$. In order that the set is fragrant, $(P(a), P(a+3))$ and $(P(a+1), P(a+4))$ must both be greater than 1. From (iii), this holds only when both $a$ and $a+1$ are congruent to $1 \bmod 3$, which is a contradiction. + +It now suffices to construct a fragrant set of size 6. By the Chinese Remainder Theorem, we can take a positive integer $a$ such that + +$$ +a \equiv 7 \quad(\bmod 19), \quad a+1 \equiv 2 \quad(\bmod 7), \quad a+2 \equiv 1 \quad(\bmod 3) +$$ + +For example, we may take $a=197$. From (ii), both $P(a+1)$ and $P(a+3)$ are divisible by 7. From (iii), both $P(a+2)$ and $P(a+5)$ are divisible by 3 . One also checks from $19 \mid P(7)=57$ and $19 \mid P(11)=133$ that $P(a)$ and $P(a+4)$ are divisible by 19. Therefore, the set $\{P(a), P(a+1), \ldots, P(a+5)\}$ is fragrant. + +Therefore, the smallest size of a fragrant set is 6 . +Comment. "Fragrant Harbour" is the English translation of "Hong Kong". +A stronger version of this problem is to show that there exists a fragrant set of size $k$ for any $k \geqslant 6$. We present a proof here. + +For each even positive integer $m$ which is not divisible by 3 , since $m^{2}+3 \equiv 3(\bmod 4)$, we can find a prime $p_{m} \equiv 3(\bmod 4)$ such that $p_{m} \mid m^{2}+3$. Clearly, $p_{m}>3$. + +If $b=2 t \geqslant 6$, we choose $a$ such that $3 \mid 2(a+t)+1$ and $p_{m} \mid 2(a+t)+1$ for each $1 \leqslant m \leqslant b$ with $m \equiv 2,4(\bmod 6)$. For $0 \leqslant r \leqslant t$ and $3 \mid r$, we have $a+t \pm r \equiv 1(\bmod 3)$ so that $3 \mid P(a+t \pm r)$. For $0 \leqslant r \leqslant t$ and $(r, 3)=1$, we have + +$$ +4 P(a+t \pm r) \equiv(-1 \pm 2 r)^{2}+2(-1 \pm 2 r)+4=4 r^{2}+3 \equiv 0 \quad\left(\bmod p_{2 r}\right) . +$$ + +Hence, $\{P(a), P(a+1), \ldots, P(a+b)\}$ is fragrant. +If $b=2 t+1 \geqslant 7$ (the case $b=5$ has been done in the original problem), we choose $a$ such that $3 \mid 2(a+t)+1$ and $p_{m} \mid 2(a+t)+1$ for $1 \leqslant m \leqslant b$ with $m \equiv 2,4(\bmod 6)$, and that $a+b \equiv 9(\bmod 13)$. Note that $a$ exists by the Chinese Remainder Theorem since $p_{m} \neq 13$ for all $m$. The even case shows that $\{P(a), P(a+1), \ldots, P(a+b-1)\}$ is fragrant. Also, one checks from $13 \mid P(9)=91$ and $13 \mid P(3)=13$ that $P(a+b)$ and $P(a+b-6)$ are divisible by 13. The proof is thus complete. + +N4. Let $n, m, k$ and $l$ be positive integers with $n \neq 1$ such that $n^{k}+m n^{l}+1$ divides $n^{k+l}-1$. Prove that + +- $m=1$ and $l=2 k$; or +- $l \mid k$ and $m=\frac{n^{k-l}-1}{n^{l}-1}$. + +Solution 1. It is given that + +$$ +n^{k}+m n^{l}+1 \mid n^{k+l}-1 +$$ + +This implies + +$$ +n^{k}+m n^{l}+1 \mid\left(n^{k+l}-1\right)+\left(n^{k}+m n^{l}+1\right)=n^{k+l}+n^{k}+m n^{l} . +$$ + +We have two cases to discuss. + +- Case 1. $l \geqslant k$. + +Since $\left(n^{k}+m n^{l}+1, n\right)=1$,(2) yields + +$$ +n^{k}+m n^{l}+1 \mid n^{l}+m n^{l-k}+1 . +$$ + +In particular, we get $n^{k}+m n^{l}+1 \leqslant n^{l}+m n^{l-k}+1$. As $n \geqslant 2$ and $k \geqslant 1,(m-1) n^{l}$ is at least $2(m-1) n^{l-k}$. It follows that the inequality cannot hold when $m \geqslant 2$. For $m=1$, the above divisibility becomes + +$$ +n^{k}+n^{l}+1 \mid n^{l}+n^{l-k}+1 . +$$ + +Note that $n^{l}+n^{l-k}+1 2 m n^{l}+1>n^{l}+m n^{l-k}+1$, it follows that $n^{k}+m n^{l}+1=n^{l}+m n^{l-k}+1$, that is, + +$$ +m\left(n^{l}-n^{l-k}\right)=n^{l}-n^{k} . +$$ + +If $m \geqslant 2$, then $m\left(n^{l}-n^{l-k}\right) \geqslant 2 n^{l}-2 n^{l-k} \geqslant 2 n^{l}-n^{l}>n^{l}-n^{k}$ gives a contradiction. Hence $m=1$ and $l-k=k$, which means $m=1$ and $l=2 k$. + +- Case 2. $l 2 n^{k}+m>n^{k}+n^{k-l}+m$, it follows that $n^{k}+m n^{l}+1=n^{k}+n^{k-l}+m$. This gives $m=\frac{n^{k-l}-1}{n^{l}-1}$. Note that $n^{l}-1 \mid n^{k-l}-1$ implies $l \mid k-l$ and hence $l \mid k$. The proof is thus complete. + +Comment. Another version of this problem is as follows: let $n, m, k$ and $l$ be positive integers with $n \neq 1$ such that $k$ and $l$ do not divide each other. Show that $n^{k}+m n^{l}+1$ does not divide $n^{k+l}-1$. + +N5. Let $a$ be a positive integer which is not a square number. Denote by $A$ the set of all positive integers $k$ such that + +$$ +k=\frac{x^{2}-a}{x^{2}-y^{2}} +$$ + +for some integers $x$ and $y$ with $x>\sqrt{a}$. Denote by $B$ the set of all positive integers $k$ such that (1) is satisfied for some integers $x$ and $y$ with $0 \leqslant x<\sqrt{a}$. Prove that $A=B$. + +Solution 1. We first prove the following preliminary result. + +- Claim. For fixed $k$, let $x, y$ be integers satisfying (1). Then the numbers $x_{1}, y_{1}$ defined by + +$$ +x_{1}=\frac{1}{2}\left(x-y+\frac{(x-y)^{2}-4 a}{x+y}\right), \quad y_{1}=\frac{1}{2}\left(x-y-\frac{(x-y)^{2}-4 a}{x+y}\right) +$$ + +are integers and satisfy (1) (with $x, y$ replaced by $x_{1}, y_{1}$ respectively). +Proof. Since $x_{1}+y_{1}=x-y$ and + +$$ +x_{1}=\frac{x^{2}-x y-2 a}{x+y}=-x+\frac{2\left(x^{2}-a\right)}{x+y}=-x+2 k(x-y), +$$ + +both $x_{1}$ and $y_{1}$ are integers. Let $u=x+y$ and $v=x-y$. The relation (1) can be rewritten as + +$$ +u^{2}-(4 k-2) u v+\left(v^{2}-4 a\right)=0 +$$ + +By Vieta's Theorem, the number $z=\frac{v^{2}-4 a}{u}$ satisfies + +$$ +v^{2}-(4 k-2) v z+\left(z^{2}-4 a\right)=0 +$$ + +Since $x_{1}$ and $y_{1}$ are defined so that $v=x_{1}+y_{1}$ and $z=x_{1}-y_{1}$, we can reverse the process and verify (1) for $x_{1}, y_{1}$. + +We first show that $B \subset A$. Take any $k \in B$ so that (1) is satisfied for some integers $x, y$ with $0 \leqslant x<\sqrt{a}$. Clearly, $y \neq 0$ and we may assume $y$ is positive. Since $a$ is not a square, we have $k>1$. Hence, we get $0 \leqslant x \sqrt{a} +$$ + +This implies $k \in A$ and hence $B \subset A$. + +Next, we shall show that $A \subset B$. Take any $k \in A$ so that (1) is satisfied for some integers $x, y$ with $x>\sqrt{a}$. Again, we may assume $y$ is positive. Among all such representations of $k$, we choose the one with smallest $x+y$. Define + +$$ +x_{1}=\frac{1}{2}\left|x-y+\frac{(x-y)^{2}-4 a}{x+y}\right|, \quad y_{1}=\frac{1}{2}\left(x-y-\frac{(x-y)^{2}-4 a}{x+y}\right) . +$$ + +By the Claim, $x_{1}, y_{1}$ are integers satisfying (1). Since $k>1$, we get $x>y>\sqrt{a}$. Therefore, we have $y_{1}>\frac{4 a}{x+y}>0$ and $\frac{4 a}{x+y} \sqrt{a}$, we get a contradiction due to the minimality of $x+y$. Therefore, we must have $0 \leqslant x_{1}<\sqrt{a}$, which means $k \in B$ so that $A \subset B$. + +The two subset relations combine to give $A=B$. +Solution 2. The relation (1) is equivalent to + +$$ +k y^{2}-(k-1) x^{2}=a +$$ + +Motivated by Pell's Equation, we prove the following, which is essentially the same as the Claim in Solution 1. + +- Claim. If $\left(x_{0}, y_{0}\right)$ is a solution to $(2)$, then $\left((2 k-1) x_{0} \pm 2 k y_{0},(2 k-1) y_{0} \pm 2(k-1) x_{0}\right)$ is also a solution to (2). + +Proof. We check directly that + +$$ +\begin{aligned} +& k\left((2 k-1) y_{0} \pm 2(k-1) x_{0}\right)^{2}-(k-1)\left((2 k-1) x_{0} \pm 2 k y_{0}\right)^{2} \\ += & \left(k(2 k-1)^{2}-(k-1)(2 k)^{2}\right) y_{0}^{2}+\left(k(2(k-1))^{2}-(k-1)(2 k-1)^{2}\right) x_{0}^{2} \\ += & k y_{0}^{2}-(k-1) x_{0}^{2}=a +\end{aligned} +$$ + +If (2) is satisfied for some $0 \leqslant x<\sqrt{a}$ and nonnegative integer $y$, then clearly (1) implies $y>x$. Also, we have $k>1$ since $a$ is not a square number. By the Claim, consider another solution to (2) defined by + +$$ +x_{1}=(2 k-1) x+2 k y, \quad y_{1}=(2 k-1) y+2(k-1) x +$$ + +It satisfies $x_{1} \geqslant(2 k-1) x+2 k(x+1)=(4 k-1) x+2 k>x$. Then we can replace the old solution by a new one which has a larger value in $x$. After a finite number of replacements, we must get a solution with $x>\sqrt{a}$. This shows $B \subset A$. + +If (2) is satisfied for some $x>\sqrt{a}$ and nonnegative integer $y$, by the Claim we consider another solution to (2) defined by + +$$ +x_{1}=|(2 k-1) x-2 k y|, \quad y_{1}=(2 k-1) y-2(k-1) x . +$$ + +From (2), we get $\sqrt{k} y>\sqrt{k-1} x$. This implies $k y>\sqrt{k(k-1)} x>(k-1) x$ and hence $(2 k-1) x-2 k y y$. Then it is clear that $(2 k-1) x-2 k y>-x$. These combine to give $x_{1} |x|$, and, in case of $x>\sqrt{a}$, another solution $\left(x_{2}, y_{2}\right)$ with $\left|x_{2}\right|<|x|$. + +Without loss of generality, assume $x, y \geqslant 0$. Let $u=x+y$ and $v=x-y$. Then $u \geqslant v$ and (1) becomes + +$$ +k=\frac{(u+v)^{2}-4 a}{4 u v} +$$ + +This is the same as + +$$ +v^{2}+(2 u-4 k u) v+u^{2}-4 a=0 +$$ + +Let $v_{1}=4 k u-2 u-v$. Then $u+v_{1}=4 k u-u-v \geqslant 8 u-u-v>u+v$. By Vieta's Theorem, $v_{1}$ satisfies + +$$ +v_{1}^{2}+(2 u-4 k u) v_{1}+u^{2}-4 a=0 +$$ + +This gives $k=\frac{\left(u+v_{1}\right)^{2}-4 a}{4 u v_{1}}$. As $k$ is an integer, $u+v_{1}$ must be even. Therefore, $x_{1}=\frac{u+v_{1}}{2}$ and $y_{1}=\frac{v_{1}-u}{2}$ are integers. By reversing the process, we can see that $\left(x_{1}, y_{1}\right)$ is a solution to (1), with $x_{1}=\frac{u+v_{1}}{2}>\frac{u+v}{2}=x \geqslant 0$. This completes the first half of the proof. + +Suppose $x>\sqrt{a}$. Then $u+v>2 \sqrt{a}$ and (3) can be rewritten as + +$$ +u^{2}+(2 v-4 k v) u+v^{2}-4 a=0 . +$$ + +Let $u_{2}=4 k v-2 v-u$. By Vieta's Theorem, we have $u u_{2}=v^{2}-4 a$ and + +$$ +u_{2}^{2}+(2 v-4 k v) u_{2}+v^{2}-4 a=0 +$$ + +By $u>0, u+v>2 \sqrt{a}$ and (3), we have $v>0$. If $u_{2} \geqslant 0$, then $v u_{2} \leqslant u u_{2}=v^{2}-4 a 0$ and $u_{2}+v\nu_{p}\left(A_{1} A_{m+1}^{2}\right)$ for $2 \leqslant m \leqslant k-1$. + +Proof. The case $m=2$ is obvious since $\nu_{p}\left(A_{1} A_{2}^{2}\right) \geqslant p^{t}>\nu_{p}\left(A_{1} A_{3}^{2}\right)$ by the condition and the above assumption. + +Suppose $\nu_{p}\left(A_{1} A_{2}^{2}\right)>\nu_{p}\left(A_{1} A_{3}^{2}\right)>\cdots>\nu_{p}\left(A_{1} A_{m}^{2}\right)$ where $3 \leqslant m \leqslant k-1$. For the induction step, we apply Ptolemy's Theorem to the cyclic quadrilateral $A_{1} A_{m-1} A_{m} A_{m+1}$ to get + +$$ +A_{1} A_{m+1} \times A_{m-1} A_{m}+A_{1} A_{m-1} \times A_{m} A_{m+1}=A_{1} A_{m} \times A_{m-1} A_{m+1} +$$ + +which can be rewritten as + +$$ +\begin{aligned} +A_{1} A_{m+1}^{2} \times A_{m-1} A_{m}^{2}= & A_{1} A_{m-1}^{2} \times A_{m} A_{m+1}^{2}+A_{1} A_{m}^{2} \times A_{m-1} A_{m+1}^{2} \\ +& -2 A_{1} A_{m-1} \times A_{m} A_{m+1} \times A_{1} A_{m} \times A_{m-1} A_{m+1} +\end{aligned} +$$ + +From this, $2 A_{1} A_{m-1} \times A_{m} A_{m+1} \times A_{1} A_{m} \times A_{m-1} A_{m+1}$ is an integer. We consider the component of $p$ of each term in (1). By the inductive hypothesis, we have $\nu_{p}\left(A_{1} A_{m-1}^{2}\right)>\nu_{p}\left(A_{1} A_{m}^{2}\right)$. Also, we have $\nu_{p}\left(A_{m} A_{m+1}^{2}\right) \geqslant p^{t}>\nu_{p}\left(A_{m-1} A_{m+1}^{2}\right)$. These give + +$$ +\nu_{p}\left(A_{1} A_{m-1}^{2} \times A_{m} A_{m+1}^{2}\right)>\nu_{p}\left(A_{1} A_{m}^{2} \times A_{m-1} A_{m+1}^{2}\right) +$$ + +Next, we have $\nu_{p}\left(4 A_{1} A_{m-1}^{2} \times A_{m} A_{m+1}^{2} \times A_{1} A_{m}^{2} \times A_{m-1} A_{m+1}^{2}\right)=\nu_{p}\left(A_{1} A_{m-1}^{2} \times A_{m} A_{m+1}^{2}\right)+$ $\nu_{p}\left(A_{1} A_{m}^{2} \times A_{m-1} A_{m+1}^{2}\right)>2 \nu_{p}\left(A_{1} A_{m}^{2} \times A_{m-1} A_{m+1}^{2}\right)$ from (2). This implies + +$$ +\nu_{p}\left(2 A_{1} A_{m-1} \times A_{m} A_{m+1} \times A_{1} A_{m} \times A_{m-1} A_{m+1}\right)>\nu_{p}\left(A_{1} A_{m}^{2} \times A_{m-1} A_{m+1}^{2}\right) +$$ + +Combining (1), (2) and (3), we conclude that + +$$ +\nu_{p}\left(A_{1} A_{m+1}^{2} \times A_{m-1} A_{m}^{2}\right)=\nu_{p}\left(A_{1} A_{m}^{2} \times A_{m-1} A_{m+1}^{2}\right) +$$ + +By $\nu_{p}\left(A_{m-1} A_{m}^{2}\right) \geqslant p^{t}>\nu_{p}\left(A_{m-1} A_{m+1}^{2}\right)$, we get $\nu_{p}\left(A_{1} A_{m+1}^{2}\right)<\nu_{p}\left(A_{1} A_{m}^{2}\right)$. The Claim follows by induction. + +From the Claim, we get a chain of inequalities + +$$ +p^{t}>\nu_{p}\left(A_{1} A_{3}^{2}\right)>\nu_{p}\left(A_{1} A_{4}^{2}\right)>\cdots>\nu_{p}\left(A_{1} A_{k}^{2}\right) \geqslant p^{t} +$$ + +which yields a contradiction. Therefore, we can show by induction that $2 S$ is divisible by $n$. +Comment. The condition that $P$ is cyclic is crucial. As a counterexample, consider the rhombus with vertices $(0,3),(4,0),(0,-3),(-4,0)$. Each of its squares of side lengths is divisible by 5 , while $2 S=48$ is not. + +The proposer also gives a proof for the case $n$ is even. One just needs an extra technical step for the case $p=2$. + +N8. Find all polynomials $P(x)$ of odd degree $d$ and with integer coefficients satisfying the following property: for each positive integer $n$, there exist $n$ positive integers $x_{1}, x_{2}, \ldots, x_{n}$ such that $\frac{1}{2}<\frac{P\left(x_{i}\right)}{P\left(x_{j}\right)}<2$ and $\frac{P\left(x_{i}\right)}{P\left(x_{j}\right)}$ is the $d$-th power of a rational number for every pair of indices $i$ and $j$ with $1 \leqslant i, j \leqslant n$. + +Answer. $P(x)=a(r x+s)^{d}$ where $a, r, s$ are integers with $a \neq 0, r \geqslant 1$ and $(r, s)=1$. +Solution. Let $P(x)=a_{d} x^{d}+a_{d-1} x^{d-1}+\cdots+a_{0}$. Consider the substitution $y=d a_{d} x+a_{d-1}$. By defining $Q(y)=P(x)$, we find that $Q$ is a polynomial with rational coefficients without the term $y^{d-1}$. Let $Q(y)=b_{d} y^{d}+b_{d-2} y^{d-2}+b_{d-3} y^{d-3}+\cdots+b_{0}$ and $B=\max _{0 \leqslant i \leqslant d}\left\{\left|b_{i}\right|\right\}$ (where $b_{d-1}=0$ ). + +The condition shows that for each $n \geqslant 1$, there exist integers $y_{1}, y_{2}, \ldots, y_{n}$ such that $\frac{1}{2}<\frac{Q\left(y_{i}\right)}{Q\left(y_{j}\right)}<2$ and $\frac{Q\left(y_{i}\right)}{Q\left(y_{j}\right)}$ is the $d$-th power of a rational number for $1 \leqslant i, j \leqslant n$. Since $n$ can be arbitrarily large, we may assume all $x_{i}$ 's and hence $y_{i}$ 's are integers larger than some absolute constant in the following. + +By Dirichlet's Theorem, since $d$ is odd, we can find a sufficiently large prime $p$ such that $p \equiv 2(\bmod d)$. In particular, we have $(p-1, d)=1$. For this fixed $p$, we choose $n$ to be sufficiently large. Then by the Pigeonhole Principle, there must be $d+1$ of $y_{1}, y_{2}, \ldots, y_{n}$ which are congruent $\bmod p$. Without loss of generality, assume $y_{i} \equiv y_{j}(\bmod p)$ for $1 \leqslant i, j \leqslant d+1$. We shall establish the following. + +- Claim. $\frac{Q\left(y_{i}\right)}{Q\left(y_{1}\right)}=\frac{y_{i}^{d}}{y_{1}^{d}}$ for $2 \leqslant i \leqslant d+1$. + +Proof. Let $\frac{Q\left(y_{i}\right)}{Q\left(y_{1}\right)}=\frac{l^{d}}{m^{d}}$ where $(l, m)=1$ and $l, m>0$. This can be rewritten in the expanded form + +$$ +b_{d}\left(m^{d} y_{i}^{d}-l^{d} y_{1}^{d}\right)=-\sum_{j=0}^{d-2} b_{j}\left(m^{d} y_{i}^{j}-l^{d} y_{1}^{j}\right) +$$ + +Let $c$ be the common denominator of $Q$, so that $c Q(k)$ is an integer for any integer $k$. Note that $c$ depends only on $P$ and so we may assume $(p, c)=1$. Then $y_{1} \equiv y_{i}(\bmod p)$ implies $c Q\left(y_{1}\right) \equiv c Q\left(y_{i}\right)(\bmod p)$. + +- Case 1. $p \mid c Q\left(y_{1}\right)$. + +In this case, there is a cancellation of $p$ in the numerator and denominator of $\frac{c Q\left(y_{i}\right)}{c Q\left(y_{1}\right)}$, so that $m^{d} \leqslant p^{-1}\left|c Q\left(y_{1}\right)\right|$. Noting $\left|Q\left(y_{1}\right)\right|<2 B y_{1}^{d}$ as $y_{1}$ is large, we get + +$$ +m \leqslant p^{-\frac{1}{d}}(2 c B)^{\frac{1}{d}} y_{1} +$$ + +For large $y_{1}$ and $y_{i}$, the relation $\frac{1}{2}<\frac{Q\left(y_{i}\right)}{Q\left(y_{1}\right)}<2$ implies + +$$ +\frac{1}{3}<\frac{y_{i}^{d}}{y_{1}^{d}}<3 +$$ + +We also have + +$$ +\frac{1}{2}<\frac{l^{d}}{m^{d}}<2 +$$ + +Now, the left-hand side of (1) is + +$$ +b_{d}\left(m y_{i}-l y_{1}\right)\left(m^{d-1} y_{i}^{d-1}+m^{d-2} y_{i}^{d-2} l y_{1}+\cdots+l^{d-1} y_{1}^{d-1}\right) . +$$ + +Suppose on the contrary that $m y_{i}-l y_{1} \neq 0$. Then the absolute value of the above expression is at least $\left|b_{d}\right| m^{d-1} y_{i}^{d-1}$. On the other hand, the absolute value of the right-hand side of (1) is at most + +$$ +\begin{aligned} +\sum_{j=0}^{d-2} B\left(m^{d} y_{i}^{j}+l^{d} y_{1}^{j}\right) & \leqslant(d-1) B\left(m^{d} y_{i}^{d-2}+l^{d} y_{1}^{d-2}\right) \\ +& \leqslant(d-1) B\left(7 m^{d} y_{i}^{d-2}\right) \\ +& \leqslant 7(d-1) B\left(p^{-\frac{1}{d}}(2 c B)^{\frac{1}{d}} y_{1}\right) m^{d-1} y_{i}^{d-2} \\ +& \leqslant 21(d-1) B p^{-\frac{1}{d}}(2 c B)^{\frac{1}{d}} m^{d-1} y_{i}^{d-1} +\end{aligned} +$$ + +by using successively (3), (4), (2) and again (3). This shows + +$$ +\left|b_{d}\right| m^{d-1} y_{i}^{d-1} \leqslant 21(d-1) B p^{-\frac{1}{d}}(2 c B)^{\frac{1}{d}} m^{d-1} y_{i}^{d-1}, +$$ + +which is a contradiction for large $p$ as $b_{d}, B, c, d$ depend only on the polynomial $P$. Therefore, we have $m y_{i}-l y_{1}=0$ in this case. + +- Case 2. $\left(p, c Q\left(y_{1}\right)\right)=1$. + +From $c Q\left(y_{1}\right) \equiv c Q\left(y_{i}\right)(\bmod p)$, we have $l^{d} \equiv m^{d}(\bmod p)$. Since $(p-1, d)=1$, we use Fermat Little Theorem to conclude $l \equiv m(\bmod p)$. Then $p \mid m y_{i}-l y_{1}$. Suppose on the contrary that $m y_{i}-l y_{1} \neq 0$. Then the left-hand side of (1) has absolute value at least $\left|b_{d}\right| p m^{d-1} y_{i}^{d-1}$. Similar to Case 1, the right-hand side of (1) has absolute value at most + +$$ +21(d-1) B(2 c B)^{\frac{1}{d}} m^{d-1} y_{i}^{d-1} +$$ + +which must be smaller than $\left|b_{d}\right| p m^{d-1} y_{i}^{d-1}$ for large $p$. Again this yields a contradiction and hence $m y_{i}-l y_{1}=0$. + +In both cases, we find that $\frac{Q\left(y_{i}\right)}{Q\left(y_{1}\right)}=\frac{l^{d}}{m^{d}}=\frac{y_{i}^{d}}{y_{1}^{d}}$. +From the Claim, the polynomial $Q\left(y_{1}\right) y^{d}-y_{1}^{d} Q(y)$ has roots $y=y_{1}, y_{2}, \ldots, y_{d+1}$. Since its degree is at most $d$, this must be the zero polynomial. Hence, $Q(y)=b_{d} y^{d}$. This implies $P(x)=a_{d}\left(x+\frac{a_{d-1}}{d a_{d}}\right)^{d}$. Let $\frac{a_{d-1}}{d a_{d}}=\frac{s}{r}$ with integers $r, s$ where $r \geqslant 1$ and $(r, s)=1$. Since $P$ has integer coefficients, we need $r^{d} \mid a_{d}$. Let $a_{d}=r^{d} a$. Then $P(x)=a(r x+s)^{d}$. It is obvious that such a polynomial satisfies the conditions. + +Comment. In the proof, the use of prime and Dirichlet's Theorem can be avoided. One can easily show that each $P\left(x_{i}\right)$ can be expressed in the form $u v_{i}^{d}$ where $u, v_{i}$ are integers and $u$ cannot be divisible by the $d$-th power of a prime (note that $u$ depends only on $P$ ). By fixing a large integer $q$ and by choosing a large $n$, we can apply the Pigeonhole Principle and assume +$x_{1} \equiv x_{2} \equiv \cdots \equiv x_{d+1}(\bmod q)$ and $v_{1} \equiv v_{2} \equiv \cdots \equiv v_{d+1}(\bmod q)$. Then the remaining proof is similar to Case 2 of the Solution. + +Alternatively, we give another modification of the proof as follows. +We take a sufficiently large $n$ and consider the corresponding positive integers $y_{1}, y_{2}, \ldots, y_{n}$. For each $2 \leqslant i \leqslant n$, let $\frac{Q\left(y_{i}\right)}{Q\left(y_{1}\right)}=\frac{l_{i}^{d}}{m_{i}^{d}}$. + +As in Case 1, if there are $d$ indices $i$ such that the integers $\frac{c\left|Q\left(y_{1}\right)\right|}{m_{i}^{d}}$ are bounded below by a constant depending only on $P$, we can establish the Claim using those $y_{i}$ 's and complete the proof. Similarly, as in Case 2, if there are $d$ indices $i$ such that the integers $\left|m_{i} y_{i}-l_{i} y_{1}\right|$ are bounded below, then the proof goes the same. So it suffices to consider the case where $\frac{c\left|Q\left(y_{1}\right)\right|}{m_{i}^{d}} \leqslant M$ and $\left|m_{i} y_{i}-l_{i} y_{1}\right| \leqslant N$ for all $2 \leqslant i \leqslant n^{\prime}$ where $M, N$ are fixed constants and $n^{\prime}$ is large. Since there are only finitely many choices for $m_{i}$ and $m_{i} y_{i}-l_{i} y_{1}$, by the Pigeonhole Principle, we can assume without loss of generality $m_{i}=m$ and $m_{i} y_{i}-l_{i} y_{1}=t$ for $2 \leqslant i \leqslant d+2$. Then + +$$ +\frac{Q\left(y_{i}\right)}{Q\left(y_{1}\right)}=\frac{l_{i}^{d}}{m^{d}}=\frac{\left(m y_{i}-t\right)^{d}}{m^{d} y_{1}^{d}} +$$ + +so that $Q\left(y_{1}\right)(m y-t)^{d}-m^{d} y_{1}^{d} Q(y)$ has roots $y=y_{2}, y_{3}, \ldots, y_{d+2}$. Its degree is at most $d$ and hence it is the zero polynomial. Therefore, $Q(y)=\frac{b_{d}}{m^{d}}(m y-t)^{d}$. Indeed, $Q$ does not have the term $y^{d-1}$, which means $t$ should be 0 . This gives the corresponding $P(x)$ of the desired form. + +The two modifications of the Solution work equally well when the degree $d$ is even. + diff --git a/IMO/md/en-IMO2017SL.md b/IMO/md/en-IMO2017SL.md new file mode 100644 index 0000000000000000000000000000000000000000..672a0a9eb08ecc7bc3e4aa25377096c9154798d2 --- /dev/null +++ b/IMO/md/en-IMO2017SL.md @@ -0,0 +1,2968 @@ + + +# ImO2017
RIO DE JANEIRO - BRAZIL + +58 ${ }^{\text {th }}$ International Mathematical Olympiad + +## Shortlisted Problems (with solutions) + + + +## Shortlisted Problems (with solutions) + +$58^{\text {th }}$ International Mathematical Olympiad Rio de Janeiro, 12-23 July 2017 + +## The Shortlist has to be kept strictly confidential until the conclusion of the following International Mathematical Olympiad. IMO General Regulations §6.6 + +## Contributing Countries + +The Organizing Committee and the Problem Selection Committee of IMO 2017 thank the following 51 countries for contributing 150 problem proposals: + +Albania, Algeria, Armenia, Australia, Austria, Azerbaijan, Belarus, Belgium, Bulgaria, Cuba, Cyprus, Czech Republic, Denmark, Estonia, France, Georgia, Germany, Greece, Hong Kong, India, Iran, Ireland, Israel, Italy, Japan, Kazakhstan, Latvia, Lithuania, Luxembourg, Mexico, Montenegro, Morocco, Netherlands, Romania, Russia, Serbia, Singapore, Slovakia, Slovenia, South Africa, Sweden, Switzerland, Taiwan, Tajikistan, Tanzania, Thailand, Trinidad and Tobago, Turkey, Ukraine, United Kingdom, U.S.A. + +## Problem Selection Committee + + + +Carlos Gustavo Tamm de Araújo Moreira (Gugu) (chairman), Luciano Monteiro de Castro, Ilya I. Bogdanov, Géza Kós, Carlos Yuzo Shine, Zhuo Qun (Alex) Song, Ralph Costa Teixeira, Eduardo Tengan + +## Problems + +## Algebra + +A1. Let $a_{1}, a_{2}, \ldots, a_{n}, k$, and $M$ be positive integers such that + +$$ +\frac{1}{a_{1}}+\frac{1}{a_{2}}+\cdots+\frac{1}{a_{n}}=k \quad \text { and } \quad a_{1} a_{2} \ldots a_{n}=M +$$ + +If $M>1$, prove that the polynomial + +$$ +P(x)=M(x+1)^{k}-\left(x+a_{1}\right)\left(x+a_{2}\right) \cdots\left(x+a_{n}\right) +$$ + +has no positive roots. +(Trinidad and Tobago) +A2. Let $q$ be a real number. Gugu has a napkin with ten distinct real numbers written on it, and he writes the following three lines of real numbers on the blackboard: + +- In the first line, Gugu writes down every number of the form $a-b$, where $a$ and $b$ are two (not necessarily distinct) numbers on his napkin. +- In the second line, Gugu writes down every number of the form $q a b$, where $a$ and $b$ are two (not necessarily distinct) numbers from the first line. +- In the third line, Gugu writes down every number of the form $a^{2}+b^{2}-c^{2}-d^{2}$, where $a, b, c, d$ are four (not necessarily distinct) numbers from the first line. + +Determine all values of $q$ such that, regardless of the numbers on Gugu's napkin, every number in the second line is also a number in the third line. + +A3. Let $S$ be a finite set, and let $\mathcal{A}$ be the set of all functions from $S$ to $S$. Let $f$ be an element of $\mathcal{A}$, and let $T=f(S)$ be the image of $S$ under $f$. Suppose that $f \circ g \circ f \neq g \circ f \circ g$ for every $g$ in $\mathcal{A}$ with $g \neq f$. Show that $f(T)=T$. +(India) +A4. A sequence of real numbers $a_{1}, a_{2}, \ldots$ satisfies the relation + +$$ +a_{n}=-\max _{i+j=n}\left(a_{i}+a_{j}\right) \quad \text { for all } n>2017 +$$ + +Prove that this sequence is bounded, i.e., there is a constant $M$ such that $\left|a_{n}\right| \leqslant M$ for all positive integers $n$. + +A5. An integer $n \geqslant 3$ is given. We call an $n$-tuple of real numbers $\left(x_{1}, x_{2}, \ldots, x_{n}\right)$ Shiny if for each permutation $y_{1}, y_{2}, \ldots, y_{n}$ of these numbers we have + +$$ +\sum_{i=1}^{n-1} y_{i} y_{i+1}=y_{1} y_{2}+y_{2} y_{3}+y_{3} y_{4}+\cdots+y_{n-1} y_{n} \geqslant-1 +$$ + +Find the largest constant $K=K(n)$ such that + +$$ +\sum_{1 \leqslant i1 +\end{array} \quad \text { for } n=1,2, \ldots\right. +$$ + +Prove that at least one of the two numbers $a_{2017}$ and $a_{2018}$ must be greater than or equal to 2017 . +(Australia) +A8. Assume that a function $f: \mathbb{R} \rightarrow \mathbb{R}$ satisfies the following condition: +For every $x, y \in \mathbb{R}$ such that $(f(x)+y)(f(y)+x)>0$, we have $f(x)+y=f(y)+x$. +Prove that $f(x)+y \leqslant f(y)+x$ whenever $x>y$. +(Netherlands) + +## Combinatorics + +C1. A rectangle $\mathcal{R}$ with odd integer side lengths is divided into small rectangles with integer side lengths. Prove that there is at least one among the small rectangles whose distances from the four sides of $\mathcal{R}$ are either all odd or all even. +(Singapore) +C2. Let $n$ be a positive integer. Define a chameleon to be any sequence of $3 n$ letters, with exactly $n$ occurrences of each of the letters $a, b$, and $c$. Define a swap to be the transposition of two adjacent letters in a chameleon. Prove that for any chameleon $X$, there exists a chameleon $Y$ such that $X$ cannot be changed to $Y$ using fewer than $3 n^{2} / 2$ swaps. +(Australia) +C3. Sir Alex plays the following game on a row of 9 cells. Initially, all cells are empty. In each move, Sir Alex is allowed to perform exactly one of the following two operations: +(1) Choose any number of the form $2^{j}$, where $j$ is a non-negative integer, and put it into an empty cell. +(2) Choose two (not necessarily adjacent) cells with the same number in them; denote that number by $2^{j}$. Replace the number in one of the cells with $2^{j+1}$ and erase the number in the other cell. + +At the end of the game, one cell contains the number $2^{n}$, where $n$ is a given positive integer, while the other cells are empty. Determine the maximum number of moves that Sir Alex could have made, in terms of $n$. +(Thailand) +C4. Let $N \geqslant 2$ be an integer. $N(N+1)$ soccer players, no two of the same height, stand in a row in some order. Coach Ralph wants to remove $N(N-1)$ people from this row so that in the remaining row of $2 N$ players, no one stands between the two tallest ones, no one stands between the third and the fourth tallest ones, ..., and finally no one stands between the two shortest ones. Show that this is always possible. +(Russia) +C5. A hunter and an invisible rabbit play a game in the Euclidean plane. The hunter's starting point $H_{0}$ coincides with the rabbit's starting point $R_{0}$. In the $n^{\text {th }}$ round of the game $(n \geqslant 1)$, the following happens. +(1) First the invisible rabbit moves secretly and unobserved from its current point $R_{n-1}$ to some new point $R_{n}$ with $R_{n-1} R_{n}=1$. +(2) The hunter has a tracking device (e.g. dog) that returns an approximate position $R_{n}^{\prime}$ of the rabbit, so that $R_{n} R_{n}^{\prime} \leqslant 1$. +(3) The hunter then visibly moves from point $H_{n-1}$ to a new point $H_{n}$ with $H_{n-1} H_{n}=1$. + +Is there a strategy for the hunter that guarantees that after $10^{9}$ such rounds the distance between the hunter and the rabbit is below 100 ? + +C6. Let $n>1$ be an integer. An $n \times n \times n$ cube is composed of $n^{3}$ unit cubes. Each unit cube is painted with one color. For each $n \times n \times 1$ box consisting of $n^{2}$ unit cubes (of any of the three possible orientations), we consider the set of the colors present in that box (each color is listed only once). This way, we get $3 n$ sets of colors, split into three groups according to the orientation. It happens that for every set in any group, the same set appears in both of the other groups. Determine, in terms of $n$, the maximal possible number of colors that are present. +(Russia) +C7. For any finite sets $X$ and $Y$ of positive integers, denote by $f_{X}(k)$ the $k^{\text {th }}$ smallest positive integer not in $X$, and let + +$$ +X * Y=X \cup\left\{f_{X}(y): y \in Y\right\} +$$ + +Let $A$ be a set of $a>0$ positive integers, and let $B$ be a set of $b>0$ positive integers. Prove that if $A * B=B * A$, then + +$$ +\underbrace{A *(A * \cdots *(A *(A * A)) \ldots)}_{A \text { appears } b \text { times }}=\underbrace{B *(B * \cdots *(B *(B * B)) \ldots)}_{B \text { appears } a \text { times }} . +$$ + +C8. Let $n$ be a given positive integer. In the Cartesian plane, each lattice point with nonnegative coordinates initially contains a butterfly, and there are no other butterflies. The neighborhood of a lattice point $c$ consists of all lattice points within the axis-aligned $(2 n+1) \times(2 n+1)$ square centered at $c$, apart from $c$ itself. We call a butterfly lonely, crowded, or comfortable, depending on whether the number of butterflies in its neighborhood $N$ is respectively less than, greater than, or equal to half of the number of lattice points in $N$. + +Every minute, all lonely butterflies fly away simultaneously. This process goes on for as long as there are any lonely butterflies. Assuming that the process eventually stops, determine the number of comfortable butterflies at the final state. + +## Geometry + +G1. Let $A B C D E$ be a convex pentagon such that $A B=B C=C D, \angle E A B=\angle B C D$, and $\angle E D C=\angle C B A$. Prove that the perpendicular line from $E$ to $B C$ and the line segments $A C$ and $B D$ are concurrent. +(Italy) +G2. Let $R$ and $S$ be distinct points on circle $\Omega$, and let $t$ denote the tangent line to $\Omega$ at $R$. Point $R^{\prime}$ is the reflection of $R$ with respect to $S$. A point $I$ is chosen on the smaller arc $R S$ of $\Omega$ so that the circumcircle $\Gamma$ of triangle $I S R^{\prime}$ intersects $t$ at two different points. Denote by $A$ the common point of $\Gamma$ and $t$ that is closest to $R$. Line $A I$ meets $\Omega$ again at $J$. Show that $J R^{\prime}$ is tangent to $\Gamma$. +(Luxembourg) +G3. Let $O$ be the circumcenter of an acute scalene triangle $A B C$. Line $O A$ intersects the altitudes of $A B C$ through $B$ and $C$ at $P$ and $Q$, respectively. The altitudes meet at $H$. Prove that the circumcenter of triangle $P Q H$ lies on a median of triangle $A B C$. +(Ukraine) +G4. In triangle $A B C$, let $\omega$ be the excircle opposite $A$. Let $D, E$, and $F$ be the points where $\omega$ is tangent to lines $B C, C A$, and $A B$, respectively. The circle $A E F$ intersects line $B C$ at $P$ and $Q$. Let $M$ be the midpoint of $A D$. Prove that the circle $M P Q$ is tangent to $\omega$. +(Denmark) +G5. Let $A B C C_{1} B_{1} A_{1}$ be a convex hexagon such that $A B=B C$, and suppose that the line segments $A A_{1}, B B_{1}$, and $C C_{1}$ have the same perpendicular bisector. Let the diagonals $A C_{1}$ and $A_{1} C$ meet at $D$, and denote by $\omega$ the circle $A B C$. Let $\omega$ intersect the circle $A_{1} B C_{1}$ again at $E \neq B$. Prove that the lines $B B_{1}$ and $D E$ intersect on $\omega$. +(Ukraine) +G6. Let $n \geqslant 3$ be an integer. Two regular $n$-gons $\mathcal{A}$ and $\mathcal{B}$ are given in the plane. Prove that the vertices of $\mathcal{A}$ that lie inside $\mathcal{B}$ or on its boundary are consecutive. +(That is, prove that there exists a line separating those vertices of $\mathcal{A}$ that lie inside $\mathcal{B}$ or on its boundary from the other vertices of $\mathcal{A}$.) +(Czech Republic) +G7. A convex quadrilateral $A B C D$ has an inscribed circle with center $I$. Let $I_{a}, I_{b}, I_{c}$, and $I_{d}$ be the incenters of the triangles $D A B, A B C, B C D$, and $C D A$, respectively. Suppose that the common external tangents of the circles $A I_{b} I_{d}$ and $C I_{b} I_{d}$ meet at $X$, and the common external tangents of the circles $B I_{a} I_{c}$ and $D I_{a} I_{c}$ meet at $Y$. Prove that $\angle X I Y=90^{\circ}$. +(Kazakhstan) +G8. There are 2017 mutually external circles drawn on a blackboard, such that no two are tangent and no three share a common tangent. A tangent segment is a line segment that is a common tangent to two circles, starting at one tangent point and ending at the other one. Luciano is drawing tangent segments on the blackboard, one at a time, so that no tangent segment intersects any other circles or previously drawn tangent segments. Luciano keeps drawing tangent segments until no more can be drawn. Find all possible numbers of tangent segments when he stops drawing. +(Australia) + +## Number Theory + +N1. The sequence $a_{0}, a_{1}, a_{2}, \ldots$ of positive integers satisfies + +$$ +a_{n+1}=\left\{\begin{array}{ll} +\sqrt{a_{n}}, & \text { if } \sqrt{a_{n}} \text { is an integer } \\ +a_{n}+3, & \text { otherwise } +\end{array} \quad \text { for every } n \geqslant 0\right. +$$ + +Determine all values of $a_{0}>1$ for which there is at least one number $a$ such that $a_{n}=a$ for infinitely many values of $n$. +(South Africa) +N2. Let $p \geqslant 2$ be a prime number. Eduardo and Fernando play the following game making moves alternately: in each move, the current player chooses an index $i$ in the set $\{0,1, \ldots, p-1\}$ that was not chosen before by either of the two players and then chooses an element $a_{i}$ of the set $\{0,1,2,3,4,5,6,7,8,9\}$. Eduardo has the first move. The game ends after all the indices $i \in\{0,1, \ldots, p-1\}$ have been chosen. Then the following number is computed: + +$$ +M=a_{0}+10 \cdot a_{1}+\cdots+10^{p-1} \cdot a_{p-1}=\sum_{j=0}^{p-1} a_{j} \cdot 10^{j} +$$ + +The goal of Eduardo is to make the number $M$ divisible by $p$, and the goal of Fernando is to prevent this. + +Prove that Eduardo has a winning strategy. +(Morocco) +N3. Determine all integers $n \geqslant 2$ with the following property: for any integers $a_{1}, a_{2}, \ldots, a_{n}$ whose sum is not divisible by $n$, there exists an index $1 \leqslant i \leqslant n$ such that none of the numbers + +$$ +a_{i}, a_{i}+a_{i+1}, \ldots, a_{i}+a_{i+1}+\cdots+a_{i+n-1} +$$ + +is divisible by $n$. (We let $a_{i}=a_{i-n}$ when $i>n$.) +(Thailand) +N4. Call a rational number short if it has finitely many digits in its decimal expansion. For a positive integer $m$, we say that a positive integer $t$ is $m$-tastic if there exists a number $c \in\{1,2,3, \ldots, 2017\}$ such that $\frac{10^{t}-1}{c \cdot m}$ is short, and such that $\frac{10^{k}-1}{c \cdot m}$ is not short for any $1 \leqslant k q$ for which the number + +$$ +\frac{(p+q)^{p+q}(p-q)^{p-q}-1}{(p+q)^{p-q}(p-q)^{p+q}-1} +$$ + +is an integer. + +N6. Find the smallest positive integer $n$, or show that no such $n$ exists, with the following property: there are infinitely many distinct $n$-tuples of positive rational numbers ( $a_{1}, a_{2}, \ldots, a_{n}$ ) such that both + +$$ +a_{1}+a_{2}+\cdots+a_{n} \quad \text { and } \quad \frac{1}{a_{1}}+\frac{1}{a_{2}}+\cdots+\frac{1}{a_{n}} +$$ + +are integers. +(Singapore) +N7. Say that an ordered pair $(x, y)$ of integers is an irreducible lattice point if $x$ and $y$ are relatively prime. For any finite set $S$ of irreducible lattice points, show that there is a homogenous polynomial in two variables, $f(x, y)$, with integer coefficients, of degree at least 1 , such that $f(x, y)=1$ for each $(x, y)$ in the set $S$. + +Note: A homogenous polynomial of degree $n$ is any nonzero polynomial of the form + +$$ +f(x, y)=a_{0} x^{n}+a_{1} x^{n-1} y+a_{2} x^{n-2} y^{2}+\cdots+a_{n-1} x y^{n-1}+a_{n} y^{n} . +$$ + +N8 Let $p$ be an odd prime number and $\mathbb{Z}_{>0}$ be the set of positive integers. Suppose that a function $f: \mathbb{Z}_{>0} \times \mathbb{Z}_{>0} \rightarrow\{0,1\}$ satisfies the following properties: + +- $f(1,1)=0$; +- $f(a, b)+f(b, a)=1$ for any pair of relatively prime positive integers $(a, b)$ not both equal to 1 ; +- $f(a+b, b)=f(a, b)$ for any pair of relatively prime positive integers $(a, b)$. + +Prove that + +$$ +\sum_{n=1}^{p-1} f\left(n^{2}, p\right) \geqslant \sqrt{2 p}-2 +$$ + +## Solutions + +## Algebra + +A1. Let $a_{1}, a_{2}, \ldots, a_{n}, k$, and $M$ be positive integers such that + +$$ +\frac{1}{a_{1}}+\frac{1}{a_{2}}+\cdots+\frac{1}{a_{n}}=k \quad \text { and } \quad a_{1} a_{2} \ldots a_{n}=M +$$ + +If $M>1$, prove that the polynomial + +$$ +P(x)=M(x+1)^{k}-\left(x+a_{1}\right)\left(x+a_{2}\right) \cdots\left(x+a_{n}\right) +$$ + +has no positive roots. +(Trinidad and Tobago) +Solution 1. We first prove that, for $x>0$, + +$$ +a_{i}(x+1)^{1 / a_{i}} \leqslant x+a_{i}, +$$ + +with equality if and only if $a_{i}=1$. It is clear that equality occurs if $a_{i}=1$. +If $a_{i}>1$, the AM-GM inequality applied to a single copy of $x+1$ and $a_{i}-1$ copies of 1 yields + +$$ +\frac{(x+1)+\overbrace{1+1+\cdots+1}^{a_{i}-1 \text { ones }}}{a_{i}} \geqslant \sqrt[a_{i}]{(x+1) \cdot 1^{a_{i}-1}} \Longrightarrow a_{i}(x+1)^{1 / a_{i}} \leqslant x+a_{i} +$$ + +Since $x+1>1$, the inequality is strict for $a_{i}>1$. +Multiplying the inequalities (1) for $i=1,2, \ldots, n$ yields + +$$ +\prod_{i=1}^{n} a_{i}(x+1)^{1 / a_{i}} \leqslant \prod_{i=1}^{n}\left(x+a_{i}\right) \Longleftrightarrow M(x+1)^{\sum_{i=1}^{n} 1 / a_{i}}-\prod_{i=1}^{n}\left(x+a_{i}\right) \leqslant 0 \Longleftrightarrow P(x) \leqslant 0 +$$ + +with equality iff $a_{i}=1$ for all $i \in\{1,2, \ldots, n\}$. But this implies $M=1$, which is not possible. Hence $P(x)<0$ for all $x \in \mathbb{R}^{+}$, and $P$ has no positive roots. + +Comment 1. Inequality (1) can be obtained in several ways. For instance, we may also use the binomial theorem: since $a_{i} \geqslant 1$, + +$$ +\left(1+\frac{x}{a_{i}}\right)^{a_{i}}=\sum_{j=0}^{a_{i}}\binom{a_{i}}{j}\left(\frac{x}{a_{i}}\right)^{j} \geqslant\binom{ a_{i}}{0}+\binom{a_{i}}{1} \cdot \frac{x}{a_{i}}=1+x +$$ + +Both proofs of (1) mimic proofs to Bernoulli's inequality for a positive integer exponent $a_{i}$; we can use this inequality directly: + +$$ +\left(1+\frac{x}{a_{i}}\right)^{a_{i}} \geqslant 1+a_{i} \cdot \frac{x}{a_{i}}=1+x +$$ + +and so + +$$ +x+a_{i}=a_{i}\left(1+\frac{x}{a_{i}}\right) \geqslant a_{i}(1+x)^{1 / a_{i}} +$$ + +or its (reversed) formulation, with exponent $1 / a_{i} \leqslant 1$ : + +$$ +(1+x)^{1 / a_{i}} \leqslant 1+\frac{1}{a_{i}} \cdot x=\frac{x+a_{i}}{a_{i}} \Longrightarrow a_{i}(1+x)^{1 / a_{i}} \leqslant x+a_{i} . +$$ + +Solution 2. We will prove that, in fact, all coefficients of the polynomial $P(x)$ are non-positive, and at least one of them is negative, which implies that $P(x)<0$ for $x>0$. + +Indeed, since $a_{j} \geqslant 1$ for all $j$ and $a_{j}>1$ for some $j$ (since $a_{1} a_{2} \ldots a_{n}=M>1$ ), we have $k=\frac{1}{a_{1}}+\frac{1}{a_{2}}+\cdots+\frac{1}{a_{n}} 1$, if (2) is true for a given $r -1$ and $x \neq 0$. + +A2. Let $q$ be a real number. Gugu has a napkin with ten distinct real numbers written on it, and he writes the following three lines of real numbers on the blackboard: + +- In the first line, Gugu writes down every number of the form $a-b$, where $a$ and $b$ are two (not necessarily distinct) numbers on his napkin. +- In the second line, Gugu writes down every number of the form qab, where $a$ and $b$ are two (not necessarily distinct) numbers from the first line. +- In the third line, Gugu writes down every number of the form $a^{2}+b^{2}-c^{2}-d^{2}$, where $a, b, c, d$ are four (not necessarily distinct) numbers from the first line. + +Determine all values of $q$ such that, regardless of the numbers on Gugu's napkin, every number in the second line is also a number in the third line. +(Austria) +Answer: -2, 0,2 . +Solution 1. Call a number $q$ good if every number in the second line appears in the third line unconditionally. We first show that the numbers 0 and $\pm 2$ are good. The third line necessarily contains 0 , so 0 is good. For any two numbers $a, b$ in the first line, write $a=x-y$ and $b=u-v$, where $x, y, u, v$ are (not necessarily distinct) numbers on the napkin. We may now write + +$$ +2 a b=2(x-y)(u-v)=(x-v)^{2}+(y-u)^{2}-(x-u)^{2}-(y-v)^{2} +$$ + +which shows that 2 is good. By negating both sides of the above equation, we also see that -2 is good. + +We now show that $-2,0$, and 2 are the only good numbers. Assume for sake of contradiction that $q$ is a good number, where $q \notin\{-2,0,2\}$. We now consider some particular choices of numbers on Gugu's napkin to arrive at a contradiction. + +Assume that the napkin contains the integers $1,2, \ldots, 10$. Then, the first line contains the integers $-9,-8, \ldots, 9$. The second line then contains $q$ and $81 q$, so the third line must also contain both of them. But the third line only contains integers, so $q$ must be an integer. Furthermore, the third line contains no number greater than $162=9^{2}+9^{2}-0^{2}-0^{2}$ or less than -162 , so we must have $-162 \leqslant 81 q \leqslant 162$. This shows that the only possibilities for $q$ are $\pm 1$. + +Now assume that $q= \pm 1$. Let the napkin contain $0,1,4,8,12,16,20,24,28,32$. The first line contains $\pm 1$ and $\pm 4$, so the second line contains $\pm 4$. However, for every number $a$ in the first line, $a \not \equiv 2(\bmod 4)$, so we may conclude that $a^{2} \equiv 0,1(\bmod 8)$. Consequently, every number in the third line must be congruent to $-2,-1,0,1,2(\bmod 8)$; in particular, $\pm 4$ cannot be in the third line, which is a contradiction. + +Solution 2. Let $q$ be a good number, as defined in the first solution, and define the polynomial $P\left(x_{1}, \ldots, x_{10}\right)$ as + +$$ +\prod_{i 2017 +$$ + +Prove that this sequence is bounded, i.e., there is a constant $M$ such that $\left|a_{n}\right| \leqslant M$ for all positive integers $n$. +(Russia) +Solution 1. Set $D=2017$. Denote + +$$ +M_{n}=\max _{k D$; our first aim is to bound $a_{n}$ in terms of $m_{n}$ and $M_{n}$. +(i) There exist indices $p$ and $q$ such that $a_{n}=-\left(a_{p}+a_{q}\right)$ and $p+q=n$. Since $a_{p}, a_{q} \leqslant M_{n}$, we have $a_{n} \geqslant-2 M_{n}$. +(ii) On the other hand, choose an index $k D$ is lucky if $m_{n} \leqslant 2 M_{n}$. Two cases are possible. +Case 1. Assume that there exists a lucky index $n$. In this case, (1) yields $m_{n+1} \leqslant 2 M_{n}$ and $M_{n} \leqslant M_{n+1} \leqslant M_{n}$. Therefore, $M_{n+1}=M_{n}$ and $m_{n+1} \leqslant 2 M_{n}=2 M_{n+1}$. So, the index $n+1$ is also lucky, and $M_{n+1}=M_{n}$. Applying the same arguments repeatedly, we obtain that all indices $k>n$ are lucky (i.e., $m_{k} \leqslant 2 M_{k}$ for all these indices), and $M_{k}=M_{n}$ for all such indices. Thus, all of the $m_{k}$ and $M_{k}$ are bounded by $2 M_{n}$. +Case 2. Assume now that there is no lucky index, i.e., $2 M_{n} D$. Then (1) shows that for all $n>D$ we have $m_{n} \leqslant m_{n+1} \leqslant m_{n}$, so $m_{n}=m_{D+1}$ for all $n>D$. Since $M_{n} a_{i} \text { for each } i -2 \ell, \quad \text { and } \quad n>D +$$ + +We first show that there must be some good index $n$. By assumption, we may take an index $N$ such that $a_{N}>\max \{L,-2 \ell\}$. Choose $n$ minimally such that $a_{n}=\max \left\{a_{1}, a_{2}, \ldots, a_{N}\right\}$. Now, the first condition in (2) is satisfied because of the minimality of $n$, and the second and third conditions are satisfied because $a_{n} \geqslant a_{N}>L,-2 \ell$, and $L \geqslant a_{i}$ for every $i$ such that $1 \leqslant i \leqslant D$. + +Let $n$ be a good index. We derive a contradiction. We have that + +$$ +a_{n}+a_{u}+a_{v} \leqslant 0 +$$ + +whenever $u+v=n$. +We define the index $u$ to maximize $a_{u}$ over $1 \leqslant u \leqslant n-1$, and let $v=n-u$. Then, we note that $a_{u} \geqslant a_{v}$ by the maximality of $a_{u}$. + +Assume first that $v \leqslant D$. Then, we have that + +$$ +a_{N}+2 \ell \leqslant 0, +$$ + +because $a_{u} \geqslant a_{v} \geqslant \ell$. But this contradicts our assumption that $a_{n}>-2 \ell$ in the second criteria of (2). + +Now assume that $v>D$. Then, there exist some indices $w_{1}, w_{2}$ summing up to $v$ such that + +$$ +a_{v}+a_{w_{1}}+a_{w_{2}}=0 +$$ + +But combining this with (3), we have + +$$ +a_{n}+a_{u} \leqslant a_{w_{1}}+a_{w_{2}} +$$ + +Because $a_{n}>a_{u}$, we have that $\max \left\{a_{w_{1}}, a_{w_{2}}\right\}>a_{u}$. But since each of the $w_{i}$ is less than $v$, this contradicts the maximality of $a_{u}$. + +Comment 1. We present two harder versions of this problem below. +Version 1. Let $a_{1}, a_{2}, \ldots$ be a sequence of numbers that satisfies the relation + +$$ +a_{n}=-\max _{i+j+k=n}\left(a_{i}+a_{j}+a_{k}\right) \quad \text { for all } n>2017 +$$ + +Then, this sequence is bounded. +Proof. Set $D=2017$. Denote + +$$ +M_{n}=\max _{k 2 D$; our first aim is to bound $a_{n}$ in terms of $m_{i}$ and $M_{i}$. Set $k=\lfloor n / 2\rfloor$. +(i) Choose indices $p, q$, and $r$ such that $a_{n}=-\left(a_{p}+a_{q}+a_{r}\right)$ and $p+q+r=n$. Without loss of generality, $p \geqslant q \geqslant r$. + +Assume that $p \geqslant k+1(>D)$; then $p>q+r$. Hence + +$$ +-a_{p}=\max _{i_{1}+i_{2}+i_{3}=p}\left(a_{i_{1}}+a_{i_{2}}+a_{i_{3}}\right) \geqslant a_{q}+a_{r}+a_{p-q-r} +$$ + +and therefore $a_{n}=-\left(a_{p}+a_{q}+a_{r}\right) \geqslant\left(a_{q}+a_{r}+a_{p-q-r}\right)-a_{q}-a_{r}=a_{p-q-r} \geqslant-m_{n}$. +Otherwise, we have $k \geqslant p \geqslant q \geqslant r$. Since $n<3 k$, we have $r 2 D$ is lucky if $m_{n} \leqslant 2 M_{\lfloor n / 2\rfloor+1}+M_{\lfloor n / 2]}$. Two cases are possible. +Case 1. Assume that there exists a lucky index $n$; set $k=\lfloor n / 2\rfloor$. In this case, (4) yields $m_{n+1} \leqslant$ $2 M_{k+1}+M_{k}$ and $M_{n} \leqslant M_{n+1} \leqslant M_{n}$ (the last relation holds, since $m_{n}-M_{k+1}-M_{k} \leqslant\left(2 M_{k+1}+\right.$ $\left.M_{k}\right)-M_{k+1}-M_{k}=M_{k+1} \leqslant M_{n}$ ). Therefore, $M_{n+1}=M_{n}$ and $m_{n+1} \leqslant 2 M_{k+1}+M_{k}$; the last relation shows that the index $n+1$ is also lucky. + +Thus, all indices $N>n$ are lucky, and $M_{N}=M_{n} \geqslant m_{N} / 3$, whence all the $m_{N}$ and $M_{N}$ are bounded by $3 M_{n}$. +Case 2. Conversely, assume that there is no lucky index, i.e., $2 M_{\lfloor n / 2\rfloor+1}+M_{\lfloor n / 2\rfloor} 2 D$. Then (4) shows that for all $n>2 D$ we have $m_{n} \leqslant m_{n+1} \leqslant m_{n}$, i.e., $m_{N}=m_{2 D+1}$ for all $N>2 D$. Since $M_{N} 2017 +$$ + +Then, this sequence is bounded. +Proof. As in the solutions above, let $D=2017$. If the sequence is bounded above, say, by $Q$, then we have that $a_{n} \geqslant \min \left\{a_{1}, \ldots, a_{D},-k Q\right\}$ for all $n$, so the sequence is bounded. Assume for sake of contradiction that the sequence is not bounded above. Let $\ell=\min \left\{a_{1}, \ldots, a_{D}\right\}$, and $L=\max \left\{a_{1}, \ldots, a_{D}\right\}$. Call an index $n$ good if the following criteria hold: + +$$ +a_{n}>a_{i} \text { for each } i