# Shortlisted Problems (with solutions) Confidential until 1:30pm on 12 July 2022 (Norwegian time) 62 ${ }^{\text {nd }}$ International Mathematical Olympiad Saint-Petersburg — Russia, 16th-24th July 2021 ## 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 Organising Committee and the Problem Selection Committee of IMO 2021 thank the following 51 countries for contributing 175 problem proposals: Albania, Algeria, Armenia, Australia, Austria, Azerbaijan, Belgium, Bangladesh, Canada, China, Colombia, Croatia, Czech Republic, Denmark, Estonia, France, Germany, Greece, Hong Kong, Iceland, India, Iran, Ireland, Israel, Japan, Kazakhstan, Kosovo, Luxembourg, Malaysia, Mexico, Morocco, Myanmar, Netherlands, New Zealand, North Macedonia, Poland, Romania, Singapore, Slovakia, Slovenia, South Africa, South Korea, Spain, Switzerland, Taiwan, Thailand, U.S.A., Ukraine, United Kingdom, Uzbekistan, Vietnam ## Problem Selection Committee ![](https://cdn.mathpix.com/cropped/2024_11_18_7107063274cfa469597ag-03.jpg?height=898&width=1583&top_left_y=1661&top_left_x=242) Géza Kós, Gerhard Woeginger, Alexey Ustinov, Dmitry Krachun, Ivan Mitrofanov, Sergey Berlov, Fedor Petrov, Ivan Frolov, Paul Vaderlind, Alexander Golovanov, Ilya I. Bogdanov (chair) ## Problems ## Algebra A1. Let $n$ be an integer, and let $A$ be a subset of $\left\{0,1,2,3, \ldots, 5^{n}\right\}$ consisting of $4 n+2$ numbers. Prove that there exist $a, b, c \in A$ such that $a3 b$. A2. For every integer $n \geqslant 1$ consider the $n \times n$ table with entry $\left\lfloor\frac{i j}{n+1}\right\rfloor$ at the intersection of row $i$ and column $j$, for every $i=1, \ldots, n$ and $j=1, \ldots, n$. Determine all integers $n \geqslant 1$ for which the sum of the $n^{2}$ entries in the table is equal to $\frac{1}{4} n^{2}(n-1)$. A3. Given a positive integer $n$, find the smallest value of $\left\lfloor\frac{a_{1}}{1}\right\rfloor+\left\lfloor\frac{a_{2}}{2}\right\rfloor+\cdots+\left\lfloor\frac{a_{n}}{n}\right\rfloor$ over all permutations $\left(a_{1}, a_{2}, \ldots, a_{n}\right)$ of $(1,2, \ldots, n)$. A4. Show that for all real numbers $x_{1}, \ldots, x_{n}$ the following inequality holds: $$ \sum_{i=1}^{n} \sum_{j=1}^{n} \sqrt{\left|x_{i}-x_{j}\right|} \leqslant \sum_{i=1}^{n} \sum_{j=1}^{n} \sqrt{\left|x_{i}+x_{j}\right|} $$ A5. Let $n \geqslant 2$ be an integer, and let $a_{1}, a_{2}, \ldots, a_{n}$ be positive real numbers such that $a_{1}+a_{2}+\cdots+a_{n}=1$. Prove that $$ \sum_{k=1}^{n} \frac{a_{k}}{1-a_{k}}\left(a_{1}+a_{2}+\cdots+a_{k-1}\right)^{2}<\frac{1}{3} $$ A6. Let $A$ be a finite set of (not necessarily positive) integers, and let $m \geqslant 2$ be an integer. Assume that there exist non-empty subsets $B_{1}, B_{2}, B_{3}, \ldots, B_{m}$ of $A$ whose elements add up to the sums $m^{1}, m^{2}, m^{3}, \ldots, m^{m}$, respectively. Prove that $A$ contains at least $m / 2$ elements. A7. Let $n \geqslant 1$ be an integer, and let $x_{0}, x_{1}, \ldots, x_{n+1}$ be $n+2$ non-negative real numbers that satisfy $x_{i} x_{i+1}-x_{i-1}^{2} \geqslant 1$ for all $i=1,2, \ldots, n$. Show that $$ x_{0}+x_{1}+\cdots+x_{n}+x_{n+1}>\left(\frac{2 n}{3}\right)^{3 / 2} $$ A8. Determine all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ that satisfy $$ (f(a)-f(b))(f(b)-f(c))(f(c)-f(a))=f\left(a b^{2}+b c^{2}+c a^{2}\right)-f\left(a^{2} b+b^{2} c+c^{2} a\right) $$ for all real numbers $a, b, c$. ## Combinatorics C1. Let $S$ be an infinite set of positive integers, such that there exist four pairwise distinct $a, b, c, d \in S$ with $\operatorname{gcd}(a, b) \neq \operatorname{gcd}(c, d)$. Prove that there exist three pairwise distinct $x, y, z \in S$ such that $\operatorname{gcd}(x, y)=\operatorname{gcd}(y, z) \neq \operatorname{gcd}(z, x)$. C2. Let $n \geqslant 3$ be an integer. An integer $m \geqslant n+1$ is called $n$-colourful if, given infinitely many marbles in each of $n$ colours $C_{1}, C_{2}, \ldots, C_{n}$, it is possible to place $m$ of them around a circle so that in any group of $n+1$ consecutive marbles there is at least one marble of colour $C_{i}$ for each $i=1, \ldots, n$. Prove that there are only finitely many positive integers which are not $n$-colourful. Find the largest among them. C3. A thimblerigger has 2021 thimbles numbered from 1 through 2021. The thimbles are arranged in a circle in arbitrary order. The thimblerigger performs a sequence of 2021 moves; in the $k^{\text {th }}$ move, he swaps the positions of the two thimbles adjacent to thimble $k$. Prove that there exists a value of $k$ such that, in the $k^{\text {th }}$ move, the thimblerigger swaps some thimbles $a$ and $b$ such that $ak \geqslant 1$. There are $2 n+1$ students standing in a circle. Each student $S$ has $2 k$ neighbours - namely, the $k$ students closest to $S$ on the right, and the $k$ students closest to $S$ on the left. Suppose that $n+1$ of the students are girls, and the other $n$ are boys. Prove that there is a girl with at least $k$ girls among her neighbours. C6. A hunter and an invisible rabbit play a game on an infinite square grid. First the hunter fixes a colouring of the cells with finitely many colours. The rabbit then secretly chooses a cell to start in. Every minute, the rabbit reports the colour of its current cell to the hunter, and then secretly moves to an adjacent cell that it has not visited before (two cells are adjacent if they share a side). The hunter wins if after some finite time either - the rabbit cannot move; or - the hunter can determine the cell in which the rabbit started. Decide whether there exists a winning strategy for the hunter. C7. Consider a checkered $3 m \times 3 m$ square, where $m$ is an integer greater than 1 . A frog sits on the lower left corner cell $S$ and wants to get to the upper right corner cell $F$. The frog can hop from any cell to either the next cell to the right or the next cell upwards. Some cells can be sticky, and the frog gets trapped once it hops on such a cell. A set $X$ of cells is called blocking if the frog cannot reach $F$ from $S$ when all the cells of $X$ are sticky. A blocking set is minimal if it does not contain a smaller blocking set. (a) Prove that there exists a minimal blocking set containing at least $3 m^{2}-3 m$ cells. (b) Prove that every minimal blocking set contains at most $3 m^{2}$ cells. Note. An example of a minimal blocking set for $m=2$ is shown below. Cells of the set $X$ are marked by letters $x$. ![](https://cdn.mathpix.com/cropped/2024_11_18_7107063274cfa469597ag-07.jpg?height=324&width=335&top_left_y=843&top_left_x=866) C8. Determine the largest $N$ for which there exists a table $T$ of integers with $N$ rows and 100 columns that has the following properties: (i) Every row contains the numbers $1,2, \ldots, 100$ in some order. (ii) For any two distinct rows $r$ and $s$, there is a column $c$ such that $|T(r, c)-T(s, c)| \geqslant 2$. Here $T(r, c)$ means the number at the intersection of the row $r$ and the column $c$. ## Geometry G1. Let $A B C D$ be a parallelogram such that $A C=B C$. A point $P$ is chosen on the extension of the segment $A B$ beyond $B$. The circumcircle of the triangle $A C D$ meets the segment $P D$ again at $Q$, and the circumcircle of the triangle $A P Q$ meets the segment $P C$ again at $R$. Prove that the lines $C D, A Q$, and $B R$ are concurrent. ## G2. Let $A B C D$ be a convex quadrilateral circumscribed around a circle with centre $I$. Let $\omega$ be the circumcircle of the triangle $A C I$. The extensions of $B A$ and $B C$ beyond $A$ and $C$ meet $\omega$ at $X$ and $Z$, respectively. The extensions of $A D$ and $C D$ beyond $D$ meet $\omega$ at $Y$ and $T$, respectively. Prove that the perimeters of the (possibly self-intersecting) quadrilaterals $A D T X$ and $C D Y Z$ are equal. ## G3. Version 1. Let $n$ be a fixed positive integer, and let S be the set of points $(x, y)$ on the Cartesian plane such that both coordinates $x$ and $y$ are nonnegative integers smaller than $2 n$ (thus $|S|=4 n^{2}$ ). Assume that $\mathcal{F}$ is a set consisting of $n^{2}$ quadrilaterals such that all their vertices lie in $S$, and each point in $S$ is a vertex of exactly one of the quadrilaterals in $\mathcal{F}$. Determine the largest possible sum of areas of all $n^{2}$ quadrilaterals in $\mathcal{F}$. Version 2. Let $n$ be a fixed positive integer, and let S be the set of points $(x, y)$ on the Cartesian plane such that both coordinates $x$ and $y$ are nonnegative integers smaller than $2 n$ (thus $|\mathrm{S}|=4 n^{2}$ ). Assume that $\mathcal{F}$ is a set of polygons such that all vertices of polygons in $\mathcal{F}$ lie in S , and each point in S is a vertex of exactly one of the polygons in $\mathcal{F}$. Determine the largest possible sum of areas of all polygons in $\mathcal{F}$. G4. Let $A B C D$ be a quadrilateral inscribed in a circle $\Omega$. Let the tangent to $\Omega$ at $D$ intersect the rays $B A$ and $B C$ at points $E$ and $F$, respectively. A point $T$ is chosen inside the triangle $A B C$ so that $T E \| C D$ and $T F \| A D$. Let $K \neq D$ be a point on the segment $D F$ such that $T D=T K$. Prove that the lines $A C, D T$ and $B K$ intersect at one point. G5. Let $A B C D$ be a cyclic quadrilateral whose sides have pairwise different lengths. Let $O$ be the circumcentre of $A B C D$. The internal angle bisectors of $\angle A B C$ and $\angle A D C$ meet $A C$ at $B_{1}$ and $D_{1}$, respectively. Let $O_{B}$ be the centre of the circle which passes through $B$ and is tangent to $A C$ at $D_{1}$. Similarly, let $O_{D}$ be the centre of the circle which passes through $D$ and is tangent to $A C$ at $B_{1}$. Assume that $B D_{1} \| D B_{1}$. Prove that $O$ lies on the line $O_{B} O_{D}$. G6. Determine all integers $n \geqslant 3$ satisfying the following property: every convex $n$-gon whose sides all have length 1 contains an equilateral triangle of side length 1. (Every polygon is assumed to contain its boundary.) G7. A point $D$ is chosen inside an acute-angled triangle $A B C$ with $A B>A C$ so that $\angle B A D=\angle D A C$. A point $E$ is constructed on the segment $A C$ so that $\angle A D E=\angle D C B$. Similarly, a point $F$ is constructed on the segment $A B$ so that $\angle A D F=\angle D B C$. A point $X$ is chosen on the line $A C$ so that $C X=B X$. Let $O_{1}$ and $O_{2}$ be the circumcentres of the triangles $A D C$ and $D X E$. Prove that the lines $B C, E F$, and $O_{1} O_{2}$ are concurrent. G8. Let $\omega$ be the circumcircle of a triangle $A B C$, and let $\Omega_{A}$ be its excircle which is tangent to the segment $B C$. Let $X$ and $Y$ be the intersection points of $\omega$ and $\Omega_{A}$. Let $P$ and $Q$ be the projections of $A$ onto the tangent lines to $\Omega_{A}$ at $X$ and $Y$, respectively. The tangent line at $P$ to the circumcircle of the triangle $A P X$ intersects the tangent line at $Q$ to the circumcircle of the triangle $A Q Y$ at a point $R$. Prove that $A R \perp B C$. ## Number Theory N1. Determine all integers $n \geqslant 1$ for which there exists a pair of positive integers $(a, b)$ such that no cube of a prime divides $a^{2}+b+3$ and $$ \frac{a b+3 b+8}{a^{2}+b+3}=n $$ N2. Let $n \geqslant 100$ be an integer. The numbers $n, n+1, \ldots, 2 n$ are written on $n+1$ cards, one number per card. The cards are shuffled and divided into two piles. Prove that one of the piles contains two cards such that the sum of their numbers is a perfect square. N3. Find all positive integers $n$ with the following property: the $k$ positive divisors of $n$ have a permutation $\left(d_{1}, d_{2}, \ldots, d_{k}\right)$ such that for every $i=1,2, \ldots, k$, the number $d_{1}+\cdots+d_{i}$ is a perfect square. N4. Alice is given a rational number $r>1$ and a line with two points $B \neq R$, where point $R$ contains a red bead and point $B$ contains a blue bead. Alice plays a solitaire game by performing a sequence of moves. In every move, she chooses a (not necessarily positive) integer $k$, and a bead to move. If that bead is placed at point $X$, and the other bead is placed at $Y$, then Alice moves the chosen bead to point $X^{\prime}$ with $\overrightarrow{Y X^{\prime}}=r^{k} \overrightarrow{Y X}$. Alice's goal is to move the red bead to the point $B$. Find all rational numbers $r>1$ such that Alice can reach her goal in at most 2021 moves. N5. Prove that there are only finitely many quadruples $(a, b, c, n)$ of positive integers such that $$ n!=a^{n-1}+b^{n-1}+c^{n-1} . $$ N6. Determine all integers $n \geqslant 2$ with the following property: every $n$ pairwise distinct integers whose sum is not divisible by $n$ can be arranged in some order $a_{1}, a_{2}, \ldots, a_{n}$ so that $n$ divides $1 \cdot a_{1}+2 \cdot a_{2}+\cdots+n \cdot a_{n}$. N7. Let $a_{1}, a_{2}, a_{3}, \ldots$ be an infinite sequence of positive integers such that $a_{n+2 m}$ divides $a_{n}+a_{n+m}$ for all positive integers $n$ and $m$. Prove that this sequence is eventually periodic, i.e. there exist positive integers $N$ and $d$ such that $a_{n}=a_{n+d}$ for all $n>N$. N8. For a polynomial $P(x)$ with integer coefficients let $P^{1}(x)=P(x)$ and $P^{k+1}(x)=$ $P\left(P^{k}(x)\right)$ for $k \geqslant 1$. Find all positive integers $n$ for which there exists a polynomial $P(x)$ with integer coefficients such that for every integer $m \geqslant 1$, the numbers $P^{m}(1), \ldots, P^{m}(n)$ leave exactly $\left\lceil n / 2^{m}\right\rceil$ distinct remainders when divided by $n$. ## Solutions ## Algebra A1. Let $n$ be an integer, and let $A$ be a subset of $\left\{0,1,2,3, \ldots, 5^{n}\right\}$ consisting of $4 n+2$ numbers. Prove that there exist $a, b, c \in A$ such that $a3 b$. Solution 1. (By contradiction) Suppose that there exist $4 n+2$ non-negative integers $x_{0}<$ $x_{1}<\cdots5^{n} \cdot 1 $$ Solution 2. Denote the maximum element of $A$ by $c$. For $k=0, \ldots, 4 n-1$ let $$ A_{k}=\left\{x \in A:\left(1-(2 / 3)^{k}\right) c \leqslant x<\left(1-(2 / 3)^{k+1}\right) c\right\} $$ Note that $$ \left(1-(2 / 3)^{4 n}\right) c=c-(16 / 81)^{n} c>c-(1 / 5)^{n} c \geqslant c-1 $$ which shows that the sets $A_{0}, A_{1}, \ldots, A_{4 n-1}$ form a partition of $A \backslash\{c\}$. Since $A \backslash\{c\}$ has $4 n+1$ elements, by the pigeonhole principle some set $A_{k}$ does contain at least two elements of $A \backslash\{c\}$. Denote these two elements $a$ and $b$ and assume $a3 b $$ as desired. A2. For every integer $n \geqslant 1$ consider the $n \times n$ table with entry $\left\lfloor\frac{i j}{n+1}\right\rfloor$ at the intersection of row $i$ and column $j$, for every $i=1, \ldots, n$ and $j=1, \ldots, n$. Determine all integers $n \geqslant 1$ for which the sum of the $n^{2}$ entries in the table is equal to $\frac{1}{4} n^{2}(n-1)$. Answer: All integers $n$ for which $n+1$ is a prime. Solution 1. First, observe that every pair $x, y$ of real numbers for which the sum $x+y$ is integer satisfies $$ \lfloor x\rfloor+\lfloor y\rfloor \geqslant x+y-1 $$ The inequality is strict if $x$ and $y$ are integers, and it holds with equality otherwise. We estimate the sum $S$ as follows. $$ \begin{aligned} 2 S=\sum_{1 \leqslant i, j \leqslant n}\left(\left\lfloor\frac{i j}{n+1}\right\rfloor+\left\lfloor\frac{i j}{n+1}\right\rfloor\right)= & \sum_{1 \leqslant i, j \leqslant n}\left(\left\lfloor\frac{i j}{n+1}\right\rfloor+\left\lfloor\frac{(n+1-i) j}{n+1}\right\rfloor\right) \\ & \geqslant \sum_{1 \leqslant i, j \leqslant n}(j-1)=\frac{(n-1) n^{2}}{2} . \end{aligned} $$ The inequality in the last line follows from (1) by setting $x=i j /(n+1)$ and $y=(n+1-$ i) $j /(n+1)$, so that $x+y=j$ is integral. Now $S=\frac{1}{4} n^{2}(n-1)$ if and only if the inequality in the last line holds with equality, which means that none of the values $i j /(n+1)$ with $1 \leqslant i, j \leqslant n$ may be integral. Hence, if $n+1$ is composite with factorisation $n+1=a b$ for $2 \leqslant a, b \leqslant n$, one gets a strict inequality for $i=a$ and $j=b$. If $n+1$ is a prime, then $i j /(n+1)$ is never integral and $S=\frac{1}{4} n^{2}(n-1)$. Solution 2. To simplify the calculation with indices, extend the table by adding a phantom column of index 0 with zero entries (which will not change the sum of the table). Fix a row $i$ with $1 \leqslant i \leqslant n$, and let $d:=\operatorname{gcd}(i, n+1)$ and $k:=(n+1) / d$. For columns $j=0, \ldots, n$, define the remainder $r_{j}:=i j \bmod (n+1)$. We first prove the following Claim. For every integer $g$ with $1 \leqslant g \leqslant d$, the remainders $r_{j}$ with indices $j$ in the range $$ (g-1) k \leqslant j \leqslant g k-1 $$ form a permutation of the $k$ numbers $0 \cdot d, 1 \cdot d, 2 \cdot d, \ldots,(k-1) \cdot d$. Proof. If $r_{j^{\prime}}=r_{j}$ holds for two indices $j^{\prime}$ and $j$ in (2), then $i\left(j^{\prime}-j\right) \equiv 0 \bmod (n+1)$, so that $j^{\prime}-j$ is a multiple of $k$; since $\left|j^{\prime}-j\right| \leqslant k-1$, this implies $j^{\prime}=j$. Hence, the $k$ remainders are pairwise distinct. Moreover, each remainder $r_{j}=i j \bmod (n+1)$ is a multiple of $d=\operatorname{gcd}(i, n+1)$. This proves the claim. We then have $$ \sum_{j=0}^{n} r_{j}=\sum_{g=1}^{d} \sum_{\ell=0}^{(n+1) / d-1} \ell d=d^{2} \cdot \frac{1}{2}\left(\frac{n+1}{d}-1\right) \frac{n+1}{d}=\frac{(n+1-d)(n+1)}{2} $$ By using (3), compute the sum $S_{i}$ of row $i$ as follows: $$ \begin{aligned} S_{i}=\sum_{j=0}^{n}\left\lfloor\frac{i j}{n+1}\right\rfloor= & \sum_{j=0}^{n} \frac{i j-r_{j}}{n+1}=\frac{i}{n+1} \sum_{j=0}^{n} j-\frac{1}{n+1} \sum_{j=0}^{n} r_{j} \\ & =\frac{i}{n+1} \cdot \frac{n(n+1)}{2}-\frac{1}{n+1} \cdot \frac{(n+1-d)(n+1)}{2}=\frac{(i n-n-1+d)}{2} . \end{aligned} $$ Equation (4) yields the following lower bound on the row sum $S_{i}$, which holds with equality if and only if $d=\operatorname{gcd}(i, n+1)=1$ : $$ S_{i} \geqslant \frac{(i n-n-1+1)}{2}=\frac{n(i-1)}{2} $$ By summing up the bounds (5) for the rows $i=1, \ldots, n$, we get the following lower bound for the sum of all entries in the table $$ \sum_{i=1}^{n} S_{i} \geqslant \sum_{i=1}^{n} \frac{n}{2}(i-1)=\frac{n^{2}(n-1)}{4} $$ In (6) we have equality if and only if equality holds in (5) for each $i=1, \ldots, n$, which happens if and only if $\operatorname{gcd}(i, n+1)=1$ for each $i=1, \ldots, n$, which is equivalent to the fact that $n+1$ is a prime. Thus the sum of the table entries is $\frac{1}{4} n^{2}(n-1)$ if and only if $n+1$ is a prime. Comment. To simplify the answer, in the problem statement one can make a change of variables by introducing $m:=n+1$ and writing everything in terms of $m$. The drawback is that the expression for the sum will then be $\frac{1}{4}(m-1)^{2}(m-2)$ which seems more artificial. A3. Given a positive integer $n$, find the smallest value of $\left\lfloor\frac{a_{1}}{1}\right\rfloor+\left\lfloor\frac{a_{2}}{2}\right\rfloor+\cdots+\left\lfloor\frac{a_{n}}{n}\right\rfloor$ over all permutations $\left(a_{1}, a_{2}, \ldots, a_{n}\right)$ of $(1,2, \ldots, n)$. Answer: The minimum of such sums is $\left\lfloor\log _{2} n\right\rfloor+1$; so if $2^{k} \leqslant n<2^{k+1}$, the minimum is $k+1$. Solution 1. Suppose that $2^{k} \leqslant n<2^{k+1}$ with some nonnegative integer $k$. First we show a permutation $\left(a_{1}, a_{2}, \ldots, a_{n}\right)$ such that $\left\lfloor\frac{a_{1}}{1}\right\rfloor+\left\lfloor\frac{a_{2}}{2}\right\rfloor+\cdots+\left\lfloor\frac{a_{n}}{n}\right\rfloor=k+1$; then we will prove that $\left\lfloor\frac{a_{1}}{1}\right\rfloor+\left\lfloor\frac{a_{2}}{2}\right\rfloor+\cdots+\left\lfloor\frac{a_{n}}{n}\right\rfloor \geqslant k+1$ for every permutation. Hence, the minimal possible value will be $k+1$. I. Consider the permutation $$ \begin{gathered} \left(a_{1}\right)=(1), \quad\left(a_{2}, a_{3}\right)=(3,2), \quad\left(a_{4}, a_{5}, a_{6}, a_{7}\right)=(7,4,5,6) \\ \left(a_{2^{k-1}}, \ldots, a_{2^{k}-1}\right)=\left(2^{k}-1,2^{k-1}, 2^{k-1}+1, \ldots, 2^{k}-2\right) \\ \left(a_{2^{k}}, \ldots, a_{n}\right)=\left(n, 2^{k}, 2^{k}+1, \ldots, n-1\right) \end{gathered} $$ This permutation consists of $k+1$ cycles. In every cycle $\left(a_{p}, \ldots, a_{q}\right)=(q, p, p+1, \ldots, q-1)$ we have $q<2 p$, so $$ \sum_{i=p}^{q}\left\lfloor\frac{a_{i}}{i}\right\rfloor=\left\lfloor\frac{q}{p}\right\rfloor+\sum_{i=p+1}^{q}\left\lfloor\frac{i-1}{i}\right\rfloor=1 ; $$ The total sum over all cycles is precisely $k+1$. II. In order to establish the lower bound, we prove a more general statement. Claim. If $b_{1}, \ldots, b_{2^{k}}$ are distinct positive integers then $$ \sum_{i=1}^{2^{k}}\left\lfloor\frac{b_{i}}{i}\right\rfloor \geqslant k+1 $$ From the Claim it follows immediately that $\sum_{i=1}^{n}\left\lfloor\frac{a_{i}}{i}\right\rfloor \geqslant \sum_{i=1}^{2^{k}}\left\lfloor\frac{a_{i}}{i}\right\rfloor \geqslant k+1$. Proof of the Claim. Apply induction on $k$. For $k=1$ the claim is trivial, $\left\lfloor\frac{b_{1}}{1}\right\rfloor \geqslant 1$. Suppose the Claim holds true for some positive integer $k$, and consider $k+1$. If there exists an index $j$ such that $2^{k}k $$ As the left-hand side is an integer, it must be at least $k+1$. A4. Show that for all real numbers $x_{1}, \ldots, x_{n}$ the following inequality holds: $$ \sum_{i=1}^{n} \sum_{j=1}^{n} \sqrt{\left|x_{i}-x_{j}\right|} \leqslant \sum_{i=1}^{n} \sum_{j=1}^{n} \sqrt{\left|x_{i}+x_{j}\right|} $$ Solution 1. If we add $t$ to all the variables then the left-hand side remains constant and the right-hand side becomes $$ H(t):=\sum_{i=1}^{n} \sum_{j=1}^{n} \sqrt{\left|x_{i}+x_{j}+2 t\right|} $$ Let $T$ be large enough such that both $H(-T)$ and $H(T)$ are larger than the value $L$ of the lefthand side of the inequality we want to prove. Not necessarily distinct points $p_{i, j}:=-\left(x_{i}+x_{j}\right) / 2$ together with $T$ and $-T$ split the real line into segments and two rays such that on each of these segments and rays the function $H(t)$ is concave since $f(t):=\sqrt{|\ell+2 t|}$ is concave on both intervals $(-\infty,-\ell / 2]$ and $[-\ell / 2,+\infty)$. Let $[a, b]$ be the segment containing zero. Then concavity implies $H(0) \geqslant \min \{H(a), H(b)\}$ and, since $H( \pm T)>L$, it suffices to prove the inequalities $H\left(-\left(x_{i}+x_{j}\right) / 2\right) \geqslant L$, that is to prove the original inequality in the case when all numbers are shifted in such a way that two variables $x_{i}$ and $x_{j}$ add up to zero. In the following we denote the shifted variables still by $x_{i}$. If $i=j$, i.e. $x_{i}=0$ for some index $i$, then we can remove $x_{i}$ which will decrease both sides by $2 \sum_{k} \sqrt{\left|x_{k}\right|}$. Similarly, if $x_{i}+x_{j}=0$ for distinct $i$ and $j$ we can remove both $x_{i}$ and $x_{j}$ which decreases both sides by $$ 2 \sqrt{2\left|x_{i}\right|}+2 \cdot \sum_{k \neq i, j}\left(\sqrt{\left|x_{k}+x_{i}\right|}+\sqrt{\left|x_{k}+x_{j}\right|}\right) $$ In either case we reduced our inequality to the case of smaller $n$. It remains to note that for $n=0$ and $n=1$ the inequality is trivial. Solution 2. For real $p$ consider the integral $$ I(p)=\int_{0}^{\infty} \frac{1-\cos (p x)}{x \sqrt{x}} d x $$ which clearly converges to a strictly positive number. By changing the variable $y=|p| x$ one notices that $I(p)=\sqrt{|p|} I(1)$. Hence, by using the trigonometric formula $\cos (\alpha-\beta)-\cos (\alpha+$ $\beta)=2 \sin \alpha \sin \beta$ we obtain $\sqrt{|a+b|}-\sqrt{|a-b|}=\frac{1}{I(1)} \int_{0}^{\infty} \frac{\cos ((a-b) x)-\cos ((a+b) x)}{x \sqrt{x}} d x=\frac{1}{I(1)} \int_{0}^{\infty} \frac{2 \sin (a x) \sin (b x)}{x \sqrt{x}} d x$, from which our inequality immediately follows: $$ \sum_{i=1}^{n} \sum_{j=1}^{n} \sqrt{\left|x_{i}+x_{j}\right|}-\sum_{i=1}^{n} \sum_{j=1}^{n} \sqrt{\left|x_{i}-x_{j}\right|}=\frac{2}{I(1)} \int_{0}^{\infty} \frac{\left(\sum_{i=1}^{n} \sin \left(x_{i} x\right)\right)^{2}}{x \sqrt{x}} d x \geqslant 0 $$ Comment 1. A more general inequality $$ \sum_{i=1}^{n} \sum_{j=1}^{n}\left|x_{i}-x_{j}\right|^{r} \leqslant \sum_{i=1}^{n} \sum_{j=1}^{n}\left|x_{i}+x_{j}\right|^{r} $$ holds for any $r \in[0,2]$. The first solution can be repeated verbatim for any $r \in[0,1]$ but not for $r>1$. In the second solution, by putting $x^{r+1}$ in the denominator in place of $x \sqrt{x}$ we can prove the inequality for any $r \in(0,2)$ and the cases $r=0,2$ are easy to check by hand. Comment 2. In fact, the integral from Solution 2 can be computed explicitly, we have $I(1)=\sqrt{2 \pi}$. A5. Let $n \geqslant 2$ be an integer, and let $a_{1}, a_{2}, \ldots, a_{n}$ be positive real numbers such that $a_{1}+a_{2}+\cdots+a_{n}=1$. Prove that $$ \sum_{k=1}^{n} \frac{a_{k}}{1-a_{k}}\left(a_{1}+a_{2}+\cdots+a_{k-1}\right)^{2}<\frac{1}{3} $$ Solution 1. For all $k \leqslant n$, let $$ s_{k}=a_{1}+a_{2}+\cdots+a_{k} \quad \text { and } \quad b_{k}=\frac{a_{k} s_{k-1}^{2}}{1-a_{k}} $$ with the convention that $s_{0}=0$. Note that $b_{k}$ is exactly a summand in the sum we need to estimate. We shall prove the inequality $$ b_{k}<\frac{s_{k}^{3}-s_{k-1}^{3}}{3} $$ Indeed, it suffices to check that $$ \begin{aligned} (1) & \Longleftrightarrow 0<\left(1-a_{k}\right)\left(\left(s_{k-1}+a_{k}\right)^{3}-s_{k-1}^{3}\right)-3 a_{k} s_{k-1}^{2} \\ & \Longleftrightarrow 0<\left(1-a_{k}\right)\left(3 s_{k-1}^{2}+3 s_{k-1} a_{k}+a_{k}^{2}\right)-3 s_{k-1}^{2} \\ & \Longleftrightarrow 0<-3 a_{k} s_{k-1}^{2}+3\left(1-a_{k}\right) s_{k-1} a_{k}+\left(1-a_{k}\right) a_{k}^{2} \\ & \Longleftrightarrow 0<3\left(1-a_{k}-s_{k-1}\right) s_{k-1} a_{k}+\left(1-a_{k}\right) a_{k}^{2} \end{aligned} $$ which holds since $a_{k}+s_{k-1}=s_{k} \leqslant 1$ and $a_{k} \in(0,1)$. Thus, adding inequalities (1) for $k=1, \ldots, n$, we conclude that $$ b_{1}+b_{2}+\cdots+b_{n}<\frac{s_{n}^{3}-s_{0}^{3}}{3}=\frac{1}{3} $$ as desired. Comment 1. There are many ways of proving (1) which can be written as $$ \frac{a s^{2}}{1-a}-\frac{(a+s)^{3}-s^{3}}{3}<0 $$ for non-negative $a$ and $s$ satisfying $a+s \leqslant 1$ and $a>0$. E.g., note that for any fixed $a$ the expression in (2) is quadratic in $s$ with the leading coefficient $a /(1-a)-a>0$. Hence, it is convex as a function in $s$, so it suffices to check the inequality at $s=0$ and $s=1-a$. The former case is trivial and in the latter case the inequality can be rewritten as $$ a s-\frac{3 a s(a+s)+a^{3}}{3}<0, $$ which is trivial since $a+s=1$. Solution 2. First, let us define $$ S\left(a_{1}, \ldots, a_{n}\right):=\sum_{k=1}^{n} \frac{a_{k}}{1-a_{k}}\left(a_{1}+a_{2}+\cdots+a_{k-1}\right)^{2} $$ For some index $i$, denote $a_{1}+\cdots+a_{i-1}$ by $s$. If we replace $a_{i}$ with two numbers $a_{i} / 2$ and $a_{i} / 2$, i.e. replace the tuple $\left(a_{1}, \ldots, a_{n}\right)$ with $\left(a_{1}, \ldots, a_{i-1}, a_{i} / 2, a_{i} / 2, a_{i+1}, \ldots, a_{n}\right)$, the sum will increase by $$ \begin{aligned} S\left(a_{1}, \ldots, a_{i} / 2, a_{i} / 2, \ldots, a_{n}\right)-S\left(a_{1}, \ldots, a_{n}\right) & =\frac{a_{i} / 2}{1-a_{i} / 2}\left(s^{2}+\left(s+a_{i} / 2\right)^{2}\right)-\frac{a_{i}}{1-a_{i}} s^{2} \\ & =a_{i} \frac{\left(1-a_{i}\right)\left(2 s^{2}+s a_{i}+a_{i}^{2} / 4\right)-\left(2-a_{i}\right) s^{2}}{\left(2-a_{i}\right)\left(1-a_{i}\right)} \\ & =a_{i} \frac{\left(1-a_{i}-s\right) s a_{i}+\left(1-a_{i}\right) a_{i}^{2} / 4}{\left(2-a_{i}\right)\left(1-a_{i}\right)} \end{aligned} $$ which is strictly positive. So every such replacement strictly increases the sum. By repeating this process and making maximal number in the tuple tend to zero, we keep increasing the sum which will converge to $$ \int_{0}^{1} x^{2} d x=\frac{1}{3} . $$ This completes the proof. Solution 3. We sketch a probabilistic version of the first solution. Let $x_{1}, x_{2}, x_{3}$ be drawn uniformly and independently at random from the segment [0,1]. Let $I_{1} \cup I_{2} \cup \cdots \cup I_{n}$ be a partition of $[0,1]$ into segments of length $a_{1}, a_{2}, \ldots, a_{n}$ in this order. Let $J_{k}:=I_{1} \cup \cdots \cup I_{k-1}$ for $k \geqslant 2$ and $J_{1}:=\varnothing$. Then $$ \begin{aligned} \frac{1}{3}= & \sum_{k=1}^{n} \mathbb{P}\left\{x_{1} \geqslant x_{2}, x_{3} ; x_{1} \in I_{k}\right\} \\ = & \sum_{k=1}^{n}\left(\mathbb{P}\left\{x_{1} \in I_{k} ; x_{2}, x_{3} \in J_{k}\right\}\right. \\ + & 2 \cdot \mathbb{P}\left\{x_{1} \geqslant x_{2} ; x_{1}, x_{2} \in I_{k} ; x_{3} \in J_{k}\right\} \\ & \left.+\mathbb{P}\left\{x_{1} \geqslant x_{2}, x_{3} ; x_{1}, x_{2}, x_{3} \in I_{k}\right\}\right) \\ = & \sum_{k=1}^{n}\left(a_{k}\left(a_{1}+\cdots+a_{k-1}\right)^{2}+2 \cdot \frac{a_{k}^{2}}{2} \cdot\left(a_{1}+\cdots+a_{k-1}\right)+\frac{a_{k}^{3}}{3}\right) \\ > & \sum_{k=1}^{n}\left(a_{k}\left(a_{1}+\cdots+a_{k-1}\right)^{2}+a_{k}^{2}\left(a_{1}+\cdots+a_{k-1}\right) \cdot \frac{a_{1}+\cdots+a_{k-1}}{1-a_{k}}\right) \end{aligned} $$ where for the last inequality we used that $1-a_{k} \geqslant a_{1}+\cdots+a_{k-1}$. This completes the proof since $$ a_{k}+\frac{a_{k}^{2}}{1-a_{k}}=\frac{a_{k}}{1-a_{k}} $$ A6. Let $A$ be a finite set of (not necessarily positive) integers, and let $m \geqslant 2$ be an integer. Assume that there exist non-empty subsets $B_{1}, B_{2}, B_{3}, \ldots, B_{m}$ of $A$ whose elements add up to the sums $m^{1}, m^{2}, m^{3}, \ldots, m^{m}$, respectively. Prove that $A$ contains at least $m / 2$ elements. Solution. Let $A=\left\{a_{1}, \ldots, a_{k}\right\}$. Assume that, on the contrary, $k=|A|0$ and large enough $m$ we get $k \geqslant(1 / 2-\varepsilon) m$. The proof uses the fact that the combinations $\sum c_{i}$ ! with $c_{i} \in\{0,1, \ldots, i\}$ are all distinct. Comment 2. The problem statement holds also if $A$ is a set of real numbers (not necessarily integers), the above proofs work in the real case. A7. Let $n \geqslant 1$ be an integer, and let $x_{0}, x_{1}, \ldots, x_{n+1}$ be $n+2$ non-negative real numbers that satisfy $x_{i} x_{i+1}-x_{i-1}^{2} \geqslant 1$ for all $i=1,2, \ldots, n$. Show that $$ x_{0}+x_{1}+\cdots+x_{n}+x_{n+1}>\left(\frac{2 n}{3}\right)^{3 / 2} $$ ## Solution 1. Lemma 1.1. If $a, b, c$ are non-negative numbers such that $a b-c^{2} \geqslant 1$, then $$ (a+2 b)^{2} \geqslant(b+2 c)^{2}+6 $$ Proof. $(a+2 b)^{2}-(b+2 c)^{2}=(a-b)^{2}+2(b-c)^{2}+6\left(a b-c^{2}\right) \geqslant 6$. Lemma 1.2. $\sqrt{1}+\cdots+\sqrt{n}>\frac{2}{3} n^{3 / 2}$. Proof. Bernoulli's inequality $(1+t)^{3 / 2}>1+\frac{3}{2} t$ for $0>t \geqslant-1$ (or, alternatively, a straightforward check) gives $$ (k-1)^{3 / 2}=k^{3 / 2}\left(1-\frac{1}{k}\right)^{3 / 2}>k^{3 / 2}\left(1-\frac{3}{2 k}\right)=k^{3 / 2}-\frac{3}{2} \sqrt{k} . $$ Summing up (*) over $k=1,2, \ldots, n$ yields $$ 0>n^{3 / 2}-\frac{3}{2}(\sqrt{1}+\cdots+\sqrt{n}) . $$ Now put $y_{i}:=2 x_{i}+x_{i+1}$ for $i=0,1, \ldots, n$. We get $y_{0} \geqslant 0$ and $y_{i}^{2} \geqslant y_{i-1}^{2}+6$ for $i=1,2, \ldots, n$ by Lemma 1.1. Thus, an easy induction on $i$ gives $y_{i} \geqslant \sqrt{6 i}$. Using this estimate and Lemma 1.2 we get $$ 3\left(x_{0}+\ldots+x_{n+1}\right) \geqslant y_{1}+\ldots+y_{n} \geqslant \sqrt{6}(\sqrt{1}+\sqrt{2}+\ldots+\sqrt{n})>\sqrt{6} \cdot \frac{2}{3} n^{3 / 2}=3\left(\frac{2 n}{3}\right)^{3 / 2} $$ Solution 2. Say that an index $i \in\{0,1, \ldots, n+1\}$ is good, if $x_{i} \geqslant \sqrt{\frac{2}{3}} i$, otherwise call the index $i$ bad. Lemma 2.1. There are no two consecutive bad indices. Proof. Assume the contrary and consider two bad indices $j, j+1$ with minimal possible $j$. Since 0 is good, we get $j>0$, thus by minimality $j-1$ is a good index and we have $$ \frac{2}{3} \sqrt{j(j+1)}>x_{j} x_{j+1} \geqslant x_{j-1}^{2}+1 \geqslant \frac{2}{3}(j-1)+1=\frac{2}{3} \cdot \frac{j+(j+1)}{2} $$ that contradicts the AM-GM inequality for numbers $j$ and $j+1$. Lemma 2.2. If an index $j \leqslant n-1$ is good, then $$ x_{j+1}+x_{j+2} \geqslant \sqrt{\frac{2}{3}}(\sqrt{j+1}+\sqrt{j+2}) . $$ Proof. We have $$ x_{j+1}+x_{j+2} \geqslant 2 \sqrt{x_{j+1} x_{j+2}} \geqslant 2 \sqrt{x_{j}^{2}+1} \geqslant 2 \sqrt{\frac{2}{3} j+1} \geqslant \sqrt{\frac{2}{3} j+\frac{2}{3}}+\sqrt{\frac{2}{3} j+\frac{4}{3}}, $$ the last inequality follows from concavity of the square root function, or, alternatively, from the AM-QM inequality for the numbers $\sqrt{\frac{2}{3} j+\frac{2}{3}}$ and $\sqrt{\frac{2}{3} j+\frac{4}{3}}$. Let $S_{i}=x_{1}+\ldots+x_{i}$ and $T_{i}=\sqrt{\frac{2}{3}}(\sqrt{1}+\ldots+\sqrt{i})$. Lemma 2.3. If an index $i$ is good, then $S_{i} \geqslant T_{i}$. Proof. Induction on $i$. The base case $i=0$ is clear. Assume that the claim holds for good indices less than $i$ and prove it for a good index $i>0$. If $i-1$ is good, then by the inductive hypothesis we get $S_{i}=S_{i-1}+x_{i} \geqslant T_{i-1}+\sqrt{\frac{2}{3} i}=T_{i}$. If $i-1$ is bad, then $i>1$, and $i-2$ is good by Lemma 2.1. Then using Lemma 2.2 and the inductive hypothesis we get $$ S_{i}=S_{i-2}+x_{i-1}+x_{i} \geqslant T_{i-2}+\sqrt{\frac{2}{3}}(\sqrt{i-1}+\sqrt{i})=T_{i} $$ Since either $n$ or $n+1$ is good by Lemma 2.1, Lemma 2.3 yields in both cases $S_{n+1} \geqslant T_{n}$, and it remains to apply Lemma 1.2 from Solution 1. Comment 1. Another way to get (*) is the integral bound $$ k^{3 / 2}-(k-1)^{3 / 2}=\int_{k-1}^{k} \frac{3}{2} \sqrt{x} d x<\frac{3}{2} \sqrt{k} . $$ Comment 2. If $x_{i}=\sqrt{2 / 3} \cdot(\sqrt{i}+1)$, the conditions of the problem hold. Indeed, the inequality to check is $$ (\sqrt{i}+1)(\sqrt{i+1}+1)-(\sqrt{i-1}+1)^{2} \geqslant 3 / 2 $$ that rewrites as $$ \sqrt{i}+\sqrt{i+1}-2 \sqrt{i-1} \geqslant(i+1 / 2)-\sqrt{i(i+1)}=\frac{1 / 4}{i+1 / 2+\sqrt{i(i+1)}}, $$ which follows from $$ \sqrt{i}-\sqrt{i-1}=\frac{1}{\sqrt{i}+\sqrt{i-1}}>\frac{1}{2 i} $$ For these numbers we have $x_{0}+\ldots+x_{n+1}=\left(\frac{2 n}{3}\right)^{3 / 2}+O(n)$, thus the multiplicative constant $(2 / 3)^{3 / 2}$ in the problem statement is sharp. A8. Determine all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ that satisfy $$ (f(a)-f(b))(f(b)-f(c))(f(c)-f(a))=f\left(a b^{2}+b c^{2}+c a^{2}\right)-f\left(a^{2} b+b^{2} c+c^{2} a\right) $$ for all real numbers $a, b, c$. Answer: $f(x)=\alpha x+\beta$ or $f(x)=\alpha x^{3}+\beta$ where $\alpha \in\{-1,0,1\}$ and $\beta \in \mathbb{R}$. Solution. It is straightforward to check that above functions satisfy the equation. Now let $f(x)$ satisfy the equation, which we denote $E(a, b, c)$. Then clearly $f(x)+C$ also does; therefore, we may suppose without loss of generality that $f(0)=0$.We start with proving Lemma. Either $f(x) \equiv 0$ or $f$ is injective. Proof. Denote by $\Theta \subseteq \mathbb{R}^{2}$ the set of points $(a, b)$ for which $f(a)=f(b)$. Let $\Theta^{*}=\{(x, y) \in \Theta$ : $x \neq y\}$. The idea is that if $(a, b) \in \Theta$, then by $E(a, b, x)$ we get $$ H_{a, b}(x):=\left(a b^{2}+b x^{2}+x a^{2}, a^{2} b+b^{2} x+x^{2} a\right) \in \Theta $$ for all real $x$. Reproducing this argument starting with $(a, b) \in \Theta^{*}$, we get more and more points in $\Theta$. There are many ways to fill in the details, we give below only one of them. Assume that $(a, b) \in \Theta^{*}$. Note that $$ g_{-}(x):=\left(a b^{2}+b x^{2}+x a^{2}\right)-\left(a^{2} b+b^{2} x+x^{2} a\right)=(a-b)(b-x)(x-a) $$ and $$ g_{+}(x):=\left(a b^{2}+b x^{2}+x a^{2}\right)+\left(a^{2} b+b^{2} x+x^{2} a\right)=\left(x^{2}+a b\right)(a+b)+x\left(a^{2}+b^{2}\right) . $$ Hence, there exists $x$ for which both $g_{-}(x) \neq 0$ and $g_{+}(x) \neq 0$. This gives a point $(\alpha, \beta)=$ $H_{a, b}(x) \in \Theta^{*}$ for which $\alpha \neq-\beta$. Now compare $E(\alpha, 1,0)$ and $E(\beta, 1,0)$. The left-hand side expressions coincide, on right-hand side we get $f(\alpha)-f\left(\alpha^{2}\right)=f(\beta)-f\left(\beta^{2}\right)$, respectively. Hence, $f\left(\alpha^{2}\right)=f\left(\beta^{2}\right)$ and we get a point $\left(\alpha_{1}, \beta_{1}\right):=\left(\alpha^{2}, \beta^{2}\right) \in \Theta^{*}$ with both coordinates $\alpha_{1}, \beta_{1}$ non-negative. Continuing squaring the coordinates, we get a point $(\gamma, \delta) \in \Theta^{*}$ for which $\delta>5 \gamma \geqslant 0$. Our nearest goal is to get a point $(0, r) \in \Theta^{*}$. If $\gamma=0$, this is already done. If $\gamma>0$, denote by $x$ a real root of the quadratic equation $\delta \gamma^{2}+\gamma x^{2}+x \delta^{2}=0$, which exists since the discriminant $\delta^{4}-4 \delta \gamma^{3}$ is positive. Also $x<0$ since this equation cannot have non-negative root. For the point $H_{\delta, \gamma}(x)=:(0, r) \in \Theta$ the first coordinate is 0 . The difference of coordinates equals $-r=(\delta-\gamma)(\gamma-x)(x-\delta)<0$, so $r \neq 0$ as desired. Now, let $(0, r) \in \Theta^{*}$. We get $H_{0, r}(x)=\left(r x^{2}, r^{2} x\right) \in \Theta$. Thus $f\left(r x^{2}\right)=f\left(r^{2} x\right)$ for all $x \in \mathbb{R}$. Replacing $x$ to $-x$ we get $f\left(r x^{2}\right)=f\left(r^{2} x\right)=f\left(-r^{2} x\right)$, so $f$ is even: $(a,-a) \in \Theta$ for all $a$. Then $H_{a,-a}(x)=\left(a^{3}-a x^{2}+x a^{2},-a^{3}+a^{2} x+x^{2} a\right) \in \Theta$ for all real $a, x$. Putting $x=\frac{1+\sqrt{5}}{2} a$ we obtain $\left(0,(1+\sqrt{5}) a^{3}\right) \in \Theta$ which means that $f(y)=f(0)=0$ for every real $y$. Hereafter we assume that $f$ is injective and $f(0)=0$. By $E(a, b, 0)$ we get $$ f(a) f(b)(f(a)-f(b))=f\left(a^{2} b\right)-f\left(a b^{2}\right) . $$ Let $\kappa:=f(1)$ and note that $\kappa=f(1) \neq f(0)=0$ by injectivity. Putting $b=1$ in ( $\Omega$ ) we get $$ \kappa f(a)(f(a)-\kappa)=f\left(a^{2}\right)-f(a) . $$ Subtracting the same equality for $-a$ we get $$ \kappa(f(a)-f(-a))(f(a)+f(-a)-\kappa)=f(-a)-f(a) . $$ Now, if $a \neq 0$, by injectivity we get $f(a)-f(-a) \neq 0$ and thus $$ f(a)+f(-a)=\kappa-\kappa^{-1}=: \lambda . $$ It follows that $$ f(a)-f(b)=f(-b)-f(-a) $$ for all non-zero $a, b$. Replace non-zero numbers $a, b$ in ( $\odot$ ) with $-a,-b$, respectively, and add the two equalities. Due to ( $\boldsymbol{\uparrow}$ ) we get $$ (f(a)-f(b))(f(a) f(b)-f(-a) f(-b))=0 $$ thus $f(a) f(b)=f(-a) f(-b)=(\lambda-f(a))(\lambda-f(b))$ for all non-zero $a \neq b$. If $\lambda \neq 0$, this implies $f(a)+f(b)=\lambda$ that contradicts injectivity when we vary $b$ with fixed $a$. Therefore, $\lambda=0$ and $\kappa= \pm 1$. Thus $f$ is odd. Replacing $f$ with $-f$ if necessary (this preserves the original equation) we may suppose that $f(1)=1$. Now, (\&) yields $f\left(a^{2}\right)=f^{2}(a)$. Summing relations $(\bigcirc)$ for pairs $(a, b)$ and $(a,-b)$, we get $-2 f(a) f^{2}(b)=-2 f\left(a b^{2}\right)$, i.e. $f(a) f\left(b^{2}\right)=f\left(a b^{2}\right)$. Putting $b=\sqrt{x}$ for each non-negative $x$ we get $f(a x)=f(a) f(x)$ for all real $a$ and non-negative $x$. Since $f$ is odd, this multiplicativity relation is true for all $a, x$. Also, from $f\left(a^{2}\right)=f^{2}(a)$ we see that $f(x) \geqslant 0$ for $x \geqslant 0$. Next, $f(x)>0$ for $x>0$ by injectivity. Assume that $f(x)$ for $x>0$ does not have the form $f(x)=x^{\tau}$ for a constant $\tau$. The known property of multiplicative functions yields that the graph of $f$ is dense on $(0, \infty)^{2}$. In particular, we may find positive $b<1 / 10$ for which $f(b)>1$. Also, such $b$ can be found if $f(x)=x^{\tau}$ for some $\tau<0$. Then for all $x$ we have $x^{2}+x b^{2}+b \geqslant 0$ and so $E(1, b, x)$ implies that $$ f\left(b^{2}+b x^{2}+x\right)=f\left(x^{2}+x b^{2}+b\right)+(f(b)-1)(f(x)-f(b))(f(x)-1) \geqslant 0-\left((f(b)-1)^{3} / 4\right. $$ is bounded from below (the quadratic trinomial bound $(t-f(1))(t-f(b)) \geqslant-(f(b)-1)^{2} / 4$ for $t=f(x)$ is used). Hence, $f$ is bounded from below on $\left(b^{2}-\frac{1}{4 b},+\infty\right)$, and since $f$ is odd it is bounded from above on $\left(0, \frac{1}{4 b}-b^{2}\right)$. This is absurd if $f(x)=x^{\tau}$ for $\tau<0$, and contradicts to the above dense graph condition otherwise. Therefore, $f(x)=x^{\tau}$ for $x>0$ and some constant $\tau>0$. Dividing $E(a, b, c)$ by $(a-b)(b-$ $c)(c-a)=\left(a b^{2}+b c^{2}+c a^{2}\right)-\left(a^{2} b+b^{2} c+c^{2} a\right)$ and taking a limit when $a, b, c$ all go to 1 (the divided ratios tend to the corresponding derivatives, say, $\frac{a^{\tau}-b^{\tau}}{a-b} \rightarrow\left(x^{\tau}\right)_{x=1}^{\prime}=\tau$ ), we get $\tau^{3}=\tau \cdot 3^{\tau-1}, \tau^{2}=3^{\tau-1}, F(\tau):=3^{\tau / 2-1 / 2}-\tau=0$. Since function $F$ is strictly convex, it has at most two roots, and we get $\tau \in\{1,3\}$. ## Combinatorics C1. Let $S$ be an infinite set of positive integers, such that there exist four pairwise distinct $a, b, c, d \in S$ with $\operatorname{gcd}(a, b) \neq \operatorname{gcd}(c, d)$. Prove that there exist three pairwise distinct $x, y, z \in S$ such that $\operatorname{gcd}(x, y)=\operatorname{gcd}(y, z) \neq \operatorname{gcd}(z, x)$. Solution. There exists $\alpha \in S$ so that $\{\operatorname{gcd}(\alpha, s) \mid s \in S, s \neq \alpha\}$ contains at least two elements. Since $\alpha$ has only finitely many divisors, there is a $d \mid \alpha$ such that the set $B=\{\beta \in$ $S \mid \operatorname{gcd}(\alpha, \beta)=d\}$ is infinite. Pick $\gamma \in S$ so that $\operatorname{gcd}(\alpha, \gamma) \neq d$. Pick $\beta_{1}, \beta_{2} \in B$ so that $\operatorname{gcd}\left(\beta_{1}, \gamma\right)=\operatorname{gcd}\left(\beta_{2}, \gamma\right)=: d^{\prime}$. If $d=d^{\prime}$, then $\operatorname{gcd}\left(\alpha, \beta_{1}\right)=\operatorname{gcd}\left(\gamma, \beta_{1}\right) \neq \operatorname{gcd}(\alpha, \gamma)$. If $d \neq d^{\prime}$, then either $\operatorname{gcd}\left(\alpha, \beta_{1}\right)=\operatorname{gcd}\left(\alpha, \beta_{2}\right)=d$ and $\operatorname{gcd}\left(\beta_{1}, \beta_{2}\right) \neq d$ or $\operatorname{gcd}\left(\gamma, \beta_{1}\right)=\operatorname{gcd}\left(\gamma, \beta_{2}\right)=d^{\prime}$ and $\operatorname{gcd}\left(\beta_{1}, \beta_{2}\right) \neq d^{\prime}$. Comment. The situation can be modelled as a complete graph on the infinite vertex set $S$, where every edge $\{s, t\}$ is colored by $c(s, t):=\operatorname{gcd}(s, t)$. For every vertex the incident edges carry only finitely many different colors, and by the problem statement at least two different colors show up on the edge set. The goal is to show that there exists a bi-colored triangle (a triangle, whose edges carry exactly two different colors). For the proof, consider a vertex $v$ whose incident edges carry at least two different colors. Let $X \subset S$ be an infinite subset so that $c(v, x) \equiv c_{1}$ for all $x \in X$. Let $y \in S$ be a vertex so that $c(v, y) \neq c_{1}$. Let $x_{1}, x_{2} \in X$ be two vertices with $c\left(y, x_{1}\right)=c\left(y, x_{2}\right)=c_{2}$. If $c_{1}=c_{2}$, then the triangle $v, y, x_{1}$ is bi-colored. If $c_{1} \neq c_{2}$, then one of $v, x_{1}, x_{2}$ and $y, x_{1}, x_{2}$ is bi-colored. C2. Let $n \geqslant 3$ be an integer. An integer $m \geqslant n+1$ is called $n$-colourful if, given infinitely many marbles in each of $n$ colours $C_{1}, C_{2}, \ldots, C_{n}$, it is possible to place $m$ of them around a circle so that in any group of $n+1$ consecutive marbles there is at least one marble of colour $C_{i}$ for each $i=1, \ldots, n$. Prove that there are only finitely many positive integers which are not $n$-colourful. Find the largest among them. Answer: $m_{\max }=n^{2}-n-1$. Solution. First suppose that there are $n(n-1)-1$ marbles. Then for one of the colours, say blue, there are at most $n-2$ marbles, which partition the non-blue marbles into at most $n-2$ groups with at least $(n-1)^{2}>n(n-2)$ marbles in total. Thus one of these groups contains at least $n+1$ marbles and this group does not contain any blue marble. Now suppose that the total number of marbles is at least $n(n-1)$. Then we may write this total number as $n k+j$ with some $k \geqslant n-1$ and with $0 \leqslant j \leqslant n-1$. We place around a circle $k-j$ copies of the colour sequence $[1,2,3, \ldots, n]$ followed by $j$ copies of the colour sequence $[1,1,2,3, \ldots, n]$. C3. A thimblerigger has 2021 thimbles numbered from 1 through 2021. The thimbles are arranged in a circle in arbitrary order. The thimblerigger performs a sequence of 2021 moves; in the $k^{\text {th }}$ move, he swaps the positions of the two thimbles adjacent to thimble $k$. Prove that there exists a value of $k$ such that, in the $k^{\text {th }}$ move, the thimblerigger swaps some thimbles $a$ and $b$ such that $ak \geqslant 1$. There are $2 n+1$ students standing in a circle. Each student $S$ has $2 k$ neighbours - namely, the $k$ students closest to $S$ on the right, and the $k$ students closest to $S$ on the left. Suppose that $n+1$ of the students are girls, and the other $n$ are boys. Prove that there is a girl with at least $k$ girls among her neighbours. Solution. We replace the girls by 1's, and the boys by 0 's, getting the numbers $a_{1}, a_{2}, \ldots, a_{2 n+1}$ arranged in a circle. We extend this sequence periodically by letting $a_{2 n+1+k}=a_{k}$ for all $k \in \mathbb{Z}$. We get an infinite periodic sequence $$ \ldots, a_{1}, a_{2}, \ldots, a_{2 n+1}, a_{1}, a_{2}, \ldots, a_{2 n+1}, \ldots $$ Consider the numbers $b_{i}=a_{i}+a_{i-k-1}-1 \in\{-1,0,1\}$ for all $i \in \mathbb{Z}$. We know that $$ b_{m+1}+b_{m+2}+\cdots+b_{m+2 n+1}=1 \quad(m \in \mathbb{Z}) $$ in particular, this yields that there exists some $i_{0}$ with $b_{i_{0}}=1$. Now we want to find an index $i$ such that $$ b_{i}=1 \quad \text { and } \quad b_{i+1}+b_{i+2}+\cdots+b_{i+k} \geqslant 0 $$ This will imply that $a_{i}=1$ and $$ \left(a_{i-k}+a_{i-k+1}+\cdots+a_{i-1}\right)+\left(a_{i+1}+a_{i+2}+\cdots+a_{i+k}\right) \geqslant k $$ as desired. Suppose, to the contrary, that for every index $i$ with $b_{i}=1$ the sum $b_{i+1}+b_{i+2}+\cdots+b_{i+k}$ is negative. We start from some index $i_{0}$ with $b_{i_{0}}=1$ and construct a sequence $i_{0}, i_{1}, i_{2}, \ldots$, where $i_{j}(j>0)$ is the smallest possible index such that $i_{j}>i_{j-1}+k$ and $b_{i_{j}}=1$. We can choose two numbers among $i_{0}, i_{1}, \ldots, i_{2 n+1}$ which are congruent modulo $2 n+1$ (without loss of generality, we may assume that these numbers are $i_{0}$ and $i_{T}$ ). On the one hand, for every $j$ with $0 \leqslant j \leqslant T-1$ we have $$ S_{j}:=b_{i_{j}}+b_{i_{j}+1}+b_{i_{j}+2}+\cdots+b_{i_{j+1}-1} \leqslant b_{i_{j}}+b_{i_{j}+1}+b_{i_{j}+2}+\cdots+b_{i_{j}+k} \leqslant 0 $$ since $b_{i_{j}+k+1}, \ldots, b_{i_{j+1}-1} \leqslant 0$. On the other hand, since $\left(i_{T}-i_{0}\right) \mid(2 n+1)$, from (1) we deduce $$ S_{0}+\cdots+S_{T-1}=\sum_{i=i_{0}}^{i_{T}-1} b_{i}=\frac{i_{T}-i_{0}}{2 n+1}>0 $$ This contradiction finishes the solution. Comment 1. After the problem is reduced to finding an index $i$ satisfying (2), one can finish the solution by applying the (existence part of) following statement. Lemma (Raney). If $\left\langle x_{1}, x_{2}, \ldots, x_{m}\right\rangle$ is any sequence of integers whose sum is +1 , exactly one of the cyclic shifts $\left\langle x_{1}, x_{2}, \ldots, x_{m}\right\rangle,\left\langle x_{2}, \ldots, x_{m}, x_{1}\right\rangle, \ldots,\left\langle x_{m}, x_{1}, \ldots, x_{m-1}\right\rangle$ has all of its partial sums positive. A (possibly wider known) version of this lemma, which also can be used in order to solve the problem, is the following Claim (Gas stations problem). Assume that there are several fuel stations located on a circular route which together contain just enough gas to make one trip around. Then one can make it all the way around, starting at the right station with an empty tank. Both Raney's theorem and the Gas stations problem admit many different (parallel) proofs. Their ideas can be disguised in direct solutions of the problem at hand (as it, in fact, happens in the above solution); such solutions may avoid the introduction of the $b_{i}$. Below, in Comment 2 we present a variant of such solution, while in Comment 3 we present an alternative proof of Raney's theorem. Comment 2. Here is a version of the solution which avoids the use of the $b_{i}$. Suppose the contrary. Introduce the numbers $a_{i}$ as above. Starting from any index $s_{0}$ with $a_{s_{0}}=1$, we construct a sequence $s_{0}, s_{1}, s_{2}, \ldots$ by letting $s_{i}$ to be the smallest index larger than $s_{i-1}+k$ such that $a_{s_{i}}=1$, for $i=1,2, \ldots$. Choose two indices among $s_{1}, \ldots, s_{2 n+1}$ which are congruent modulo $2 n+1$; we assume those two are $s_{0}$ and $s_{T}$, with $s_{T}-s_{0}=t(2 n+1)$. Notice here that $s_{T+1}-s_{T}=s_{1}-s_{0}$. For every $i=0,1,2, \ldots, T$, put $$ L_{i}=s_{i+1}-s_{i} \quad \text { and } \quad S_{i}=a_{s_{i}}+a_{s_{i}+1}+\cdots+a_{s_{i+1}-1} . $$ Now, by the indirect assumption, for every $i=1,2, \ldots, T$, we have $$ a_{s_{i}-k}+a_{s_{i}-k+1}+\cdots+a_{s_{i}+k} \leqslant a_{s_{i}}+(k-1)=k . $$ Recall that $a_{j}=0$ for all $j$ with $s_{i}+kB C$. Suppose that $A D>D C$, and let $H=A C \cap B D$. Then the rays $B B_{1}$ and $D D_{1}$ lie on one side of $B D$, as they contain the midpoints of the arcs $A D C$ and $A B C$, respectively. However, if $B D_{1} \| D B_{1}$, then $B_{1}$ and $D_{1}$ should be separated by $H$. This contradiction shows that $A D\overparen{C B}$. In the right-angled triangle $B B_{1} B_{2}$, the point $L_{B}$ is a point on the hypothenuse such that $L_{B} B_{1}=L_{B} B$, so $L_{B}$ is the midpoint of $B_{1} B_{2}$. Since $D D_{1}$ is the internal angle bisector of $\angle A D C$, we have $$ \angle B D D_{1}=\frac{\angle B D A-\angle C D B}{2}=\frac{\angle B C A-\angle C A B}{2}=\angle B B_{2} D_{1}, $$ so the points $B, B_{2}, D$, and $D_{1}$ lie on some circle $\omega_{B}$. Similarly, $L_{D}$ is the midpoint of $D_{1} D_{2}$, and the points $D, D_{2}, B$, and $B_{1}$ lie on some circle $\omega_{D}$. Now we have $$ \angle B_{2} D B_{1}=\angle B_{2} D B-\angle B_{1} D B=\angle B_{2} D_{1} B-\angle B_{1} D_{2} B=\angle D_{2} B D_{1} . $$ Therefore, the corresponding sides of the triangles $D B_{1} B_{2}$ and $B D_{1} D_{2}$ are parallel, and the triangles are homothetical (in $H$ ). So their corresponding medians $D L_{B}$ and $B L_{D}$ are also parallel. ![](https://cdn.mathpix.com/cropped/2024_11_18_7107063274cfa469597ag-53.jpg?height=535&width=1492&top_left_y=1914&top_left_x=285) Yet alternatively, after obtaining the circles $\omega_{B}$ and $\omega_{D}$, one may notice that $H$ lies on their radical axis $B D$, whence $H B_{1} \cdot H D_{2}=H D_{1} \cdot H B_{2}$, or $$ \frac{H B_{1}}{H D_{1}}=\frac{H B_{2}}{H D_{1}} . $$ Since $h\left(D_{1}\right)=B_{1}$, this yields $h\left(D_{2}\right)=B_{2}$ and hence $h\left(L_{D}\right)=L_{B}$. Comment 3. Since $h$ preserves the line $A C$ and maps $B \mapsto D$ and $D_{1} \mapsto B_{1}$, we have $h\left(\gamma_{B}\right)=\gamma_{D}$. Therefore, $h\left(O_{B}\right)=O_{D}$; in particular, $H$ also lies on $O_{B} O_{D}$. Solution 2. Let $B D_{1}$ and $T_{B} D_{1}$ meet $\Omega$ again at $X_{B}$ and $Y_{B}$, respectively. Then $$ \angle B D_{1} C=\angle B T_{B} D_{1}=\angle B T_{B} Y_{B}=\angle B X_{B} Y_{B} $$ which shows that $X_{B} Y_{B} \| A C$. Similarly, let $D B_{1}$ and $T_{D} B_{1}$ meet $\Omega$ again at $X_{D}$ and $Y_{D}$, respectively; then $X_{D} Y_{D} \| A C$. Let $M_{D}$ and $M_{B}$ be the midpoints of the arcs $A B C$ and $A D C$, respectively; then the points $D_{1}$ and $B_{1}$ lie on $D M_{D}$ and $B M_{B}$, respectively. Let $K$ be the midpoint of $A C$ (which lies on $M_{B} M_{D}$ ). Applying Pascal's theorem to $M_{D} D X_{D} X_{B} B M_{B}$, we obtain that the points $D_{1}=M_{D} D \cap X_{B} B, B_{1}=D X_{D} \cap B M_{B}$, and $X_{D} X_{B} \cap M_{B} M_{D}$ are collinear, which means that $X_{B} X_{D}$ passes through $K$. Due to symmetry, the diagonals of an isosceles trapezoid $X_{B} Y_{B} X_{D} Y_{D}$ cross at $K$. ![](https://cdn.mathpix.com/cropped/2024_11_18_7107063274cfa469597ag-54.jpg?height=1143&width=1164&top_left_y=888&top_left_x=446) Let $b$ and $d$ denote the distances from the lines $X_{B} Y_{B}$ and $X_{D} Y_{D}$, respectively, to $A C$. Then we get $$ \frac{X_{B} Y_{B}}{X_{D} Y_{D}}=\frac{b}{d}=\frac{D_{1} X_{B}}{B_{1} X_{D}} $$ where the second equation holds in view of $D_{1} X_{B} \| B_{1} X_{D}$. Therefore, the triangles $D_{1} X_{B} Y_{B}$ and $B_{1} X_{D} Y_{D}$ are similar. The triangles $D_{1} T_{B} B$ and $B_{1} T_{D} D$ are similar to them and hence to each other. Since $B D_{1} \| D B_{1}$, these triangles are also homothetical. This yields $B T_{B} \| D T_{D}$, as desired. Comment 4. The original problem proposal asked to prove that the relations $B D_{1} \| D B_{1}$ and $O \in O_{1} O_{2}$ are equivalent. After obtaining $B D_{1} \| D B_{1} \Rightarrow O \in O_{1} O_{2}$, the converse proof is either repeated backwards mutatis mutandis, or can be obtained by the usual procedure of varying some points in the construction. The Problem Selection Committee chose the current version, because it is less technical, yet keeps most of the ideas. G6. Determine all integers $n \geqslant 3$ satisfying the following property: every convex $n$-gon whose sides all have length 1 contains an equilateral triangle of side length 1. (Every polygon is assumed to contain its boundary.) Answer: All odd $n \geqslant 3$. Solution. First we show that for every even $n \geqslant 4$ there exists a polygon violating the required statement. Consider a regular $k$-gon $A_{0} A_{1}, \ldots A_{k-1}$ with side length 1 . Let $B_{1}, B_{2}, \ldots, B_{n / 2-1}$ be the points symmetric to $A_{1}, A_{2}, \ldots, A_{n / 2-1}$ with respect to the line $A_{0} A_{n / 2}$. Then $P=$ $A_{0} A_{1} A_{2} \ldots A_{n / 2-1} A_{n / 2} B_{n / 2-1} B_{n / 2-2} \ldots B_{2} B_{1}$ is a convex $n$-gon whose sides all have length 1 . If $k$ is big enough, $P$ is contained in a strip of width $1 / 2$, which clearly does not contain any equilateral triangle of side length 1. ![](https://cdn.mathpix.com/cropped/2024_11_18_7107063274cfa469597ag-56.jpg?height=175&width=1363&top_left_y=826&top_left_x=346) Assume now that $n=2 k+1$. As the case $k=1$ is trivially true, we assume $k \geqslant 2$ henceforth. Consider a convex $(2 k+1)$-gon $P$ whose sides all have length 1 . Let $d$ be its longest diagonal. The endpoints of $d$ split the perimeter of $P$ into two polylines, one of which has length at least $k+1$. Hence we can label the vertices of $P$ so that $P=A_{0} A_{1} \ldots A_{2 k}$ and $d=A_{0} A_{\ell}$ with $\ell \geqslant k+1$. We will show that, in fact, the polygon $A_{0} A_{1} \ldots A_{\ell}$ contains an equilateral triangle of side length 1 . Suppose that $\angle A_{\ell} A_{0} A_{1} \geqslant 60^{\circ}$. Since $d$ is the longest diagonal, we have $A_{1} A_{\ell} \leqslant A_{0} A_{\ell}$, so $\angle A_{0} A_{1} A_{\ell} \geqslant \angle A_{\ell} A_{0} A_{1} \geqslant 60^{\circ}$. It follows that there exists a point $X$ inside the triangle $A_{0} A_{1} A_{\ell}$ such that the triangle $A_{0} A_{1} X$ is equilateral, and this triangle is contained in $P$. Similar arguments apply if $\angle A_{\ell-1} A_{\ell} A_{0} \geqslant 60^{\circ}$. ![](https://cdn.mathpix.com/cropped/2024_11_18_7107063274cfa469597ag-56.jpg?height=224&width=730&top_left_y=1524&top_left_x=663) From now on, assume $\angle A_{\ell} A_{0} A_{1}<60^{\circ}$ and $A_{\ell-1} A_{\ell} A_{0}<60^{\circ}$. Consider an isosceles trapezoid $A_{0} Y Z A_{\ell}$ such that $A_{0} A_{\ell} \| Y Z, A_{0} Y=Z A_{\ell}=1$, and $\angle A_{\ell} A_{0} Y=\angle Z A_{\ell} A_{0}=60^{\circ}$. Suppose that $A_{0} A_{1} \ldots A_{\ell}$ is contained in $A_{0} Y Z A_{\ell}$. Note that the perimeter of $A_{0} A_{1} \ldots A_{\ell}$ equals $\ell+A_{0} A_{\ell}$ and the perimeter of $A_{0} Y Z A_{\ell}$ equals $2 A_{0} A_{\ell}+1$. ![](https://cdn.mathpix.com/cropped/2024_11_18_7107063274cfa469597ag-56.jpg?height=209&width=1320&top_left_y=1957&top_left_x=371) Recall a well-known fact stating that if a convex polygon $P_{1}$ is contained in a convex polygon $P_{2}$, then the perimeter of $P_{1}$ is at most the perimeter of $P_{2}$. Hence we obtain $$ \ell+A_{0} A_{\ell} \leqslant 2 A_{0} A_{\ell}+1, \quad \text { i.e. } \quad \ell-1 \leqslant A_{0} A_{\ell} . $$ On the other hand, the triangle inequality yields $$ A_{0} A_{\ell}1 / 2$ and $P A_{\ell}>1 / 2$. Choose points $Q \in A_{0} P, R \in P A_{\ell}$, and $S \in P A_{m}$ such that $P Q=P R=1 / 2$ and $P S=\sqrt{3} / 2$. Then $Q R S$ is an equilateral triangle of side length 1 contained in $A_{0} A_{1} \ldots A_{\ell}$. ![](https://cdn.mathpix.com/cropped/2024_11_18_7107063274cfa469597ag-57.jpg?height=335&width=1332&top_left_y=404&top_left_x=365) Comment. In fact, for every odd $n$ a stronger statement holds, which is formulated in terms defined in the solution above: there exists an equilateral triangle $A_{i} A_{i+1} B$ contained in $A_{0} A_{1} \ldots A_{\ell}$ for some $0 \leqslant i<\ell$. We sketch an indirect proof below. As above, we get $\angle A_{\ell} A_{0} A_{1}<60^{\circ}$ and $A_{\ell-1} A_{\ell} A_{0}<60^{\circ}$. Choose an index $m \in[1, \ell-1]$ maximising the distance between $A_{m}$ and $A_{0} A_{\ell}$. Arguments from the above solution yield $1120^{\circ}$ and $\angle A_{m-1} A_{m} A_{\ell}>\angle A_{0} A_{m} A_{\ell} \geqslant 60^{\circ}$. We construct an equilateral triangle $A_{m-1} A_{m} B$ as in the figure below. If $B$ lies in $A_{0} A_{m-1} A_{m} A_{\ell}$, then we are done. Otherwise $B$ and $A_{m}$ lie on different sides of $A_{0} A_{\ell}$. As before, let $P$ be the projection of $A_{m}$ to $A_{0} A_{\ell}$. We will show that $$ A_{0} A_{1}+A_{1} A_{2}+\ldots+A_{m-1} A_{m}A C$ so that $\angle B A D=\angle D A C$. A point $E$ is constructed on the segment $A C$ so that $\angle A D E=\angle D C B$. Similarly, a point $F$ is constructed on the segment $A B$ so that $\angle A D F=\angle D B C$. A point $X$ is chosen on the line $A C$ so that $C X=B X$. Let $O_{1}$ and $O_{2}$ be the circumcentres of the triangles $A D C$ and $D X E$. Prove that the lines $B C, E F$, and $O_{1} O_{2}$ are concurrent. Common remarks. Let $Q$ be the isogonal conjugate of $D$ with respect to the triangle $A B C$. Since $\angle B A D=\angle D A C$, the point $Q$ lies on $A D$. Then $\angle Q B A=\angle D B C=\angle F D A$, so the points $Q, D, F$, and $B$ are concyclic. Analogously, the points $Q, D, E$, and $C$ are concyclic. Thus $A F \cdot A B=A D \cdot A Q=A E \cdot A C$ and so the points $B, F, E$, and $C$ are also concyclic. ![](https://cdn.mathpix.com/cropped/2024_11_18_7107063274cfa469597ag-60.jpg?height=478&width=1204&top_left_y=732&top_left_x=426) Let $T$ be the intersection of $B C$ and $F E$. Claim. TD $D^{2}=T B \cdot T C=T F \cdot T E$. Proof. We will prove that the circles $(D E F)$ and $(B D C)$ are tangent to each other. Indeed, using the above arguments, we get $$ \begin{aligned} & \angle B D F=\angle A F D-\angle A B D=\left(180^{\circ}-\angle F A D-\angle F D A\right)-(\angle A B C-\angle D B C) \\ = & 180^{\circ}-\angle F A D-\angle A B C=180^{\circ}-\angle D A E-\angle F E A=\angle F E D+\angle A D E=\angle F E D+\angle D C B, \end{aligned} $$ which implies the desired tangency. Since the points $B, C, E$, and $F$ are concyclic, the powers of the point $T$ with respect to the circles $(B D C)$ and $(E D F)$ are equal. So their radical axis, which coincides with the common tangent at $D$, passes through $T$, and hence $T D^{2}=T E \cdot T F=T B \cdot T C$. Solution 1. Let $T A$ intersect the circle $(A B C)$ again at $M$. Due to the circles ( $B C E F$ ) and $(A M C B)$, and using the above Claim, we get $T M \cdot T A=T F \cdot T E=T B \cdot T C=T D^{2}$; in particular, the points $A, M, E$, and $F$ are concyclic. Under the inversion with centre $T$ and radius $T D$, the point $M$ maps to $A$, and $B$ maps to $C$, which implies that the circle $(M B D)$ maps to the circle $(A D C)$. Their common point $D$ lies on the circle of the inversion, so the second intersection point $K$ also lies on that circle, which means $T K=T D$. It follows that the point $T$ and the centres of the circles ( $K D E$ ) and $(A D C)$ lie on the perpendicular bisector of $K D$. Since the center of $(A D C)$ is $O_{1}$, it suffices to show now that the points $D, K, E$, and $X$ are concyclic (the center of the corresponding circle will be $O_{2}$ ). The lines $B M, D K$, and $A C$ are the pairwise radical axes of the circles $(A B C M),(A C D K)$ and $(B M D K)$, so they are concurrent at some point $P$. Also, $M$ lies on the circle $(A E F)$, thus $$ \begin{aligned} \Varangle(E X, X B) & =\Varangle(C X, X B)=\Varangle(X C, B C)+\Varangle(B C, B X)=2 \Varangle(A C, C B) \\ & =\Varangle(A C, C B)+\Varangle(E F, F A)=\Varangle(A M, B M)+\Varangle(E M, M A)=\Varangle(E M, B M), \end{aligned} $$ so the points $M, E, X$, and $B$ are concyclic. Therefore, $P E \cdot P X=P M \cdot P B=P K \cdot P D$, so the points $E, K, D$, and $X$ are concyclic, as desired. ![](https://cdn.mathpix.com/cropped/2024_11_18_7107063274cfa469597ag-61.jpg?height=935&width=1466&top_left_y=195&top_left_x=295) Comment 1. We present here a different solution which uses similar ideas. Perform the inversion $\iota$ with centre $T$ and radius $T D$. It swaps $B$ with $C$ and $E$ with $F$; the point $D$ maps to itself. Let $X^{\prime}=\iota(X)$. Observe that the points $E, F, X$, and $X^{\prime}$ are concyclic, as well as the points $B, C, X$, and $X^{\prime}$. Then $$ \begin{aligned} & \Varangle\left(C X^{\prime}, X^{\prime} F\right)=\Varangle\left(C X^{\prime}, X^{\prime} X\right)+\Varangle\left(X^{\prime} X, X^{\prime} F\right)=\Varangle(C B, B X)+\Varangle(E X, E F) \\ &=\Varangle(X C, C B)+\Varangle(E C, E F)=\Varangle(C A, C B)+\Varangle(B C, B F)=\Varangle(C A, A F), \end{aligned} $$ therefore the points $C, X^{\prime}, A$, and $F$ are concyclic. Let $X^{\prime} F$ intersect $A C$ at $P$, and let $K$ be the second common point of $D P$ and the circle $(A C D)$. Then $$ P K \cdot P D=P A \cdot P C=P X^{\prime} \cdot P F=P E \cdot P X $$ hence, the points $K, X, D$, and $E$ lie on some circle $\omega_{1}$, while the points $K, X^{\prime}, D$, and $F$ lie on some circle $\omega_{2}$. (These circles are distinct since $\angle E X F+\angle E D F<\angle E A F+\angle D C B+\angle D B C<180^{\circ}$ ). The inversion $\iota$ swaps $\omega_{1}$ with $\omega_{2}$ and fixes their common point $D$, so it fixes their second common point $K$. Thus $T D=T K$ and the perpendicular bisector of $D K$ passes through $T$, as well as through the centres of the circles $(C D K A)$ and $(D E K X)$. ![](https://cdn.mathpix.com/cropped/2024_11_18_7107063274cfa469597ag-61.jpg?height=775&width=1154&top_left_y=1994&top_left_x=451) Solution 2. We use only the first part of the Common remarks, namely, the facts that the tuples $(C, D, Q, E)$ and $(B, C, E, F)$ are both concyclic. We also introduce the point $T=$ $B C \cap E F$. Let the circle $(C D E)$ meet $B C$ again at $E_{1}$. Since $\angle E_{1} C Q=\angle D C E$, the $\operatorname{arcs} D E$ and $Q E_{1}$ of the circle $(C D Q)$ are equal, so $D Q \| E E_{1}$. Since $B F E C$ is cyclic, the line $A D$ forms equal angles with $B C$ and $E F$, hence so does $E E_{1}$. Therefore, the triangle $E E_{1} T$ is isosceles, $T E=T E_{1}$, and $T$ lies on the common perpendicular bisector of $E E_{1}$ and $D Q$. Let $U$ and $V$ be the centres of circles $(A D E)$ and $(C D Q E)$, respectively. Then $U O_{1}$ is the perpendicular bisector of $A D$. Moreover, the points $U, V$, and $O_{2}$ belong to the perpendicular bisector of $D E$. Since $U O_{1} \| V T$, in order to show that $O_{1} O_{2}$ passes through $T$, it suffices to show that $$ \frac{O_{2} U}{O_{2} V}=\frac{O_{1} U}{T V} $$ Denote angles $A, B$, and $C$ of the triangle $A B C$ by $\alpha, \beta$, and $\gamma$, respectively. Projecting onto $A C$ we obtain $$ \frac{O_{2} U}{O_{2} V}=\frac{(X E-A E) / 2}{(X E+E C) / 2}=\frac{A X}{C X}=\frac{A X}{B X}=\frac{\sin (\gamma-\beta)}{\sin \alpha} $$ The projection of $O_{1} U$ onto $A C$ is $(A C-A E) / 2=C E / 2$; the angle between $O_{1} U$ and $A C$ is $90^{\circ}-\alpha / 2$, so $$ \frac{O_{1} U}{E C}=\frac{1}{2 \sin (\alpha / 2)} $$ Next, we claim that $E, V, C$, and $T$ are concyclic. Indeed, the point $V$ lies on the perpendicular bisector of $C E$, as well as on the internal angle bisector of $\angle C T F$. Therefore, $V$ coincides with the midpoint of the arc $C E$ of the circle (TCE). Now we have $\angle E V C=2 \angle E E_{1} C=180^{\circ}-(\gamma-\beta)$ and $\angle V E T=\angle V E_{1} T=90^{\circ}-\angle E_{1} E C=$ $90^{\circ}-\alpha / 2$. Therefore, $$ \frac{E C}{T V}=\frac{\sin \angle E T C}{\sin \angle V E T}=\frac{\sin (\gamma-\beta)}{\cos (\alpha / 2)} . $$ ![](https://cdn.mathpix.com/cropped/2024_11_18_7107063274cfa469597ag-62.jpg?height=986&width=1512&top_left_y=1774&top_left_x=266) Recalling (2) and multiplying (3) and (4) we establish (1): $$ \frac{O_{2} U}{O_{2} V}=\frac{\sin (\gamma-\beta)}{\sin \alpha}=\frac{1}{2 \sin (\alpha / 2)} \cdot \frac{\sin (\gamma-\beta)}{\cos (\alpha / 2)}=\frac{O_{1} U}{E C} \cdot \frac{E C}{T V}=\frac{O_{1} U}{T V} $$ Solution 3. Notice that $\angle A Q E=\angle Q C B$ and $\angle A Q F=\angle Q B C$; so, if we replace the point $D$ with $Q$ in the problem set up, the points $E, F$, and $T$ remain the same. So, by the Claim, we have $T Q^{2}=T B \cdot T C=T D^{2}$. Thus, there exists a circle $\Gamma$ centred at $T$ and passing through $D$ and $Q$. We denote the second meeting point of the circles $\Gamma$ and $(A D C)$ by $K$. Let the line $A C$ meet the circle ( $D E K$ ) again at $Y$; we intend to prove that $Y=X$. As in Solution 1, this will yield that the point $T$, as well as the centres $O_{1}$ and $O_{2}$, all lie on the perpendicular bisector of $D K$. Let $L=A D \cap B C$. We perform an inversion centred at $C$; the images of the points will be denoted by primes, e.g., $A^{\prime}$ is the image of $A$. We obtain the following configuration, constructed in a triangle $A^{\prime} C L^{\prime}$. The points $D^{\prime}$ and $Q^{\prime}$ are chosen on the circumcircle $\Omega$ of $A^{\prime} L^{\prime} C$ such that $\Varangle\left(L^{\prime} C, D^{\prime} C\right)=$ $\Varangle\left(Q^{\prime} C, A^{\prime} C\right)$, which means that $A^{\prime} L^{\prime} \| D^{\prime} Q^{\prime}$. The lines $D^{\prime} Q^{\prime}$ and $A^{\prime} C$ meet at $E^{\prime}$. A circle $\Gamma^{\prime}$ centred on $C L^{\prime}$ passes through $D^{\prime}$ and $Q^{\prime}$. Notice here that $B^{\prime}$ lies on the segment $C L^{\prime}$, and that $\angle A^{\prime} B^{\prime} C=\angle B A C=2 \angle L A C=2 \angle A^{\prime} L^{\prime} C$, so that $B^{\prime} L^{\prime}=B^{\prime} A^{\prime}$, and $B^{\prime}$ lies on the perpendicular bisector of $A^{\prime} L^{\prime}$ (which coincides with that of $D^{\prime} Q^{\prime}$ ). All this means that $B^{\prime}$ is the centre of $\Gamma^{\prime}$. Finally, $K^{\prime}$ is the second meeting point of $A^{\prime} D^{\prime}$ and $\Gamma^{\prime}$, and $Y^{\prime}$ is the second meeting point of the circle $\left(D^{\prime} K^{\prime} E^{\prime}\right)$ and the line $A^{\prime} E^{\prime}$, We have $\Varangle\left(Y^{\prime} K^{\prime}, K^{\prime} A^{\prime}\right)=\Varangle\left(Y^{\prime} E^{\prime}, E^{\prime} D^{\prime}\right)=$ $\Varangle\left(Y^{\prime} A^{\prime}, A^{\prime} L^{\prime}\right)$, so $A^{\prime} L^{\prime}$ is tangent to the circumcircle $\omega$ of the triangle $Y^{\prime} A^{\prime} K^{\prime}$. Let $O$ and $O^{*}$ be the centres of $\Omega$ and $\omega$, respectively. Then $O^{*} A^{\prime} \perp A^{\prime} L^{\prime} \perp B^{\prime} O$. The projections of vectors $\overrightarrow{O^{*} A^{\prime}}$ and $\overrightarrow{B^{\prime} O}$ onto $K^{\prime} D^{\prime}$ are equal to $\overrightarrow{K^{\prime} A^{\prime}} / 2=\overrightarrow{K^{\prime} D^{\prime}} / 2-\overrightarrow{A^{\prime} D^{\prime}} / 2$. So $\overrightarrow{O^{*} A^{\prime}}=\overrightarrow{B^{\prime} O}$, or equivalently $\overrightarrow{A^{\prime} O}=\overrightarrow{O^{*} B^{\prime}}$. Projecting this equality onto $A^{\prime} C$, we see that the projection of $\overrightarrow{O^{*} \overrightarrow{B^{\prime}}}$ equals $\overrightarrow{A^{\prime} C} / 2$. Since $O^{*}$ is projected to the midpoint of $A^{\prime} Y^{\prime}$, this yields that $B^{\prime}$ is projected to the midpoint of $C Y^{\prime}$, i.e., $B^{\prime} Y^{\prime}=B^{\prime} C$ and $\angle B^{\prime} Y^{\prime} C=\angle B^{\prime} C Y^{\prime}$. In the original figure, this rewrites as $\angle C B Y=\angle B C Y$, so $Y$ lies on the perpendicular bisector of $B C$, as desired. ![](https://cdn.mathpix.com/cropped/2024_11_18_7107063274cfa469597ag-63.jpg?height=843&width=1306&top_left_y=1783&top_left_x=381) Comment 2. The point $K$ appears to be the same in Solutions 1 and 3 (and Comment 1 as well). One can also show that $K$ lies on the circle passing through $A, X$, and the midpoint of the arc $B A C$. Comment 3. There are different proofs of the facts from the Common remarks, namely, the cyclicity of $B, C, E$, and $F$, and the Claim. We present one such alternative proof here. We perform the composition $\phi$ of a homothety with centre $A$ and the reflection in $A D$, which maps $E$ to $B$. Let $U=\phi(D)$. Then $\Varangle(B C, C D)=\Varangle(A D, D E)=\Varangle(B U, U D)$, so the points $B, U, C$, and $D$ are concyclic. Therefore, $\Varangle(C U, U D)=\Varangle(C B, B D)=\Varangle(A D, D F)$, so $\phi(F)=C$. Then the coefficient of the homothety is $A C / A F=A B / A E$, and thus points $C, E, F$, and $B$ are concyclic. Denote the centres of the circles $(E D F)$ and $(B U C D)$ by $O_{3}$ and $O_{4}$, respectively. Then $\phi\left(O_{3}\right)=$ $O_{4}$, hence $\Varangle\left(O_{3} D, D A\right)=-\Varangle\left(O_{4} U, U A\right)=\Varangle\left(O_{4} D, D A\right)$, whence the circle $(B D C)$ is tangent to the circle ( $E D F$ ). Now, the radical axes of circles $(D E F),(B D C)$ and $(B C E F)$ intersect at $T$, and the claim follows. ![](https://cdn.mathpix.com/cropped/2024_11_18_7107063274cfa469597ag-64.jpg?height=869&width=941&top_left_y=682&top_left_x=563) This suffices for Solution 1 to work. However, Solutions 2 and 3 need properties of point $Q$, established in Common remarks before Solution 1. Comment 4. In the original problem proposal, the point $X$ was hidden. Instead, a circle $\gamma$ was constructed such that $D$ and $E$ lie on $\gamma$, and its center is collinear with $O_{1}$ and $T$. The problem requested to prove that, in a fixed triangle $A B C$, independently from the choice of $D$ on the bisector of $\angle B A C$, all circles $\gamma$ pass through a fixed point. G8. Let $\omega$ be the circumcircle of a triangle $A B C$, and let $\Omega_{A}$ be its excircle which is tangent to the segment $B C$. Let $X$ and $Y$ be the intersection points of $\omega$ and $\Omega_{A}$. Let $P$ and $Q$ be the projections of $A$ onto the tangent lines to $\Omega_{A}$ at $X$ and $Y$, respectively. The tangent line at $P$ to the circumcircle of the triangle $A P X$ intersects the tangent line at $Q$ to the circumcircle of the triangle $A Q Y$ at a point $R$. Prove that $A R \perp B C$. Solution 1. Let $D$ be the point of tangency of $B C$ and $\Omega_{A}$. Let $D^{\prime}$ be the point such that $D D^{\prime}$ is a diameter of $\Omega_{A}$. Let $R^{\prime}$ be (the unique) point such that $A R^{\prime} \perp B C$ and $R^{\prime} D^{\prime} \| B C$. We shall prove that $R^{\prime}$ coincides with $R$. Let $P X$ intersect $A B$ and $D^{\prime} R^{\prime}$ at $S$ and $T$, respectively. Let $U$ be the ideal common point of the parallel lines $B C$ and $D^{\prime} R^{\prime}$. Note that the (degenerate) hexagon $A S X T U C$ is circumscribed around $\Omega_{A}$, hence by the Brianchon theorem $A T, S U$, and $X C$ concur at a point which we denote by $V$. Then $V S \| B C$. It follows that $\Varangle(S V, V X)=\Varangle(B C, C X)=$ $\Varangle(B A, A X)$, hence $A X S V$ is cyclic. Therefore, $\Varangle(P X, X A)=\Varangle(S V, V A)=\Varangle\left(R^{\prime} T, T A\right)$. Since $\angle A P T=\angle A R^{\prime} T=90^{\circ}$, the quadrilateral $A P R^{\prime} T$ is cyclic. Hence, $$ \Varangle(X A, A P)=90^{\circ}-\Varangle(P X, X A)=90^{\circ}-\Varangle\left(R^{\prime} T, T A\right)=\Varangle\left(T A, A R^{\prime}\right)=\Varangle\left(T P, P R^{\prime}\right) . $$ It follows that $P R^{\prime}$ is tangent to the circle $(A P X)$. Analogous argument shows that $Q R^{\prime}$ is tangent to the circle $(A Q Y)$. Therefore, $R=R^{\prime}$ and $A R \perp B C$. ![](https://cdn.mathpix.com/cropped/2024_11_18_7107063274cfa469597ag-65.jpg?height=995&width=1380&top_left_y=1333&top_left_x=349) Comment 1. After showing $\Varangle(P X, X A)=\Varangle\left(R^{\prime} T, T A\right)$ one can finish the solution as follows. There exists a spiral similarity mapping the triangle $A T R^{\prime}$ to the triangle $A X P$. So the triangles $A T X$ and $A R^{\prime} P$ are similar and equioriented. Thus, $\Varangle(T X, X A)=\Varangle\left(R^{\prime} P, P A\right)$, which implies that $P R^{\prime}$ is tangent to the circle ( $A P X$ ). Solution 2. Let $J$ and $r$ be the center and the radius of $\Omega_{A}$. Denote the diameter of $\omega$ by $d$ and its center by $O$. By Euler's formula, $O J^{2}=(d / 2)^{2}+d r$, so the power of $J$ with respect to $\omega$ equals $d r$. Let $J X$ intersect $\omega$ again at $L$. Then $J L=d$. Let $L K$ be a diameter of $\omega$ and let $M$ be the midpoint of $J K$. Since $J L=L K$, we have $\angle L M K=90^{\circ}$, so $M$ lies on $\omega$. Let $R^{\prime}$ be the point such that $R^{\prime} P$ is tangent to the circle $(A P X)$ and $A R^{\prime} \perp B C$. Note that the line $A R^{\prime}$ is symmetric to the line $A O$ with respect to $A J$. ![](https://cdn.mathpix.com/cropped/2024_11_18_7107063274cfa469597ag-66.jpg?height=690&width=1438&top_left_y=406&top_left_x=316) Lemma. Let $M$ be the midpoint of the side $J K$ in a triangle $A J K$. Let $X$ be a point on the circle $(A M K)$ such that $\angle J X K=90^{\circ}$. Then there exists a point $T$ on the line $K X$ such that the triangles $A K J$ and $A J T$ are similar and equioriented. Proof. Note that $M X=M K$. We construct a parallelogram $A J N K$. Let $T$ be a point on $K X$ such that $\Varangle(N J, J A)=\Varangle(K J, J T)$. Then $$ \Varangle(J N, N A)=\Varangle(K A, A M)=\Varangle(K X, X M)=\Varangle(M K, K X)=\Varangle(J K, K T) . $$ So there exists a spiral similarity with center $J$ mapping the triangle $A J N$ to the triangle $T J K$. Therefore, the triangles $N J K$ and $A J T$ are similar and equioriented. It follows that the triangles $A K J$ and $A J T$ are similar and equioriented. ![](https://cdn.mathpix.com/cropped/2024_11_18_7107063274cfa469597ag-66.jpg?height=1155&width=1087&top_left_y=1607&top_left_x=493) Back to the problem, we construct a point $T$ as in the lemma. We perform the composition $\phi$ of inversion with centre $A$ and radius $A J$ and reflection in $A J$. It is known that every triangle $A E F$ is similar and equioriented to $A \phi(F) \phi(E)$. So $\phi(K)=T$ and $\phi(T)=K$. Let $P^{*}=\phi(P)$ and $R^{*}=\phi\left(R^{\prime}\right)$. Observe that $\phi(T K)$ is a circle with diameter $A P^{*}$. Let $A A^{\prime}$ be a diameter of $\omega$. Then $P^{*} K \perp A K \perp A^{\prime} K$, so $A^{\prime}$ lies on $P^{*} K$. The triangles $A R^{\prime} P$ and $A P^{*} R^{*}$ are similar and equioriented, hence $\Varangle\left(A A^{\prime}, A^{\prime} P^{*}\right)=\Varangle\left(A A^{\prime}, A^{\prime} K\right)=\Varangle(A X, X P)=\Varangle(A X, X P)=\Varangle\left(A P, P R^{\prime}\right)=\Varangle\left(A R^{*}, R^{*} P^{*}\right)$, so $A, A^{\prime}, R^{*}$, and $P^{*}$ are concyclic. Since $A^{\prime}$ and $R^{*}$ lie on $A O$, we obtain $R^{*}=A^{\prime}$. So $R^{\prime}=\phi\left(A^{\prime}\right)$, and $\phi\left(A^{\prime}\right) P$ is tangent to the circle $(A P X)$. An identical argument shows that $\phi\left(A^{\prime}\right) Q$ is tangent to the circle $(A Q Y)$. Therefore, $R=$ $\phi\left(A^{\prime}\right)$ and $A R \perp B C$. Comment 2. One of the main ideas of Solution 2 is to get rid of the excircle, along with points $B$ and $C$. After doing so we obtain the following fact, which is, essentially, proved in Solution 2. Let $\omega$ be the circumcircle of a triangle $A K_{1} K_{2}$. Let $J$ be a point such that the midpoints of $J K_{1}$ and $J K_{2}$ lie on $\omega$. Points $X$ and $Y$ are chosen on $\omega$ so that $\angle J X K_{1}=\angle J Y K_{2}=90^{\circ}$. Let $P$ and $Q$ be the projections of $A$ onto $X K_{1}$ and $Y K_{2}$, respectively. The tangent line at $P$ to the circumcircle of the triangle $A P X$ intersects the tangent line at $Q$ to the circumcircle of the triangle $A Q Y$ at a point $R$. Then the reflection of the line $A R$ in $A J$ passes through the centre $O$ of $\omega$. ## Number Theory N1. Determine all integers $n \geqslant 1$ for which there exists a pair of positive integers $(a, b)$ such that no cube of a prime divides $a^{2}+b+3$ and $$ \frac{a b+3 b+8}{a^{2}+b+3}=n $$ Answer: The only integer with that property is $n=2$. Solution. As $b \equiv-a^{2}-3\left(\bmod a^{2}+b+3\right)$, the numerator of the given fraction satisfies $$ a b+3 b+8 \equiv a\left(-a^{2}-3\right)+3\left(-a^{2}-3\right)+8 \equiv-(a+1)^{3} \quad\left(\bmod a^{2}+b+3\right) $$ As $a^{2}+b+3$ is not divisible by $p^{3}$ for any prime $p$, if $a^{2}+b+3$ divides $(a+1)^{3}$ then it does also divide $(a+1)^{2}$. Since $$ 0<(a+1)^{2}<2\left(a^{2}+b+3\right) $$ we conclude $(a+1)^{2}=a^{2}+b+3$. This yields $b=2(a-1)$ and $n=2$. The choice $(a, b)=(2,2)$ with $a^{2}+b+3=9$ shows that $n=2$ indeed is a solution. N2. Let $n \geqslant 100$ be an integer. The numbers $n, n+1, \ldots, 2 n$ are written on $n+1$ cards, one number per card. The cards are shuffled and divided into two piles. Prove that one of the piles contains two cards such that the sum of their numbers is a perfect square. Solution. To solve the problem it suffices to find three squares and three cards with numbers $a, b, c$ on them such that pairwise sums $a+b, b+c, a+c$ are equal to the chosen squares. By choosing the three consecutive squares $(2 k-1)^{2},(2 k)^{2},(2 k+1)^{2}$ we arrive at the triple $$ (a, b, c)=\left(2 k^{2}-4 k, \quad 2 k^{2}+1, \quad 2 k^{2}+4 k\right) $$ We need a value for $k$ such that $$ n \leqslant 2 k^{2}-4 k, \quad \text { and } \quad 2 k^{2}+4 k \leqslant 2 n $$ A concrete $k$ is suitable for all $n$ with $$ n \in\left[k^{2}+2 k, 2 k^{2}-4 k+1\right]=: I_{k} $$ For $k \geqslant 9$ the intervals $I_{k}$ and $I_{k+1}$ overlap because $$ (k+1)^{2}+2(k+1) \leqslant 2 k^{2}-4 k+1 $$ Hence $I_{9} \cup I_{10} \cup \ldots=[99, \infty)$, which proves the statement for $n \geqslant 99$. Comment 1. There exist approaches which only work for sufficiently large $n$. One possible approach is to consider three cards with numbers $70 k^{2}, 99 k^{2}, 126 k^{2}$ on them. Then their pairwise sums are perfect squares and so it suffices to find $k$ such that $70 k^{2} \geqslant n$ and $126 k^{2} \leqslant 2 n$ which exists for sufficiently large $n$. Another approach is to prove, arguing by contradiction, that $a$ and $a-2$ are in the same pile provided that $n$ is large enough and $a$ is sufficiently close to $n$. For that purpose, note that every pair of neighbouring numbers in the sequence $a, x^{2}-a, a+(2 x+1), x^{2}+2 x+3-a, a-2$ adds up to a perfect square for any $x$; so by choosing $x=\lfloor\sqrt{2 a}\rfloor+1$ and assuming that $n$ is large enough we conclude that $a$ and $a-2$ are in the same pile for any $a \in[n+2,3 n / 2]$. This gives a contradiction since it is easy to find two numbers from $[n+2,3 n / 2]$ of the same parity which sum to a square. It then remains to separately cover the cases of small $n$ which appears to be quite technical. Comment 2. An alternative formulation for this problem could ask for a proof of the statement for all $n>10^{6}$. An advantage of this formulation is that some solutions, e.g. those mentioned in Comment 1 need not contain a technical part which deals with the cases of small $n$. However, the original formulation seems to be better because the bound it gives for $n$ is almost sharp, see the next comment for details. Comment 3. The statement of the problem is false for $n=98$. As a counterexample, the first pile may contain the even numbers from 98 to 126 , the odd numbers from 129 to 161 , and the even numbers from 162 to 196. N3. Find all positive integers $n$ with the following property: the $k$ positive divisors of $n$ have a permutation $\left(d_{1}, d_{2}, \ldots, d_{k}\right)$ such that for every $i=1,2, \ldots, k$, the number $d_{1}+\cdots+d_{i}$ is a perfect square. Answer: $n=1$ and $n=3$. Solution. For $i=1,2, \ldots, k$ let $d_{1}+\ldots+d_{i}=s_{i}^{2}$, and define $s_{0}=0$ as well. Obviously $0=s_{0}2 i>d_{i}>d_{i-1}>\ldots>d_{1}$, so $j \leqslant i$ is not possible. The only possibility is $j=i+1$. Hence, $$ \begin{gathered} s_{i+1}+i=d_{i+1}=s_{i+1}^{2}-s_{i}^{2}=s_{i+1}^{2}-i^{2} \\ s_{i+1}^{2}-s_{i+1}=i(i+1) \end{gathered} $$ By solving this equation we get $s_{i+1}=i+1$ and $d_{i+1}=2 i+1$, that finishes the proof. Now we know that the positive divisors of the number $n$ are $1,3,5, \ldots, n-2, n$. The greatest divisor is $d_{k}=2 k-1=n$ itself, so $n$ must be odd. The second greatest divisor is $d_{k-1}=n-2$; then $n-2$ divides $n=(n-2)+2$, so $n-2$ divides 2 . Therefore, $n$ must be 1 or 3 . The numbers $n=1$ and $n=3$ obviously satisfy the requirements: for $n=1$ we have $k=1$ and $d_{1}=1^{2}$; for $n=3$ we have $k=2, d_{1}=1^{2}$ and $d_{1}+d_{2}=1+3=2^{2}$. This page is intentionally left blank N4. Alice is given a rational number $r>1$ and a line with two points $B \neq R$, where point $R$ contains a red bead and point $B$ contains a blue bead. Alice plays a solitaire game by performing a sequence of moves. In every move, she chooses a (not necessarily positive) integer $k$, and a bead to move. If that bead is placed at point $X$, and the other bead is placed at $Y$, then Alice moves the chosen bead to point $X^{\prime}$ with $\overrightarrow{Y X^{\prime}}=r^{k} \overrightarrow{Y X}$. Alice's goal is to move the red bead to the point $B$. Find all rational numbers $r>1$ such that Alice can reach her goal in at most 2021 moves. Answer: All $r=(b+1) / b$ with $b=1, \ldots, 1010$. Solution. Denote the red and blue beads by $\mathcal{R}$ and $\mathcal{B}$, respectively. Introduce coordinates on the line and identify the points with their coordinates so that $R=0$ and $B=1$. Then, during the game, the coordinate of $\mathcal{R}$ is always smaller than the coordinate of $\mathcal{B}$. Moreover, the distance between the beads always has the form $r^{\ell}$ with $\ell \in \mathbb{Z}$, since it only multiplies by numbers of this form. Denote the value of the distance after the $m^{\text {th }}$ move by $d_{m}=r^{\alpha_{m}}$, $m=0,1,2, \ldots$ (after the $0^{\text {th }}$ move we have just the initial position, so $\alpha_{0}=0$ ). If some bead is moved in two consecutive moves, then Alice could instead perform a single move (and change the distance from $d_{i}$ directly to $d_{i+2}$ ) which has the same effect as these two moves. So, if Alice can achieve her goal, then she may as well achieve it in fewer (or the same) number of moves by alternating the moves of $\mathcal{B}$ and $\mathcal{R}$. In the sequel, we assume that Alice alternates the moves, and that $\mathcal{R}$ is shifted altogether $t$ times. If $\mathcal{R}$ is shifted in the $m^{\text {th }}$ move, then its coordinate increases by $d_{m}-d_{m+1}$. Therefore, the total increment of $\mathcal{R}$ 's coordinate, which should be 1 , equals $$ \begin{aligned} \text { either } \quad\left(d_{0}-d_{1}\right)+\left(d_{2}-d_{3}\right)+\cdots+\left(d_{2 t-2}-d_{2 t-1}\right) & =1+\sum_{i=1}^{t-1} r^{\alpha_{2 i}}-\sum_{i=1}^{t} r^{\alpha_{2 i-1}}, \\ \text { or } \quad\left(d_{1}-d_{2}\right)+\left(d_{3}-d_{4}\right)+\cdots+\left(d_{2 t-1}-d_{2 t}\right) & =\sum_{i=1}^{t} r^{\alpha_{2 i-1}}-\sum_{i=1}^{t} r^{\alpha_{2 i}}, \end{aligned} $$ depending on whether $\mathcal{R}$ or $\mathcal{B}$ is shifted in the first move. Moreover, in the former case we should have $t \leqslant 1011$, while in the latter one we need $t \leqslant 1010$. So both cases reduce to an equation $$ \sum_{i=1}^{n} r^{\beta_{i}}=\sum_{i=1}^{n-1} r^{\gamma_{i}}, \quad \beta_{i}, \gamma_{i} \in \mathbb{Z} $$ for some $n \leqslant 1011$. Thus, if Alice can reach her goal, then this equation has a solution for $n=1011$ (we can add equal terms to both sums in order to increase $n$ ). Conversely, if (1) has a solution for $n=1011$, then Alice can compose a corresponding sequence of distances $d_{0}, d_{1}, d_{2}, \ldots, d_{2021}$ and then realise it by a sequence of moves. So the problem reduces to the solvability of (1) for $n=1011$. Assume that, for some rational $r$, there is a solution of (1). Write $r$ in lowest terms as $r=a / b$. Substitute this into (1), multiply by the common denominator, and collect all terms on the left hand side to get $$ \sum_{i=1}^{2 n-1}(-1)^{i} a^{\mu_{i}} b^{N-\mu_{i}}=0, \quad \mu_{i} \in\{0,1, \ldots, N\} $$ for some $N \geqslant 0$. We assume that there exist indices $j_{-}$and $j_{+}$such that $\mu_{j_{-}}=0$ and $\mu_{j_{+}}=N$. Reducing (2) modulo $a-b$ (so that $a \equiv b$ ), we get $$ 0=\sum_{i=1}^{2 n-1}(-1)^{i} a^{\mu_{i}} b^{N-\mu_{i}} \equiv \sum_{i=1}^{2 n-1}(-1)^{i} b^{\mu_{i}} b^{N-\mu_{i}}=-b^{N} \quad \bmod (a-b) $$ Since $\operatorname{gcd}(a-b, b)=1$, this is possible only if $a-b=1$. Reducing (2) modulo $a+b$ (so that $a \equiv-b$ ), we get $$ 0=\sum_{i=1}^{2 n-1}(-1)^{i} a^{\mu_{i}} b^{N-\mu_{i}} \equiv \sum_{i=1}^{2 n-1}(-1)^{i}(-1)^{\mu_{i}} b^{\mu_{i}} b^{N-\mu_{i}}=S b^{N} \quad \bmod (a+b) $$ for some odd (thus nonzero) $S$ with $|S| \leqslant 2 n-1$. Since $\operatorname{gcd}(a+b, b)=1$, this is possible only if $a+b \mid S$. So $a+b \leqslant 2 n-1$, and hence $b=a-1 \leqslant n-1=1010$. Thus we have shown that any sought $r$ has the form indicated in the answer. It remains to show that for any $b=1,2, \ldots, 1010$ and $a=b+1$, Alice can reach the goal. For this purpose, in (1) we put $n=a, \beta_{1}=\beta_{2}=\cdots=\beta_{a}=0$, and $\gamma_{1}=\gamma_{2}=\cdots=\gamma_{b}=1$. Comment 1. Instead of reducing modulo $a+b$, one can reduce modulo $a$ and modulo $b$. The first reduction shows that the number of terms in (2) with $\mu_{i}=0$ is divisible by $a$, while the second shows that the number of terms with $\mu_{i}=N$ is divisible by $b$. Notice that, in fact, $N>0$, as otherwise (2) contains an alternating sum of an odd number of equal terms, which is nonzero. Therefore, all terms listed above have different indices, and there are at least $a+b$ of them. Comment 2. Another way to investigate the solutions of equation (1) is to consider the Laurent polynomial $$ L(x)=\sum_{i=1}^{n} x^{\beta_{i}}-\sum_{i=1}^{n-1} x^{\gamma_{i}} . $$ We can pick a sufficiently large integer $d$ so that $P(x)=x^{d} L(x)$ is a polynomial in $\mathbb{Z}[x]$. Then $$ P(1)=1, $$ and $$ 1 \leqslant|P(-1)| \leqslant 2021 $$ If $r=p / q$ with integers $p>q \geqslant 1$ is a rational number with the properties listed in the problem statement, then $P(p / q)=L(p / q)=0$. As $P(x)$ has integer coefficients, $$ (p-q x) \mid P(x) $$ Plugging $x=1$ into (5) gives $(p-q) \mid P(1)=1$, which implies $p=q+1$. Moreover, plugging $x=-1$ into (5) gives $(p+q) \mid P(-1)$, which, along with (4), implies $p+q \leqslant 2021$ and $q \leqslant 1010$. Hence $x=(q+1) / q$ for some integer $q$ with $1 \leqslant q \leqslant 1010$. N5. Prove that there are only finitely many quadruples $(a, b, c, n)$ of positive integers such that $$ n!=a^{n-1}+b^{n-1}+c^{n-1} . $$ Solution. For fixed $n$ there are clearly finitely many solutions; we will show that there is no solution with $n>100$. So, assume $n>100$. By the AM-GM inequality, $$ \begin{aligned} n! & =2 n(n-1)(n-2)(n-3) \cdot(3 \cdot 4 \cdots(n-4)) \\ & \leqslant 2(n-1)^{4}\left(\frac{3+\cdots+(n-4)}{n-6}\right)^{n-6}=2(n-1)^{4}\left(\frac{n-1}{2}\right)^{n-6}<\left(\frac{n-1}{2}\right)^{n-1} \end{aligned} $$ thus $a, b, c<(n-1) / 2$. For every prime $p$ and integer $m \neq 0$, let $\nu_{p}(m)$ denote the $p$-adic valuation of $m$; that is, the greatest non-negative integer $k$ for which $p^{k}$ divides $m$. Legendre's formula states that $$ \nu_{p}(n!)=\sum_{s=1}^{\infty}\left\lfloor\frac{n}{p^{s}}\right\rfloor $$ and a well-know corollary of this formula is that $$ \nu_{p}(n!)<\sum_{s=1}^{\infty} \frac{n}{p^{s}}=\frac{n}{p-1} $$ If $n$ is odd then $a^{n-1}, b^{n-1}, c^{n-1}$ are squares, and by considering them modulo 4 we conclude that $a, b$ and $c$ must be even. Hence, $2^{n-1} \mid n$ ! but that is impossible for odd $n$ because $\nu_{2}(n!)=\nu_{2}((n-1)!)a+b$. On the other hand, $p \mid c$ implies that $p100$. Comment 1. The original version of the problem asked to find all solutions to the equation. The solution to that version is not much different but is more technical. Comment 2. To find all solutions we can replace the bound $a, b, c<(n-1) / 2$ for all $n$ with a weaker bound $a, b, c \leqslant n / 2$ only for even $n$, which is a trivial application of AM-GM to the tuple $(2,3, \ldots, n)$. Then we may use the same argument for odd $n$ (it works for $n \geqslant 5$ and does not require any bound on $a, b, c)$, and for even $n$ the same solution works for $n \geqslant 6$ unless we have $a+b=n-1$ and $2 \nu_{p}(n-1)=\nu_{p}(n!)$. This is only possible for $p=3$ and $n=10$ in which case we can consider the original equation modulo 7 to deduce that $7 \mid a b c$ which contradicts the fact that $7^{9}>10$ !. Looking at $n \leqslant 4$ we find four solutions, namely, $$ (a, b, c, n)=(1,1,2,3),(1,2,1,3),(2,1,1,3),(2,2,2,4) $$ Comment 3. For sufficiently large $n$, the inequality $a, b, c<(n-1) / 2$ also follows from Stirling's formula. N6. Determine all integers $n \geqslant 2$ with the following property: every $n$ pairwise distinct integers whose sum is not divisible by $n$ can be arranged in some order $a_{1}, a_{2}, \ldots, a_{n}$ so that $n$ divides $1 \cdot a_{1}+2 \cdot a_{2}+\cdots+n \cdot a_{n}$. Answer: All odd integers and all powers of 2. Solution. If $n=2^{k} a$, where $a \geqslant 3$ is odd and $k$ is a positive integer, we can consider a set containing the number $2^{k}+1$ and $n-1$ numbers congruent to 1 modulo $n$. The sum of these numbers is congruent to $2^{k}$ modulo $n$ and therefore is not divisible by $n$; for any permutation $\left(a_{1}, a_{2}, \ldots, a_{n}\right)$ of these numbers $$ 1 \cdot a_{1}+2 \cdot a_{2}+\cdots+n \cdot a_{n} \equiv 1+\cdots+n \equiv 2^{k-1} a\left(2^{k} a+1\right) \not \equiv 0 \quad\left(\bmod 2^{k}\right) $$ and $a$ fortiori $1 \cdot a_{1}+2 \cdot a_{2}+\cdots+n \cdot a_{n}$ is not divisible by $n$. From now on, we suppose that $n$ is either odd or a power of 2 . Let $S$ be the given set of integers, and $s$ be the sum of elements of $S$. Lemma 1. If there is a permutation $\left(a_{i}\right)$ of $S$ such that $(n, s)$ divides $\sum_{i=1}^{n} i a_{i}$, then there is a permutation $\left(b_{i}\right)$ of $S$ such that $n$ divides $\sum_{i=1}^{n} i b_{i}$. Proof. Let $r=\sum_{i=1}^{n} i a_{i}$. Consider the permutation $\left(b_{i}\right)$ defined by $b_{i}=a_{i+x}$, where $a_{j+n}=a_{j}$. For this permutation, we have $$ \sum_{i=1}^{n} i b_{i}=\sum_{i=1}^{n} i a_{i+x} \equiv \sum_{i=1}^{n}(i-x) a_{i} \equiv r-s x \quad(\bmod n) $$ Since $(n, s)$ divides $r$, the congruence $r-s x \equiv 0(\bmod n)$ admits a solution. Lemma 2. Every set $T$ of $k m$ integers, $m>1$, can be partitioned into $m$ sets of $k$ integers so that in every set either the sum of elements is not divisible by $k$ or all the elements leave the same remainder upon division by $k$. Proof. The base case, $m=2$. If $T$ contains $k$ elements leaving the same remainder upon division by $k$, we form one subset $A$ of these elements; the remaining elements form a subset $B$. If $k$ does not divide the sum of all elements of $B$, we are done. Otherwise it is enough to exchange any element of $A$ with any element of $B$ not congruent to it modulo $k$, thus making sums of both $A$ and $B$ not divisible by $k$. This cannot be done only when all the elements of $T$ are congruent modulo $k$; in this case any partition will do. If no $k$ elements of $T$ have the same residue modulo $k$, there are three elements $a, b, c \in T$ leaving pairwise distinct remainders upon division by $k$. Let $t$ be the sum of elements of $T$. It suffices to find $A \subset T$ such that $|A|=k$ and $\sum_{x \in A} x \not \equiv 0, t(\bmod k)$ : then neither the sum of elements of $A$ nor the sum of elements of $B=T \backslash A$ is divisible by $k$. Consider $U^{\prime} \subset T \backslash\{a, b, c\}$ with $\left|U^{\prime}\right|=k-1$. The sums of elements of three sets $U^{\prime} \cup\{a\}, U^{\prime} \cup\{b\}, U^{\prime} \cup\{c\}$ leave three different remainders upon division by $k$, and at least one of them is not congruent either to 0 or to $t$. Now let $m>2$. If $T$ contains $k$ elements leaving the same remainder upon division by $k$, we form one subset $A$ of these elements and apply the inductive hypothesis to the remaining $k(m-1)$ elements. Otherwise, we choose any $U \subset T,|U|=k-1$. Since all the remaining elements cannot be congruent modulo $k$, there is $a \in T \backslash U$ such that $a \not \equiv-\sum_{x \in U} x(\bmod k)$. Now we can take $A=U \cup\{a\}$ and apply the inductive hypothesis to $T \backslash A$. Now we are ready to prove the statement of the problem for all odd $n$ and $n=2^{k}$. The proof is by induction. If $n$ is prime, the statement follows immediately from Lemma 1 , since in this case $(n, s)=1$. Turning to the general case, we can find prime $p$ and an integer $t$ such that $p^{t} \mid n$ and $p^{t} \nmid s$. By Lemma 2, we can partition $S$ into $p$ sets of $\frac{n}{p}=k$ elements so that in every set either the sum of numbers is not divisible by $k$ or all numbers have the same residue modulo $k$. For sets in the first category, by the inductive hypothesis there is a permutation $\left(a_{i}\right)$ such that $k \mid \sum_{i=1}^{k} i a_{i}$. If $n$ (and therefore $k$ ) is odd, then for each permutation $\left(b_{i}\right)$ of a set in the second category we have $$ \sum_{i=1}^{k} i b_{i} \equiv b_{1} \frac{k(k+1)}{2} \equiv 0 \quad(\bmod k) $$ By combining such permutation for all sets of the partition, we get a permutation ( $c_{i}$ ) of $S$ such that $k \mid \sum_{i=1}^{n} i c_{i}$. Since this sum is divisible by $k$, and $k$ is divisible by $(n, s)$, we are done by Lemma 1 . If $n=2^{s}$, we have $p=2$ and $k=2^{s-1}$. Then for each of the subsets there is a permutation $\left(a_{1}, \ldots, a_{k}\right)$ such that $\sum_{i=1}^{k} i a_{i}$ is divisible by $2^{s-2}=\frac{k}{2}$ : if the subset belongs to the first category, the expression is divisible even by $k$, and if it belongs to the second one, $$ \sum_{i=1}^{k} i a_{i} \equiv a_{1} \frac{k(k+1)}{2} \equiv 0\left(\bmod \frac{k}{2}\right) $$ Now the numbers of each permutation should be multiplied by all the odd or all the even numbers not exceeding $n$ in increasing order so that the resulting sums are divisible by $k$ : $$ \sum_{i=1}^{k}(2 i-1) a_{i} \equiv \sum_{i=1}^{k} 2 i a_{i} \equiv 2 \sum_{i=1}^{k} i a_{i} \equiv 0 \quad(\bmod k) $$ Combining these two sums, we again get a permutation $\left(c_{i}\right)$ of $S$ such that $k \mid \sum_{i=1}^{n} i c_{i}$, and finish the case by applying Lemma 1. Comment. We cannot dispense with the condition that $n$ does not divide the sum of all elements. Indeed, for each $n>1$ and the set consisting of $1,-1$, and $n-2$ elements divisible by $n$ the required permutation does not exist. N7. Let $a_{1}, a_{2}, a_{3}, \ldots$ be an infinite sequence of positive integers such that $a_{n+2 m}$ divides $a_{n}+a_{n+m}$ for all positive integers $n$ and $m$. Prove that this sequence is eventually periodic, i.e. there exist positive integers $N$ and $d$ such that $a_{n}=a_{n+d}$ for all $n>N$. Solution. We will make repeated use of the following simple observation: Lemma 1. If a positive integer $d$ divides $a_{n}$ and $a_{n-m}$ for some $m$ and $n>2 m$, it also divides $a_{n-2 m}$. If $d$ divides $a_{n}$ and $a_{n-2 m}$, it also divides $a_{n-m}$. Proof. Both parts are obvious since $a_{n}$ divides $a_{n-2 m}+a_{n-m}$. Claim. The sequence $\left(a_{n}\right)$ is bounded. Proof. Suppose the contrary. Then there exist infinitely many indices $n$ such that $a_{n}$ is greater than each of the previous terms $a_{1}, a_{2}, \ldots, a_{n-1}$. Let $a_{n}=k$ be such a term, $n>10$. For each $s<\frac{n}{2}$ the number $a_{n}=k$ divides $a_{n-s}+a_{n-2 s}<2 k$, therefore $$ a_{n-s}+a_{n-2 s}=k $$ In particular, $$ a_{n}=a_{n-1}+a_{n-2}=a_{n-2}+a_{n-4}=a_{n-4}+a_{n-8} $$ that is, $a_{n-1}=a_{n-4}$ and $a_{n-2}=a_{n-8}$. It follows from Lemma 1 that $a_{n-1}$ divides $a_{n-1-3 s}$ for $3 sN$, then $a_{j}=t$ for infinitely many $j$. Clearly the sequence $\left(a_{n+N}\right)_{n>0}$ satisfies the divisibility condition, and it is enough to prove that this sequence is eventually periodic. Thus truncating the sequence if necessary, we can assume that each number appears infinitely many times in the sequence. Let $k$ be the maximum number appearing in the sequence. Lemma 2. If a positive integer $d$ divides $a_{n}$ for some $n$, then the numbers $i$ such that $d$ divides $a_{i}$ form an arithmetical progression with an odd difference. Proof. Let $i_{1}\frac{k}{2}$, it follows from Lemma 1 that $a_{n-1}$ divides $a_{n-1-3 s}$ when $3 s\frac{k}{2}$, all the terms $a_{n-2-6 s}$ with $6 s1$. We can choose $s$ so that $a_{3 s+3}=k$. Therefore $T$, which we already know to be odd and divisible by 3 , is greater than 3 , that is, at least 9 . Then $a_{3 s-3} \neq k$, and the only other possibility is $a_{3 s-3}=k / 3$. However, $a_{3 s+3}=k$ must divide $a_{3 s}+a_{3 s-3}=2 k / 3$, which is impossible. We have proved then that $a_{3 s}=k$ for all $s>1$, which is the case (ii). N8. For a polynomial $P(x)$ with integer coefficients let $P^{1}(x)=P(x)$ and $P^{k+1}(x)=$ $P\left(P^{k}(x)\right)$ for $k \geqslant 1$. Find all positive integers $n$ for which there exists a polynomial $P(x)$ with integer coefficients such that for every integer $m \geqslant 1$, the numbers $P^{m}(1), \ldots, P^{m}(n)$ leave exactly $\left\lceil n / 2^{m}\right\rceil$ distinct remainders when divided by $n$. Answer: All powers of 2 and all primes. Solution. Denote the set of residues modulo $\ell$ by $\mathbb{Z}_{\ell}$. Observe that $P$ can be regarded as a function $\mathbb{Z}_{\ell} \rightarrow \mathbb{Z}_{\ell}$ for any positive integer $\ell$. Denote the cardinality of the set $P^{m}\left(\mathbb{Z}_{\ell}\right)$ by $f_{m, \ell}$. Note that $f_{m, n}=\left\lceil n / 2^{m}\right\rceil$ for all $m \geqslant 1$ if and only if $f_{m+1, n}=\left\lceil f_{m, n} / 2\right\rceil$ for all $m \geqslant 0$. Part 1. The required polynomial exists when $n$ is a power of 2 or a prime. If $n$ is a power of 2 , set $P(x)=2 x$. If $n=p$ is an odd prime, every function $f: \mathbb{Z}_{p} \rightarrow \mathbb{Z}_{p}$ coincides with some polynomial with integer coefficients. So we can pick the function that sends $x \in\{0,1, \ldots, p-1\}$ to $\lfloor x / 2\rfloor$. Part 2. The required polynomial does not exist when $n$ is not a prime power. Let $n=a b$ where $a, b>1$ and $\operatorname{gcd}(a, b)=1$. Note that, since $\operatorname{gcd}(a, b)=1$, $$ f_{m, a b}=f_{m, a} f_{m, b} $$ by the Chinese remainder theorem. Also, note that, if $f_{m, \ell}=f_{m+1, \ell}$, then $P$ permutes the image of $P^{m}$ on $\mathbb{Z}_{\ell}$, and therefore $f_{s, \ell}=f_{m, \ell}$ for all $s>m$. So, as $f_{m, a b}=1$ for sufficiently large $m$, we have for each $m$ $$ f_{m, a}>f_{m+1, a} \quad \text { or } \quad f_{m, a}=1, \quad f_{m, b}>f_{m+1, b} \quad \text { or } \quad f_{m, b}=1 . $$ Choose the smallest $m$ such that $f_{m+1, a}=1$ or $f_{m+1, b}=1$. Without loss of generality assume that $f_{m+1, a}=1$. Then $f_{m+1, a b}=f_{m+1, b}1$. Let us choose the smallest $k$ for which this is so. To each residue in $P\left(S_{r}\right)$ we assign its residue modulo $p^{k-1}$; denote the resulting set by $\bar{P}(S, r)$. We have $|\bar{P}(S, r)|=p^{k-2}$ by virtue of minimality of $k$. Then $\left|P\left(S_{r}\right)\right|