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}$. Common remarks. We introduce some objects and establish some preliminary facts common for all solutions below.  Let $\Omega$ denote the circle $(A B C D)$, and let $\gamma_{B}$ and $\gamma_{D}$ denote the two circles from the problem statement (their centres are $O_{B}$ and $O_{D}$, respectively). Clearly, all three centres $O, O_{B}$, and $O_{D}$ are distinct.  Assume, without loss of generality, that $A B>B 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<C D$.  Let $\gamma_{B}$ and $\gamma_{D}$ meet $\Omega$ again at $T_{B}$ and $T_{D}$, respectively. The common chord $B T_{B}$ of $\Omega$ and $\gamma_{B}$ is perpendicular to their line of centres $O_{B} O$; likewise, $D T_{D} \perp O_{D} O$. Therefore, $O \in O_{B} O_{D} \Longleftrightarrow O_{B} O\left\|O_{D} O \Longleftrightarrow B T_{B}\right\|$ $D T_{D}$, and the problem reduces to showing that ![](https://cdn.mathpix.com/cropped/2024_11_18_7107063274cfa469597ag-52.jpg?height=429&width=495&top_left_y=819&top_left_x=1383)  $$ B T_{B} \| D T_{D} $$  Comment 1. It seems that the discussion of the positions of points is necessary for both Solutions below. However, this part automatically follows from the angle chasing in Comment 2.

Solution: Let the diagonals $A C$ and $B D$ cross at $H$. Consider the homothety $h$ centred at $H$ and mapping $B$ to $D$. Since $B D_{1} \| D B_{1}$, we have $h\left(D_{1}\right)=B_{1}$.  Let the tangents to $\Omega$ at $B$ and $D$ meet $A C$ at $L_{B}$ and $L_{D}$, respectively. We have  $$ \angle L_{B} B B_{1}=\angle L_{B} B C+\angle C B B_{1}=\angle B A L_{B}+\angle B_{1} B A=\angle B B_{1} L_{B}, $$  which means that the triangle $L_{B} B B_{1}$ is isosceles, $L_{B} B=L_{B} B_{1}$. The powers of $L_{B}$ with respect to $\Omega$ and $\gamma_{D}$ are $L_{B} B^{2}$ and $L_{B} B_{1}^{2}$, respectively; so they are equal, whence $L_{B}$ lies on the radical axis $T_{D} D$ of those two circles. Similarly, $L_{D}$ lies on the radical axis $T_{B} B$ of $\Omega$ and $\gamma_{B}$.  By the sine rule in the triangle $B H L_{B}$, we obtain  $$ \frac{H L_{B}}{\sin \angle H B L_{B}}=\frac{B L_{B}}{\sin \angle B H L_{B}}=\frac{B_{1} L_{B}}{\sin \angle B H L_{B}} $$  similarly,  $$ \frac{H L_{D}}{\sin \angle H D L_{D}}=\frac{D L_{D}}{\sin \angle D H L_{D}}=\frac{D_{1} L_{D}}{\sin \angle D H L_{D}} $$  Clearly, $\angle B H L_{B}=\angle D H L_{D}$. In the circle $\Omega$, tangent lines $B L_{B}$ and $D L_{D}$ form equal angles with the chord $B D$, so $\sin \angle H B L_{B}=\sin \angle H D L_{D}$ (this equality does not depend on the picture). Thus, dividing (2) by (3) we get  $$ \frac{H L_{B}}{H L_{D}}=\frac{B_{1} L_{B}}{D_{1} L_{D}}, \quad \text { and hence } \quad \frac{H L_{B}}{H L_{D}}=\frac{H L_{B}-B_{1} L_{B}}{H L_{D}-D_{1} L_{D}}=\frac{H B_{1}}{H D_{1}} $$  Since $h\left(D_{1}\right)=B_{1}$, the obtained relation yields $h\left(L_{D}\right)=L_{B}$, so $h$ maps the line $L_{D} B$ to $L_{B} D$, and these lines are parallel, as desired. ![](https://cdn.mathpix.com/cropped/2024_11_18_7107063274cfa469597ag-53.jpg?height=843&width=1477&top_left_y=204&top_left_x=292)  Comment 2. In the solution above, the key relation $h\left(L_{D}\right)=L_{B}$ was obtained via a short computation in sines. Here we present an alternative, pure synthetical way of establishing that.  Let the external bisectors of $\angle A B C$ and $\angle A D C$ cross $A C$ at $B_{2}$ and $D_{2}$, respectively; assume that $\overparen{A B}>\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: 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.


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}<A_{\ell} A_{\ell+1}+A_{\ell+1} A_{\ell+2}+\ldots+A_{2 k} A_{0}=2 k+1-\ell \leqslant \ell-1 $$  which gives a contradiction. Therefore, there exists a vertex $A_{m}$ of $A_{0} A_{1} \ldots A_{\ell}$ which lies outside $A_{0} Y Z A_{\ell}$. Since  $$ \angle A_{\ell} A_{0} A_{1}<60^{\circ}=\angle A_{\ell} A_{0} Y \quad \text { and } \quad A_{\ell-1} A_{\ell} A_{0}<60^{\circ}=\angle Z A_{\ell} A_{0} $$  the distance between $A_{m}$ and $A_{0} A_{\ell}$ is at least $\sqrt{3} / 2$. Let $P$ be the projection of $A_{m}$ to $A_{0} A_{\ell}$. Then $P A_{m} \geqslant \sqrt{3} / 2$, and by (1) we have $A_{0} P>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 $1<m<\ell-1$. Then $\angle A_{0} A_{m-1} A_{m}>120^{\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_{0} P+1 / 2 $$  ![](https://cdn.mathpix.com/cropped/2024_11_18_7107063274cfa469597ag-57.jpg?height=358&width=1558&top_left_y=1232&top_left_x=249)  There exists a point $C$ on the segment $A_{0} P$ such that $\angle A_{m-1} C P=60^{\circ}$. Construct a parallelogram $A_{0} C A_{m-1} K$. Then the polyline $A_{0} A_{1} \ldots A_{m-1}$ is contained in the triangle $A_{m-1} K A_{0}$, so  $$ A_{0} A_{1}+A_{1} A_{2}+\ldots+A_{m-2} A_{m-1}+A_{m-1} A_{m} \leqslant A_{0} K+K A_{m-1}+A_{m-1} A_{m}=A_{0} C+C A_{m-1}+1 $$  To prove (2), it suffices to show that $C A_{m-1}<C P-1 / 2$. Let the line through $B$ parallel to $C P$ intersect the rays $A_{m-1} C$ and $A_{m} P$ at $D$ and $T$, respectively. It is easy to see that the desired inequality will follow from $D A_{m-1} \leqslant D T-1 / 2$.  Two possible arrangements of points are shown in the figures below. Observe that $\angle D A_{m-1} B \geqslant 60^{\circ}$, so there is a point $M$ on the segment $D B$ such that the triangle $D M A_{m-1}$ is equilateral. Then $\angle A_{m-1} M D=60^{\circ}=\angle A_{m-1} A_{m} B$, so $A_{m-1} M B A_{m}$ is a cyclic quadrilateral. Therefore, $\angle A_{m} M B=60^{\circ}$. Thus, $T$ lies on the ray $M B$ and we have to show that $M T \geqslant 1 / 2$. Indeed, $M T=A_{m} M / 2$ and $A_{m} M \geqslant A_{m} B=1$. This completes the proof of the inequality (2). ![](https://cdn.mathpix.com/cropped/2024_11_18_7107063274cfa469597ag-57.jpg?height=603&width=1490&top_left_y=2160&top_left_x=291)  Similarly, either there exists an equilateral triangle $A_{m} A_{m+1} B^{\prime}$ contained in $A_{0} A_{1} \ldots A_{\ell}$, or  $$ A_{m} A_{m+1}+A_{m+1} A_{m+2}+\ldots+A_{\ell-1} A_{\ell}<A_{\ell} P+1 / 2 $$  Adding (2) and (3) yields $A_{0} A_{1}+A_{1} A_{2}+\ldots+A_{\ell-1} A_{\ell}<A_{0} A_{\ell}+1$, which gives a contradiction.  This page is intentionally left blank


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.  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: 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: 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: 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.


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.


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}<s_{1}<s_{2}<\ldots<s_{k}$, so  $$ s_{i} \geqslant i \quad \text { and } \quad d_{i}=s_{i}^{2}-s_{i-1}^{2}=\left(s_{i}+s_{i-1}\right)\left(s_{i}-s_{i-1}\right) \geqslant s_{i}+s_{i-1} \geqslant 2 i-1 $$  The number 1 is one of the divisors $d_{1}, \ldots, d_{k}$ but, due to $d_{i} \geqslant 2 i-1$, the only possibility is $d_{1}=1$.  Now consider $d_{2}$ and $s_{2} \geqslant 2$. By definition, $d_{2}=s_{2}^{2}-1=\left(s_{2}-1\right)\left(s_{2}+1\right)$, so the numbers $s_{2}-1$ and $s_{2}+1$ are divisors of $n$. In particular, there is some index $j$ such that $d_{j}=s_{2}+1$.  Notice that  $$ s_{2}+s_{1}=s_{2}+1=d_{j} \geqslant s_{j}+s_{j-1} $$  since the sequence $s_{0}<s_{1}<\ldots<s_{k}$ increases, the index $j$ cannot be greater than 2 . Hence, the divisors $s_{2}-1$ and $s_{2}+1$ are listed among $d_{1}$ and $d_{2}$. That means $s_{2}-1=d_{1}=1$ and $s_{2}+1=d_{2}$; therefore $s_{2}=2$ and $d_{2}=3$.  We can repeat the above process in general. Claim. $d_{i}=2 i-1$ and $s_{i}=i$ for $i=1,2, \ldots, k$. Proof. Apply induction on $i$. The Claim has been proved for $i=1,2$. Suppose that we have already proved $d=1, d_{2}=3, \ldots, d_{i}=2 i-1$, and consider the next divisor $d_{i+1}$ :  $$ d_{i+1}=s_{i+1}^{2}-s_{i}^{2}=s_{i+1}^{2}-i^{2}=\left(s_{i+1}-i\right)\left(s_{i+1}+i\right) $$  The number $s_{i+1}+i$ is a divisor of $n$, so there is some index $j$ such that $d_{j}=s_{i+1}+i$. Similarly to (2), by (1) we have  $$ s_{i+1}+s_{i}=s_{i+1}+i=d_{j} \geqslant s_{j}+s_{j-1} $$  since the sequence $s_{0}<s_{1}<\ldots<s_{k}$ increases, (3) forces $j \leqslant i+1$. On the other hand, $d_{j}=s_{i+1}+i>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


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$.


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.


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}<f_{m, b} \leqslant f_{m, a b} / 2 \leqslant f_{m+1, a b}$, a contradiction.  Part 3. The required polynomial does not exist when $n$ is an odd prime power that is not a prime.  Let $n=p^{k}$, where $p \geqslant 3$ is prime and $k \geqslant 2$. For $r \in \mathbb{Z}_{p}$ let $S_{r}$ denote the subset of $\mathbb{Z}_{p^{k}}$ consisting of numbers congruent to $r$ modulo $p$. We denote the cardinality of a set $S$ by $|S|$. Claim. For any residue $r$ modulo $p$, either $\left|P\left(S_{r}\right)\right|=p^{k-1}$ or $\left|P\left(S_{r}\right)\right| \leqslant p^{k-2}$. Proof. Recall that $P(r+h)=P(r)+h P^{\prime}(r)+h^{2} Q(r, h)$, where $Q$ is an integer polynomial. If $p \mid P^{\prime}(r)$, then $P(r+p s) \equiv P(r)\left(\bmod p^{2}\right)$, hence all elements of $P\left(S_{r}\right)$ are congruent modulo $p^{2}$. So in this case $\left|P\left(S_{r}\right)\right| \leqslant p^{k-2}$.  Now we show that $p \nmid P^{\prime}(r)$ implies $\left|P\left(S_{r}\right)\right|=p^{k-1}$ for all $k$. Suppose the contrary: $\left|P\left(S_{r}\right)\right|<p^{k-1}$ for some $k>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|<p^{k-1}=p \cdot|\bar{P}(S, r)|$, that is, there is $u=P(x) \in P\left(S_{r}\right)(x \equiv r(\bmod p))$ and $t \not \equiv 0$ $(\bmod p)$ such that $u+p^{k-1} t \notin P\left(S_{r}\right)$.  Note that $P\left(x+p^{k-1} s\right) \equiv u+p^{k-1} s P^{\prime}(x)\left(\bmod p^{k}\right)$. Since $P\left(x+p^{k-1} s\right) \not \equiv u+p^{k-1} t$ $\left(\bmod p^{k}\right)$, the congruence $p^{k-1} s P^{\prime}(x) \equiv p^{k-1} t\left(\bmod p^{k}\right)$ has no solutions. So the congruence $s P^{\prime}(x) \equiv t(\bmod p)$ has no solutions, which contradicts $p \nmid P^{\prime}(r)$.  Since the image of $P^{m}$ consists of one element for sufficiently large $m$, we can take the smallest $m$ such that $\left|P^{m-1}\left(S_{r}\right)\right|=p^{k-1}$ for some $r \in \mathbb{Z}_{p}$, but $\left|P^{m}\left(S_{q}\right)\right| \leqslant p^{k-2}$ for all $q \in \mathbb{Z}_{p}$.  From now on, we fix $m$ and $r$. Since the image of $P^{m-1}\left(\mathbb{Z}_{p^{k}}\right) \backslash P^{m-1}\left(S_{r}\right)$ under $P$ contains $P^{m}\left(\mathbb{Z}_{p^{k}}\right) \backslash P^{m}\left(S_{r}\right)$, we have  $$ a:=\left|P^{m}\left(\mathbb{Z}_{p^{k}}\right) \backslash P^{m}\left(S_{r}\right)\right| \leqslant\left|P^{m-1}\left(\mathbb{Z}_{p^{k}}\right) \backslash P^{m-1}\left(S_{r}\right)\right|, $$  thus  $$ a+p^{k-1} \leqslant f_{m-1, p^{k}} \leqslant 2 f_{m, p^{k}} \leqslant 2 p^{k-2}+2 a, $$  so  $$ (p-2) p^{k-2} \leqslant a $$  Since $f_{i, p}=1$ for sufficiently large $i$, there is exactly one $t \in \mathbb{Z}_{p}$ such that $P(t) \equiv t(\bmod p)$. Moreover, as $i$ increases, the cardinality of the set $\left\{s \in \mathbb{Z}_{p} \mid P^{i}(s) \equiv t(\bmod p)\right\}$ increases (strictly), until it reaches the value $p$. So either  $$ \left|\left\{s \in \mathbb{Z}_{p} \mid P^{m-1}(s) \equiv t \quad(\bmod p)\right\}\right|=p \quad \text { or } \quad\left|\left\{s \in \mathbb{Z}_{p} \mid P^{m-1}(s) \equiv t \quad(\bmod p)\right\}\right| \geqslant m $$  Therefore, either $f_{m-1, p}=1$ or there exists a subset $X \subset \mathbb{Z}_{p}$ of cardinality at least $m$ such that $P^{m-1}(x) \equiv t(\bmod p)$ for all $x \in X$.  In the first case $\left|P^{m-1}\left(\mathbb{Z}_{p^{k}}\right)\right| \leqslant p^{k-1}=\left|P^{m-1}\left(S_{r}\right)\right|$, so $a=0$, a contradiction. In the second case let $Y$ be the set of all elements of $\mathbb{Z}_{p^{k}}$ congruent to some element of $X$ modulo $p$. Let $Z=\mathbb{Z}_{p^{k}} \backslash Y$. Then $P^{m-1}(Y) \subset S_{t}, P\left(S_{t}\right) \subsetneq S_{t}$, and $Z=\bigcup_{i \in \mathbb{Z}_{p} \backslash X} S_{i}$, so  $$ \left|P^{m}(Y)\right| \leqslant\left|P\left(S_{t}\right)\right| \leqslant p^{k-2} \quad \text { and } \quad\left|P^{m}(Z)\right| \leqslant\left|\mathbb{Z}_{p} \backslash X\right| \cdot p^{k-2} \leqslant(p-m) p^{k-2} $$  Hence,  $$ (p-2) p^{k-2} \leqslant a<\left|P^{m}\left(\mathbb{Z}_{p^{k}}\right)\right| \leqslant\left|P^{m}(Y)\right|+\left|P^{m}(Z)\right| \leqslant(p-m+1) p^{k-2} $$  and $m<3$. Then $\left|P^{2}\left(S_{q}\right)\right| \leqslant p^{k-2}$ for all $q \in \mathbb{Z}_{p}$, so  $$ p^{k} / 4 \leqslant\left|P^{2}\left(\mathbb{Z}_{p^{k}}\right)\right| \leqslant p^{k-1} $$  which is impossible for $p \geqslant 5$. It remains to consider the case $p=3$. As before, let $t$ be the only residue modulo 3 such that $P(t) \equiv t(\bmod 3)$. If $3 \nmid P^{\prime}(t)$, then $P\left(S_{t}\right)=S_{t}$ by the proof of the Claim above, which is impossible. So $3 \mid P^{\prime}(t)$. By substituting $h=3^{i} s$ into the formula $P(t+h)=P(t)+h P^{\prime}(t)+h^{2} Q(t, h)$, we obtain $P\left(t+3^{i} s\right) \equiv P(t)\left(\bmod 3^{i+1}\right)$. Using induction on $i$ we see that all elements of $P^{i}\left(S_{t}\right)$ are congruent modulo $3^{i+1}$. Thus, $\left|P^{k-1}\left(S_{t}\right)\right|=1$.  Note that $f_{1,3} \leqslant 2$ and $f_{2,3} \leqslant 1$, so $P^{2}\left(\mathbb{Z}_{3^{k}}\right) \subset S_{t}$. Therefore, $\left|P^{k+1}\left(\mathbb{Z}_{3^{k}}\right)\right| \leqslant\left|P^{k-1}\left(S_{t}\right)\right|=1$. It follows that $3^{k} \leqslant 2^{k+1}$, which is impossible for $k \geqslant 2$.  Comment. Here is an alternative version of the problem. A function $f: \mathbb{Z} \rightarrow \mathbb{Z}$ is chosen so that $a-b \mid f(a)-f(b)$ for all $a, b \in \mathbb{Z}$ with $a \neq b$. Let $S_{0}=\mathbb{Z}$, and for each positive integer $m$, let $S_{m}$ denote the image of $f$ on the set $S_{m-1}$. It is given that, for each nonnegative integer $m$, there are exactly $\left\lceil n / 2^{m}\right\rceil$ distinct residues modulo $n$ in the set $S_{m}$. Find all possible values of $n$.  Answer: All powers of primes.


Solution: Observe that $f$ can be regarded as a function $\mathbb{Z}_{\ell} \rightarrow \mathbb{Z}_{\ell}$ for any positive integer $\ell$. We use notations $f^{m}$ and $f_{m, \ell}$ as in the above solution.  Part 1. There exists a function $f: \mathbb{Z}_{p^{k}} \rightarrow \mathbb{Z}_{p^{k}}$ satisfying the desired properties. For $x \in \mathbb{Z}_{p^{k}}$, let $\operatorname{rev}(x)$ denote the reversal of the base- $p$ digits of $x$ (we write every $x \in \mathbb{Z}_{p^{k}}$ with exactly $k$ digits, adding zeroes at the beginning if necessary). Choose  $$ f(x)=\operatorname{rev}\left(\left\lfloor\frac{\operatorname{rev}(x)}{2}\right\rfloor\right) $$  where, for dividing by $2, \operatorname{rev}(x)$ is interpreted as an integer in the range $\left[0, p^{k}\right)$. It is easy to see that $f_{m+1, k}=\left\lceil f_{m, k} / 2\right\rceil$.  We claim that if $a, b \in \mathbb{Z}_{p^{k}}$ so that $p^{m} \mid a-b$, then $p^{m} \mid f(a)-f(b)$. Let $x=\operatorname{rev}(a), y=\operatorname{rev}(b)$. The first $m$ digits of $x$ and $y$ are the same, i.e $\left\lfloor x / p^{m-k}\right\rfloor=\left\lfloor y / p^{m-k}\right\rfloor$. For every positive integers $c, d$ and $z$ we have $\lfloor\lfloor z / c\rfloor / d\rfloor=\lfloor z /(c d)\rfloor=\lfloor\lfloor z / d\rfloor / c\rfloor$, so  $$ \left\lfloor\lfloor x / 2\rfloor / p^{m-k}\right\rfloor=\left\lfloor\left\lfloor x / p^{m-k}\right\rfloor / 2\right\rfloor=\left\lfloor\left\lfloor y / p^{m-k}\right\rfloor / 2\right\rfloor=\left\lfloor\lfloor y / 2\rfloor / p^{m-k}\right\rfloor . $$  Thus, the first $m$ digits of $\lfloor x / 2\rfloor$ and $\lfloor y / 2\rfloor$ are the same. So the last $m$ digits of $f(a)$ and $f(b)$ are the same, i.e. $p^{m} \mid f(a)-f(b)$.  Part 2. Lifting the function $f: \mathbb{Z}_{p^{k}} \rightarrow \mathbb{Z}_{p^{k}}$ to a function on all of $\mathbb{Z}$. We show that, for any function $f: \mathbb{Z}_{p^{k}} \rightarrow \mathbb{Z}_{p^{k}}$ for which $\operatorname{gcd}\left(p^{k}, a-b\right) \mid f(a)-f(b)$, there is a corresponding function $g: \mathbb{Z} \rightarrow \mathbb{Z}$ for which $a-b \mid g(a)-g(b)$ for all distinct integers $a, b$ and $g(x) \equiv f(x)\left(\bmod p^{k}\right)$ for all $x \in \mathbb{Z}$, whence the proof will be completed. We will construct the values of such a function inductively; assume that we have constructed it for some interval $[a, b)$ and wish to define $g(b)$. (We will define $g(a-1)$ similarly.)  For every prime $q \leqslant|a-b|$, we choose the maximal $\alpha_{q}$ for which there exists $c_{q} \in[a, b)$, such that $b-c_{q} \vdots q^{\alpha_{q}}$, and choose one such $c_{q}$.  We apply Chinese remainder theorem to find $g(b)$ satisfying the following conditions:  $$ \begin{aligned} & g(b) \equiv g\left(c_{q}\right) \quad\left(\bmod q^{\alpha_{q}}\right) \quad \text { for } q \neq p, \quad \text { and } \\ & g(b) \equiv g\left(c_{p}\right) \quad\left(\bmod q^{\alpha_{p}}\right) \quad \text { if } \quad \alpha_{p} \geqslant k, \quad g(b) \equiv f(b) \quad\left(\bmod p^{k}\right) \quad \text { if } \quad \alpha_{p}<k . \end{aligned} $$  It is not hard to verify that $b-c \mid g(b)-g(c)$ for every $c \in[a, b)$ and $g(b) \equiv f(b)\left(\bmod p^{k}\right)$. Part 3. The required function does not exist if $n$ has at least two different prime divisors. The proof is identical to the polynomial version.