Solution: Again, we denote by $\Omega$ the circumcircle of the triangle $A B C$. Choose the points $X$ and $Y$ on the rays $B A$ and $B C$ respectively, so that $\angle M X B=\angle M B C$ and $\angle B Y M=\angle A B M$ (see Figure 4). Then the triangles $B M X$ and $Y M B$ are similar. Since $\angle X P M=\angle B Q M$, the points $P$ and $Q$ correspond to each other in these triangles. So, if $\overrightarrow{B P}=\mu \cdot \overrightarrow{B X}$, then $\overrightarrow{B Q}=(1-\mu) \cdot \overrightarrow{B Y}$. Thus  $$ \overrightarrow{B T}=\overrightarrow{B P}+\overrightarrow{B Q}=\overrightarrow{B Y}+\mu \cdot(\overrightarrow{B X}-\overrightarrow{B Y})=\overrightarrow{B Y}+\mu \cdot \overrightarrow{Y X} $$  which means that $T$ lies on the line $X Y$. Let $B^{\prime} \neq B$ be the point on the ray $B M$ such that $B M=M B^{\prime}$. Then $\angle M B^{\prime} A=$ $\angle M B C=\angle M X B$ and $\angle C B^{\prime} M=\angle A B M=\angle B Y M$. This means that the triangles $B M X$, $B A B^{\prime}, Y M B$, and $B^{\prime} C B$ are all similar; hence $B A \cdot B X=B M \cdot B B^{\prime}=B C \cdot B Y$. Thus there exists an inversion centered at $B$ which swaps $A$ with $X, M$ with $B^{\prime}$, and $C$ with $Y$. This inversion then swaps $\Omega$ with the line $X Y$, and hence it preserves $T$. Therefore, we have $B T^{2}=B M \cdot B B^{\prime}=2 B M^{2}$, and $B T=\sqrt{2} B M$.


Let $A B C$ be an acute triangle, and let $M$ be the midpoint of $A C$. A circle $\omega$ passing through $B$ and $M$ meets the sides $A B$ and $B C$ again at $P$ and $Q$, respectively. Let $T$ be the point such that the quadrilateral $B P T Q$ is a parallelogram. Suppose that $T$ lies on the circumcircle of the triangle $A B C$. Determine all possible values of $B T / B M$. (Russia)

Solution: We begin with the following lemma. Lemma. Let $A B C T$ be a cyclic quadrilateral. Let $P$ and $Q$ be points on the sides $B A$ and $B C$ respectively, such that $B P T Q$ is a parallelogram. Then $B P \cdot B A+B Q \cdot B C=B T^{2}$. Proof. Let the circumcircle of the triangle $Q T C$ meet the line $B T$ again at $J$ (see Figure 5). The power of $B$ with respect to this circle yields  $$ B Q \cdot B C=B J \cdot B T $$  We also have $\angle T J Q=180^{\circ}-\angle Q C T=\angle T A B$ and $\angle Q T J=\angle A B T$, and so the triangles $T J Q$ and $B A T$ are similar. We now have $T J / T Q=B A / B T$. Therefore,  $$ T J \cdot B T=T Q \cdot B A=B P \cdot B A $$  Combining (3) and (4) now yields the desired result. Let $X$ and $Y$ be the midpoints of $B A$ and $B C$ respectively (see Figure 6). Applying the lemma to the cyclic quadrilaterals $P B Q M$ and $A B C T$, we obtain  $$ B X \cdot B P+B Y \cdot B Q=B M^{2} $$  and  $$ B P \cdot B A+B Q \cdot B C=B T^{2} $$  Since $B A=2 B X$ and $B C=2 B Y$, we have $B T^{2}=2 B M^{2}$, and so $B T=\sqrt{2} B M$. ![](https://cdn.mathpix.com/cropped/2024_11_18_62dbd531c72d0ff8164cg-51.jpg?height=789&width=1464&top_left_y=933&top_left_x=296)  Comment 2. Here we give another proof of the lemma using Ptolemy's theorem. We readily have  $$ T C \cdot B A+T A \cdot B C=A C \cdot B T $$  The lemma now follows from  $$ \frac{B P}{T C}=\frac{B Q}{T A}=\frac{B T}{A C}=\frac{\sin \angle B C T}{\sin \angle A B C} $$


Let $A B C$ be a triangle with $C A \neq C B$. Let $D, F$, and $G$ be the midpoints of the sides $A B, A C$, and $B C$, respectively. A circle $\Gamma$ passing through $C$ and tangent to $A B$ at $D$ meets the segments $A F$ and $B G$ at $H$ and $I$, respectively. The points $H^{\prime}$ and $I^{\prime}$ are symmetric to $H$ and $I$ about $F$ and $G$, respectively. The line $H^{\prime} I^{\prime}$ meets $C D$ and $F G$ at $Q$ and $M$, respectively. The line $C M$ meets $\Gamma$ again at $P$. Prove that $C Q=Q P$. (El Salvador)

Solution: We may assume that $C A>C B$. Observe that $H^{\prime}$ and $I^{\prime}$ lie inside the segments $C F$ and $C G$, respectively. Therefore, $M$ lies outside $\triangle A B C$ (see Figure 1).  Due to the powers of points $A$ and $B$ with respect to the circle $\Gamma$, we have  $$ C H^{\prime} \cdot C A=A H \cdot A C=A D^{2}=B D^{2}=B I \cdot B C=C I^{\prime} \cdot C B $$  Therefore, $C H^{\prime} \cdot C F=C I^{\prime} \cdot C G$. Hence, the quadrilateral $H^{\prime} I^{\prime} G F$ is cyclic, and so $\angle I^{\prime} H^{\prime} C=$ $\angle C G F$.  Let $D F$ and $D G$ meet $\Gamma$ again at $R$ and $S$, respectively. We claim that the points $R$ and $S$ lie on the line $H^{\prime} I^{\prime}$.  Observe that $F H^{\prime} \cdot F A=F H \cdot F C=F R \cdot F D$. Thus, the quadrilateral $A D H^{\prime} R$ is cyclic, and hence $\angle R H^{\prime} F=\angle F D A=\angle C G F=\angle I^{\prime} H^{\prime} C$. Therefore, the points $R, H^{\prime}$, and $I^{\prime}$ are collinear. Similarly, the points $S, H^{\prime}$, and $I^{\prime}$ are also collinear, and so all the points $R, H^{\prime}, Q, I^{\prime}, S$, and $M$ are all collinear. ![](https://cdn.mathpix.com/cropped/2024_11_18_62dbd531c72d0ff8164cg-52.jpg?height=689&width=803&top_left_y=1249&top_left_x=204)  Figure 1 ![](https://cdn.mathpix.com/cropped/2024_11_18_62dbd531c72d0ff8164cg-52.jpg?height=684&width=826&top_left_y=1257&top_left_x=1023)  Figure 2  Then, $\angle R S D=\angle R D A=\angle D F G$. Hence, the quadrilateral $R S G F$ is cyclic (see Figure 2). Therefore, $M H^{\prime} \cdot M I^{\prime}=M F \cdot M G=M R \cdot M S=M P \cdot M C$. Thus, the quadrilateral $C P I^{\prime} H^{\prime}$ is also cyclic. Let $\omega$ be its circumcircle.  Notice that $\angle H^{\prime} C Q=\angle S D C=\angle S R C$ and $\angle Q C I^{\prime}=\angle C D R=\angle C S R$. Hence, $\triangle C H^{\prime} Q \sim \triangle R C Q$ and $\triangle C I^{\prime} Q \sim \triangle S C Q$, and therefore $Q H^{\prime} \cdot Q R=Q C^{2}=Q I^{\prime} \cdot Q S$.  We apply the inversion with center $Q$ and radius $Q C$. Observe that the points $R, C$, and $S$ are mapped to $H^{\prime}, C$, and $I^{\prime}$, respectively. Therefore, the circumcircle $\Gamma$ of $\triangle R C S$ is mapped to the circumcircle $\omega$ of $\triangle H^{\prime} C I^{\prime}$. Since $P$ and $C$ belong to both circles and the point $C$ is preserved by the inversion, we have that $P$ is also mapped to itself. We then get $Q P^{2}=Q C^{2}$. Hence, $Q P=Q C$.  Comment 1. The problem statement still holds when $\Gamma$ intersects the sides $C A$ and $C B$ outside segments $A F$ and $B G$, respectively.


Solution: Let $X=H I \cap A B$, and let the tangent to $\Gamma$ at $C$ meet $A B$ at $Y$. Let $X C$ meet $\Gamma$ again at $X^{\prime}$ (see Figure 3). Projecting from $C, X$, and $C$ again, we have $(X, A ; D, B)=$ $\left(X^{\prime}, H ; D, I\right)=(C, I ; D, H)=(Y, B ; D, A)$. Since $A$ and $B$ are symmetric about $D$, it follows that $X$ and $Y$ are also symmetric about $D$.  Now, Menelaus' theorem applied to $\triangle A B C$ with the line $H I X$ yields  $$ 1=\frac{C H}{H A} \cdot \frac{B I}{I C} \cdot \frac{A X}{X B}=\frac{A H^{\prime}}{H^{\prime} C} \cdot \frac{C I^{\prime}}{I^{\prime} B} \cdot \frac{B Y}{Y A} . $$  By the converse of Menelaus' theorem applied to $\triangle A B C$ with points $H^{\prime}, I^{\prime}, Y$, we get that the points $H^{\prime}, I^{\prime}, Y$ are collinear. ![](https://cdn.mathpix.com/cropped/2024_11_18_62dbd531c72d0ff8164cg-53.jpg?height=568&width=1382&top_left_y=744&top_left_x=340)  Figure 3 Let $T$ be the midpoint of $C D$, and let $O$ be the center of $\Gamma$. Let $C M$ meet $T Y$ at $N$. To avoid confusion, we clean some superfluous details out of the picture (see Figure 4).  Let $V=M T \cap C Y$. Since $M T \| Y D$ and $D T=T C$, we get $C V=V Y$. Then CevA's theorem applied to $\triangle C T Y$ with the point $M$ yields  $$ 1=\frac{T Q}{Q C} \cdot \frac{C V}{V Y} \cdot \frac{Y N}{N T}=\frac{T Q}{Q C} \cdot \frac{Y N}{N T} $$  Therefore, $\frac{T Q}{Q C}=\frac{T N}{N Y}$. So, $N Q \| C Y$, and thus $N Q \perp O C$. Note that the points $O, N, T$, and $Y$ are collinear. Therefore, $C Q \perp O N$. So, $Q$ is the orthocenter of $\triangle O C N$, and hence $O Q \perp C P$. Thus, $Q$ lies on the perpendicular bisector of $C P$, and therefore $C Q=Q P$, as required. ![](https://cdn.mathpix.com/cropped/2024_11_18_62dbd531c72d0ff8164cg-53.jpg?height=652&width=866&top_left_y=2027&top_left_x=595)  Figure 4  Comment 2. The second part of Solution 2 provides a proof of the following more general statement, which does not involve a specific choice of $Q$ on $C D$.  Let $Y C$ and $Y D$ be two tangents to a circle $\Gamma$ with center $O$ (see Figure 4). Let $\ell$ be the midline of $\triangle Y C D$ parallel to $Y D$. Let $Q$ and $M$ be two points on $C D$ and $\ell$, respectively, such that the line $Q M$ passes through $Y$. Then $O Q \perp C M$.


Let $A B C$ be an acute triangle with $A B>A C$, and let $\Gamma$ be its circumcircle. Let $H$, $M$, and $F$ be the orthocenter of the triangle, the midpoint of $B C$, and the foot of the altitude from $A$, respectively. Let $Q$ and $K$ be the two points on $\Gamma$ that satisfy $\angle A Q H=90^{\circ}$ and $\angle Q K H=90^{\circ}$. Prove that the circumcircles of the triangles $K Q H$ and $K F M$ are tangent to each other. (Ukraine)

Solution: Let $A^{\prime}$ be the point diametrically opposite to $A$ on $\Gamma$. Since $\angle A Q A^{\prime}=90^{\circ}$ and $\angle A Q H=90^{\circ}$, the points $Q, H$, and $A^{\prime}$ are collinear. Similarly, if $Q^{\prime}$ denotes the point on $\Gamma$ diametrically opposite to $Q$, then $K, H$, and $Q^{\prime}$ are collinear. Let the line $A H F$ intersect $\Gamma$ again at $E$; it is known that $M$ is the midpoint of the segment $H A^{\prime}$ and that $F$ is the midpoint of $H E$. Let $J$ be the midpoint of $H Q^{\prime}$.  Consider any point $T$ such that $T K$ is tangent to the circle $K Q H$ at $K$ with $Q$ and $T$ lying on different sides of $K H$ (see Figure 1). Then $\angle H K T=\angle H Q K$ and we are to prove that $\angle M K T=\angle C F K$. Thus it remains to show that $\angle H Q K=\angle C F K+\angle H K M$. Due to $\angle H Q K=90^{\circ}-\angle Q^{\prime} H A^{\prime}$ and $\angle C F K=90^{\circ}-\angle K F A$, this means the same as $\angle Q^{\prime} H A^{\prime}=$ $\angle K F A-\angle H K M$. Now, since the triangles $K H E$ and $A H Q^{\prime}$ are similar with $F$ and $J$ being the midpoints of corresponding sides, we have $\angle K F A=\angle H J A$, and analogously one may obtain $\angle H K M=\angle J Q H$. Thereby our task is reduced to verifying  $$ \angle Q^{\prime} H A^{\prime}=\angle H J A-\angle J Q H $$  ![](https://cdn.mathpix.com/cropped/2024_11_18_62dbd531c72d0ff8164cg-55.jpg?height=798&width=758&top_left_y=1257&top_left_x=289)  Figure 1 ![](https://cdn.mathpix.com/cropped/2024_11_18_62dbd531c72d0ff8164cg-55.jpg?height=710&width=672&top_left_y=1344&top_left_x=1092)  Figure 2  To avoid confusion, let us draw a new picture at this moment (see Figure 2). Owing to $\angle Q^{\prime} H A^{\prime}=\angle J Q H+\angle H J Q$ and $\angle H J A=\angle Q J A+\angle H J Q$, we just have to show that $2 \angle J Q H=\angle Q J A$. To this end, it suffices to remark that $A Q A^{\prime} Q^{\prime}$ is a rectangle and that $J$, being defined to be the midpoint of $H Q^{\prime}$, has to lie on the mid parallel of $Q A^{\prime}$ and $Q^{\prime} A$.


Solution: We define the points $A^{\prime}$ and $E$ and prove that the ray $M H$ passes through $Q$ in the same way as in the first solution. Notice that the points $A^{\prime}$ and $E$ can play analogous roles to the points $Q$ and $K$, respectively: point $A^{\prime}$ is the second intersection of the line $M H$ with $\Gamma$, and $E$ is the point on $\Gamma$ with the property $\angle H E A^{\prime}=90^{\circ}$ (see Figure 3).  In the circles $K Q H$ and $E A^{\prime} H$, the line segments $H Q$ and $H A^{\prime}$ are diameters, respectively; so, these circles have a common tangent $t$ at $H$, perpendicular to $M H$. Let $R$ be the radical center of the circles $A B C, K Q H$ and $E A^{\prime} H$. Their pairwise radical axes are the lines $Q K$, $A^{\prime} E$ and the line $t$; they all pass through $R$. Let $S$ be the midpoint of $H R$; by $\angle Q K H=$ ![](https://cdn.mathpix.com/cropped/2024_11_18_62dbd531c72d0ff8164cg-56.jpg?height=689&width=960&top_left_y=181&top_left_x=545)  Figure 3 $\angle H E A^{\prime}=90^{\circ}$, the quadrilateral $H E R K$ is cyclic and its circumcenter is $S$; hence we have $S K=S E=S H$. The line $B C$, being the perpendicular bisector of $H E$, passes through $S$.  The circle $H M F$ also is tangent to $t$ at $H$; from the power of $S$ with respect to the circle $H M F$ we have  $$ S M \cdot S F=S H^{2}=S K^{2} $$  So, the power of $S$ with respect to the circles $K Q H$ and $K F M$ is $S K^{2}$. Therefore, the line segment $S K$ is tangent to both circles at $K$.


Let $A B C D$ be a convex quadrilateral, and let $P, Q, R$, and $S$ be points on the sides $A B, B C, C D$, and $D A$, respectively. Let the line segments $P R$ and $Q S$ meet at $O$. Suppose that each of the quadrilaterals $A P O S, B Q O P, C R O Q$, and $D S O R$ has an incircle. Prove that the lines $A C, P Q$, and $R S$ are either concurrent or parallel to each other. (Bulgaria)

Solution: Denote by $\gamma_{A}, \gamma_{B}, \gamma_{C}$, and $\gamma_{D}$ the incircles of the quadrilaterals $A P O S, B Q O P$, $C R O Q$, and $D S O R$, respectively.  We start with proving that the quadrilateral $A B C D$ also has an incircle which will be referred to as $\Omega$. Denote the points of tangency as in Figure 1. It is well-known that $Q Q_{1}=O O_{1}$ (if $B C \| P R$, this is obvious; otherwise, one may regard the two circles involved as the incircle and an excircle of the triangle formed by the lines $O Q, P R$, and $B C$ ). Similarly, $O O_{1}=P P_{1}$. Hence we have $Q Q_{1}=P P_{1}$. The other equalities of segment lengths marked in Figure 1 can be proved analogously. These equalities, together with $A P_{1}=A S_{1}$ and similar ones, yield $A B+C D=A D+B C$, as required. ![](https://cdn.mathpix.com/cropped/2024_11_18_62dbd531c72d0ff8164cg-57.jpg?height=654&width=1377&top_left_y=958&top_left_x=342)  Figure 1  Next, let us draw the lines parallel to $Q S$ through $P$ and $R$, and also draw the lines parallel to $P R$ through $Q$ and $S$. These lines form a parallelogram; denote its vertices by $A^{\prime}, B^{\prime}, C^{\prime}$, and $D^{\prime}$ as shown in Figure 2.  Since the quadrilateral $A P O S$ has an incircle, we have $A P-A S=O P-O S=A^{\prime} S-A^{\prime} P$. It is well-known that in this case there also exists a circle $\omega_{A}$ tangent to the four rays $A P$, $A S, A^{\prime} P$, and $A^{\prime} S$. It is worth mentioning here that in case when, say, the lines $A B$ and $A^{\prime} B^{\prime}$ coincide, the circle $\omega_{A}$ is just tangent to $A B$ at $P$. We introduce the circles $\omega_{B}, \omega_{C}$, and $\omega_{D}$ in a similar manner.  Assume that the radii of the circles $\omega_{A}$ and $\omega_{C}$ are different. Let $X$ be the center of the homothety having a positive scale factor and mapping $\omega_{A}$ to $\omega_{C}$.  Now, Monge's theorem applied to the circles $\omega_{A}, \Omega$, and $\omega_{C}$ shows that the points $A, C$, and $X$ are collinear. Applying the same theorem to the circles $\omega_{A}, \omega_{B}$, and $\omega_{C}$, we see that the points $P, Q$, and $X$ are also collinear. Similarly, the points $R, S$, and $X$ are collinear, as required.  If the radii of $\omega_{A}$ and $\omega_{C}$ are equal but these circles do not coincide, then the degenerate version of the same theorem yields that the three lines $A C, P Q$, and $R S$ are parallel to the line of centers of $\omega_{A}$ and $\omega_{C}$.  Finally, we need to say a few words about the case when $\omega_{A}$ and $\omega_{C}$ coincide (and thus they also coincide with $\Omega, \omega_{B}$, and $\omega_{D}$ ). It may be regarded as the limit case in the following manner. ![](https://cdn.mathpix.com/cropped/2024_11_18_62dbd531c72d0ff8164cg-58.jpg?height=1012&width=1580&top_left_y=179&top_left_x=244)  Figure 2  Let us fix the positions of $A, P, O$, and $S$ (thus we also fix the circles $\omega_{A}, \gamma_{A}, \gamma_{B}$, and $\gamma_{D}$ ). Now we vary the circle $\gamma_{C}$ inscribed into $\angle Q O R$; for each of its positions, one may reconstruct the lines $B C$ and $C D$ as the external common tangents to $\gamma_{B}, \gamma_{C}$ and $\gamma_{C}, \gamma_{D}$ different from $P R$ and $Q S$, respectively. After such variation, the circle $\Omega$ changes, so the result obtained above may be applied.


Solution: Applying Menelaus' theorem to $\triangle A B C$ with the line $P Q$ and to $\triangle A C D$ with the line $R S$, we see that the line $A C$ meets $P Q$ and $R S$ at the same point (possibly at infinity) if and only if  $$ \frac{A P}{P B} \cdot \frac{B Q}{Q C} \cdot \frac{C R}{R D} \cdot \frac{D S}{S A}=1 $$  So, it suffices to prove (1). We start with the following result. Lemma 1. Let $E F G H$ be a circumscribed quadrilateral, and let $M$ be its incenter. Then  $$ \frac{E F \cdot F G}{G H \cdot H E}=\frac{F M^{2}}{H M^{2}} $$  Proof. Notice that $\angle E M H+\angle G M F=\angle F M E+\angle H M G=180^{\circ}, \angle F G M=\angle M G H$, and $\angle H E M=\angle M E F$ (see Figure 3). By the law of sines, we get  $$ \frac{E F}{F M} \cdot \frac{F G}{F M}=\frac{\sin \angle F M E \cdot \sin \angle G M F}{\sin \angle M E F \cdot \sin \angle F G M}=\frac{\sin \angle H M G \cdot \sin \angle E M H}{\sin \angle M G H \cdot \sin \angle H E M}=\frac{G H}{H M} \cdot \frac{H E}{H M} . $$  ![](https://cdn.mathpix.com/cropped/2024_11_18_62dbd531c72d0ff8164cg-59.jpg?height=569&width=646&top_left_y=452&top_left_x=225)  Figure 3 ![](https://cdn.mathpix.com/cropped/2024_11_18_62dbd531c72d0ff8164cg-59.jpg?height=829&width=954&top_left_y=179&top_left_x=885)  Figure 4  We denote by $I, J, K$, and $L$ the incenters of the quadrilaterals $A P O S, B Q O P, C R O Q$, and $D S O R$, respectively. Applying Lemma 1 to these four quadrilaterals we get  $$ \frac{A P \cdot P O}{O S \cdot S A} \cdot \frac{B Q \cdot Q O}{O P \cdot P B} \cdot \frac{C R \cdot R O}{O Q \cdot Q C} \cdot \frac{D S \cdot S O}{O R \cdot R D}=\frac{P I^{2}}{S I^{2}} \cdot \frac{Q J^{2}}{P J^{2}} \cdot \frac{R K^{2}}{Q K^{2}} \cdot \frac{S L^{2}}{R L^{2}} $$  which reduces to  $$ \frac{A P}{P B} \cdot \frac{B Q}{Q C} \cdot \frac{C R}{R D} \cdot \frac{D S}{S A}=\frac{P I^{2}}{P J^{2}} \cdot \frac{Q J^{2}}{Q K^{2}} \cdot \frac{R K^{2}}{R L^{2}} \cdot \frac{S L^{2}}{S I^{2}} $$  Next, we have $\angle I P J=\angle J O I=90^{\circ}$, and the line $O P$ separates $I$ and $J$ (see Figure 4). This means that the quadrilateral $I P J O$ is cyclic. Similarly, we get that the quadrilateral $J Q K O$ is cyclic with $\angle J Q K=90^{\circ}$. Thus, $\angle Q K J=\angle Q O J=\angle J O P=\angle J I P$. Hence, the right triangles $I P J$ and $K Q J$ are similar. Therefore, $\frac{P I}{P J}=\frac{Q K}{Q J}$. Likewise, we obtain $\frac{R K}{R L}=\frac{S I}{S L}$. These two equations together with (2) yield (1). Comment. Instead of using the sine law, one may prove Lemma 1 by the following approach. ![](https://cdn.mathpix.com/cropped/2024_11_18_62dbd531c72d0ff8164cg-59.jpg?height=558&width=698&top_left_y=2028&top_left_x=685)  Figure 5 Let $N$ be the point such that $\triangle N H G \sim \triangle M E F$ and such that $N$ and $M$ lie on different sides of the line $G H$, as shown in Figure 5. Then $\angle G N H+\angle H M G=\angle F M E+\angle H M G=180^{\circ}$. So, the quadrilateral $G N H M$ is cyclic. Thus, $\angle M N H=\angle M G H=\angle F G M$ and $\angle H M N=\angle H G N=$ $\angle E F M=\angle M F G$. Hence, $\triangle H M N \sim \triangle M F G$. Therefore, $\frac{H M}{H G}=\frac{H M}{H N} \cdot \frac{H N}{H G}=\frac{M F}{M G} \cdot \frac{E M}{E F}$. Similarly, we obtain $\frac{H M}{H E}=\frac{M F}{M E} \cdot \frac{G M}{G F}$. By multiplying these two equations, we complete the proof.


Solution: We present another approach for showing (1) from  Lemma 2. Let $E F G H$ and $E^{\prime} F^{\prime} G^{\prime} H^{\prime}$ be circumscribed quadrilaterals such that $\angle E+\angle E^{\prime}=$ $\angle F+\angle F^{\prime}=\angle G+\angle G^{\prime}=\angle H+\angle H^{\prime}=180^{\circ}$. Then  $$ \frac{E F \cdot G H}{F G \cdot H E}=\frac{E^{\prime} F^{\prime} \cdot G^{\prime} H^{\prime}}{F^{\prime} G^{\prime} \cdot H^{\prime} E^{\prime}} $$  Proof. Let $M$ and $M^{\prime}$ be the incenters of $E F G H$ and $E^{\prime} F^{\prime} G^{\prime} H^{\prime}$, respectively. We use the notation [XYZ] for the area of a triangle $X Y Z$.  Taking into account the relation $\angle F M E+\angle F^{\prime} M^{\prime} E^{\prime}=180^{\circ}$ together with the analogous ones, we get  $$ \begin{aligned} \frac{E F \cdot G H}{F G \cdot H E} & =\frac{[M E F] \cdot[M G H]}{[M F G] \cdot[M H E]}=\frac{M E \cdot M F \cdot \sin \angle F M E \cdot M G \cdot M H \cdot \sin \angle H M G}{M F \cdot M G \cdot \sin \angle G M F \cdot M H \cdot M E \cdot \sin \angle E M H} \\ & =\frac{M^{\prime} E^{\prime} \cdot M^{\prime} F^{\prime} \cdot \sin \angle F^{\prime} M^{\prime} E^{\prime} \cdot M^{\prime} G^{\prime} \cdot M^{\prime} H^{\prime} \cdot \sin \angle H^{\prime} M^{\prime} G^{\prime}}{M^{\prime} F^{\prime} \cdot M^{\prime} G^{\prime} \cdot \sin \angle G^{\prime} M^{\prime} F^{\prime} \cdot M^{\prime} H^{\prime} \cdot M^{\prime} E^{\prime} \cdot \sin \angle E^{\prime} M^{\prime} H^{\prime}}=\frac{E^{\prime} F^{\prime} \cdot G^{\prime} H^{\prime}}{F^{\prime} G^{\prime} \cdot H^{\prime} E^{\prime}} . \end{aligned} $$  ![](https://cdn.mathpix.com/cropped/2024_11_18_62dbd531c72d0ff8164cg-60.jpg?height=849&width=1089&top_left_y=1300&top_left_x=489)  Figure 6 Denote by $h$ the homothety centered at $O$ that maps the incircle of $C R O Q$ to the incircle of $A P O S$. Let $Q^{\prime}=h(Q), C^{\prime}=h(C), R^{\prime}=h(R), O^{\prime}=O, S^{\prime}=S, A^{\prime}=A$, and $P^{\prime}=P$. Furthermore, define $B^{\prime}=A^{\prime} P^{\prime} \cap C^{\prime} Q^{\prime}$ and $D^{\prime}=A^{\prime} S^{\prime} \cap C^{\prime} R^{\prime}$ as shown in Figure 6. Then  $$ \frac{A P \cdot O S}{P O \cdot S A}=\frac{A^{\prime} P^{\prime} \cdot O^{\prime} S^{\prime}}{P^{\prime} O^{\prime} \cdot S^{\prime} A^{\prime}} $$  holds trivially. We also have  $$ \frac{C R \cdot O Q}{R O \cdot Q C}=\frac{C^{\prime} R^{\prime} \cdot O^{\prime} Q^{\prime}}{R^{\prime} O^{\prime} \cdot Q^{\prime} C^{\prime}} $$  by the similarity of the quadrilaterals $C R O Q$ and $C^{\prime} R^{\prime} O^{\prime} Q^{\prime}$.  Next, consider the circumscribed quadrilaterals $B Q O P$ and $B^{\prime} Q^{\prime} O^{\prime} P^{\prime}$ whose incenters lie on different sides of the quadrilaterals' shared side line $O P=O^{\prime} P^{\prime}$. Observe that $B Q \| B^{\prime} Q^{\prime}$ and that $B^{\prime}$ and $Q^{\prime}$ lie on the lines $B P$ and $Q O$, respectively. It is now easy to see that the two quadrilaterals satisfy the hypotheses of Lemma 2. Thus, we deduce  $$ \frac{B Q \cdot O P}{Q O \cdot P B}=\frac{B^{\prime} Q^{\prime} \cdot O^{\prime} P^{\prime}}{Q^{\prime} O^{\prime} \cdot P^{\prime} B^{\prime}} $$  Similarly, we get  $$ \frac{D S \cdot O R}{S O \cdot R D}=\frac{D^{\prime} S^{\prime} \cdot O^{\prime} R^{\prime}}{S^{\prime} O^{\prime} \cdot R^{\prime} D^{\prime}} $$  Multiplying these four equations, we obtain  $$ \frac{A P}{P B} \cdot \frac{B Q}{Q C} \cdot \frac{C R}{R D} \cdot \frac{D S}{S A}=\frac{A^{\prime} P^{\prime}}{P^{\prime} B^{\prime}} \cdot \frac{B^{\prime} Q^{\prime}}{Q^{\prime} C^{\prime}} \cdot \frac{C^{\prime} R^{\prime}}{R^{\prime} D^{\prime}} \cdot \frac{D^{\prime} S^{\prime}}{S^{\prime} A^{\prime}} $$  Finally, we apply BRIANChon's theorem to the circumscribed hexagon $A^{\prime} P^{\prime} R^{\prime} C^{\prime} Q^{\prime} S^{\prime}$ and deduce that the lines $A^{\prime} C^{\prime}, P^{\prime} Q^{\prime}$, and $R^{\prime} S^{\prime}$ are either concurrent or parallel to each other. So, by Menelaus' theorem, we obtain  $$ \frac{A^{\prime} P^{\prime}}{P^{\prime} B^{\prime}} \cdot \frac{B^{\prime} Q^{\prime}}{Q^{\prime} C^{\prime}} \cdot \frac{C^{\prime} R^{\prime}}{R^{\prime} D^{\prime}} \cdot \frac{D^{\prime} S^{\prime}}{S^{\prime} A^{\prime}}=1 $$  This equation together with (3) yield (1).


A triangulation of a convex polygon $\Pi$ is a partitioning of $\Pi$ into triangles by diagonals having no common points other than the vertices of the polygon. We say that a triangulation is a Thaiangulation if all triangles in it have the same area.  Prove that any two different Thaiangulations of a convex polygon $\Pi$ differ by exactly two triangles. (In other words, prove that it is possible to replace one pair of triangles in the first Thaiangulation with a different pair of triangles so as to obtain the second Thaiangulation.) (Bulgaria)

Solution: We denote by [S] the area of a polygon $S$. Recall that each triangulation of a convex $n$-gon has exactly $n-2$ triangles. This means that all triangles in any two Thaiangulations of a convex polygon $\Pi$ have the same area.  Let $\mathcal{T}$ be a triangulation of a convex polygon $\Pi$. If four vertices $A, B, C$, and $D$ of $\Pi$ form a parallelogram, and $\mathcal{T}$ contains two triangles whose union is this parallelogram, then we say that $\mathcal{T}$ contains parallelogram $A B C D$. Notice here that if two Thaiangulations $\mathcal{T}_{1}$ and $\mathcal{T}_{2}$ of $\Pi$ differ by two triangles, then the union of these triangles is a quadrilateral each of whose diagonals bisects its area, i.e., a parallelogram.  We start with proving two properties of triangulations. Lemma 1. A triangulation of a convex polygon $\Pi$ cannot contain two parallelograms. Proof. Arguing indirectly, assume that $P_{1}$ and $P_{2}$ are two parallelograms contained in some triangulation $\mathcal{T}$. If they have a common triangle in $\mathcal{T}$, then we may assume that $P_{1}$ consists of triangles $A B C$ and $A D C$ of $\mathcal{T}$, while $P_{2}$ consists of triangles $A D C$ and $C D E$ (see Figure 1). But then $B C\|A D\| C E$, so the three vertices $B, C$, and $E$ of $\Pi$ are collinear, which is absurd.  Assume now that $P_{1}$ and $P_{2}$ contain no common triangle. Let $P_{1}=A B C D$. The sides $A B$, $B C, C D$, and $D A$ partition $\Pi$ into several parts, and $P_{2}$ is contained in one of them; we may assume that this part is cut off from $P_{1}$ by $A D$. Then one may label the vertices of $P_{2}$ by $X$, $Y, Z$, and $T$ so that the polygon $A B C D X Y Z T$ is convex (see Figure 2; it may happen that $D=X$ and/or $T=A$, but still this polygon has at least six vertices). But the sum of the external angles of this polygon at $B, C, Y$, and $Z$ is already $360^{\circ}$, which is impossible. A final contradiction. ![](https://cdn.mathpix.com/cropped/2024_11_18_62dbd531c72d0ff8164cg-62.jpg?height=458&width=269&top_left_y=1687&top_left_x=251)  Figure 1 ![](https://cdn.mathpix.com/cropped/2024_11_18_62dbd531c72d0ff8164cg-62.jpg?height=341&width=601&top_left_y=1800&top_left_x=613)  Figure 2 ![](https://cdn.mathpix.com/cropped/2024_11_18_62dbd531c72d0ff8164cg-62.jpg?height=406&width=484&top_left_y=1733&top_left_x=1323)  Figure 3  Lemma 2. Every triangle in a Thaiangulation $\mathcal{T}$ of $\Pi$ contains a side of $\Pi$. Proof. Let $A B C$ be a triangle in $\mathcal{T}$. Apply an affine transform such that $A B C$ maps to an equilateral triangle; let $A^{\prime} B^{\prime} C^{\prime}$ be the image of this triangle, and $\Pi^{\prime}$ be the image of $\Pi$. Clearly, $\mathcal{T}$ maps into a Thaiangulation $\mathcal{T}^{\prime}$ of $\Pi^{\prime}$.  Assume that none of the sides of $\triangle A^{\prime} B^{\prime} C^{\prime}$ is a side of $\Pi^{\prime}$. Then $\mathcal{T}^{\prime}$ contains some other triangles with these sides, say, $A^{\prime} B^{\prime} Z, C^{\prime} A^{\prime} Y$, and $B^{\prime} C^{\prime} X$; notice that $A^{\prime} Z B^{\prime} X C^{\prime} Y$ is a convex hexagon (see Figure 3). The sum of its external angles at $X, Y$, and $Z$ is less than $360^{\circ}$. So one of these angles (say, at $Z$ ) is less than $120^{\circ}$, hence $\angle A^{\prime} Z B^{\prime}>60^{\circ}$. Then $Z$ lies on a circular arc subtended by $A^{\prime} B^{\prime}$ and having angular measure less than $240^{\circ}$; consequently, the altitude $Z H$ of $\triangle A^{\prime} B^{\prime} Z$ is less than $\sqrt{3} A^{\prime} B^{\prime} / 2$. Thus $\left[A^{\prime} B^{\prime} Z\right]<\left[A^{\prime} B^{\prime} C^{\prime}\right]$, and $\mathcal{T}^{\prime}$ is not a Thaiangulation. A contradiction.  Now we pass to the solution. We say that a triangle in a triangulation of $\Pi$ is an ear if it contains two sides of $\Pi$. Note that each triangulation of a polygon contains some ear.  Arguing indirectly, we choose a convex polygon $\Pi$ with the least possible number of sides such that some two Thaiangulations $\mathcal{T}_{1}$ and $\mathcal{T}_{2}$ of $\Pi$ violate the problem statement (thus $\Pi$ has at least five sides). Consider now any ear $A B C$ in $\mathcal{T}_{1}$, with $A C$ being a diagonal of $\Pi$. If $\mathcal{T}_{2}$ also contains $\triangle A B C$, then one may cut $\triangle A B C$ off from $\Pi$, getting a polygon with a smaller number of sides which also violates the problem statement. This is impossible; thus $\mathcal{T}_{2}$ does not contain $\triangle A B C$.  Next, $\mathcal{T}_{1}$ contains also another triangle with side $A C$, say $\triangle A C D$. By Lemma 2 , this triangle contains a side of $\Pi$, so $D$ is adjacent to either $A$ or $C$ on the boundary of $\Pi$. We may assume that $D$ is adjacent to $C$.  Assume that $\mathcal{T}_{2}$ does not contain the triangle $B C D$. Then it contains two different triangles $B C X$ and $C D Y$ (possibly, with $X=Y$ ); since these triangles have no common interior points, the polygon $A B C D Y X$ is convex (see Figure 4). But, since $[A B C]=[B C X]=$ $[A C D]=[C D Y]$, we get $A X \| B C$ and $A Y \| C D$ which is impossible. Thus $\mathcal{T}_{2}$ contains $\triangle B C D$.  Therefore, $[A B D]=[A B C]+[A C D]-[B C D]=[A B C]$, and $A B C D$ is a parallelogram contained in $\mathcal{T}_{1}$. Let $\mathcal{T}^{\prime}$ be the Thaiangulation of $\Pi$ obtained from $\mathcal{T}_{1}$ by replacing the diagonal $A C$ with $B D$; then $\mathcal{T}^{\prime}$ is distinct from $\mathcal{T}_{2}$ (otherwise $\mathcal{T}_{1}$ and $\mathcal{T}_{2}$ would differ by two triangles). Moreover, $\mathcal{T}^{\prime}$ shares a common ear $B C D$ with $\mathcal{T}_{2}$. As above, cutting this ear away we obtain that $\mathcal{T}_{2}$ and $\mathcal{T}^{\prime}$ differ by two triangles forming a parallelogram different from $A B C D$. Thus $\mathcal{T}^{\prime}$ contains two parallelograms, which contradicts Lemma 1. ![](https://cdn.mathpix.com/cropped/2024_11_18_62dbd531c72d0ff8164cg-63.jpg?height=455&width=1166&top_left_y=1372&top_left_x=199)  Figure 4 ![](https://cdn.mathpix.com/cropped/2024_11_18_62dbd531c72d0ff8164cg-63.jpg?height=412&width=506&top_left_y=1416&top_left_x=1363)  Figure 5  Comment 1. Lemma 2 is equivalent to the well-known Erdős-Debrunner inequality stating that for any triangle $P Q R$ and any points $A, B, C$ lying on the sides $Q R, R P$, and $P Q$, respectively, we have  $$ [A B C] \geqslant \min \{[A B R],[B C P],[C A Q]\} $$  To derive this inequality from Lemma 2, one may assume that (1) does not hold, and choose some points $X, Y$, and $Z$ inside the triangles $B C P, C A Q$, and $A B R$, respectively, so that $[A B C]=$ $[A B Z]=[B C X]=[C A Y]$. Then a convex hexagon $A Z B X C Y$ has a Thaiangulation containing $\triangle A B C$, which contradicts Lemma 2.  Conversely, assume that a Thaiangulation $\mathcal{T}$ of $\Pi$ contains a triangle $A B C$ none of whose sides is a side of $\Pi$, and let $A B Z, A Y C$, and $X B C$ be other triangles in $\mathcal{T}$ containing the corresponding sides. Then $A Z B X C Y$ is a convex hexagon.  Consider the lines through $A, B$, and $C$ parallel to $Y Z, Z X$, and $X Y$, respectively. They form a triangle $X^{\prime} Y^{\prime} Z^{\prime}$ similar to $\triangle X Y Z$ (see Figure 5). By (1) we have  $$ [A B C] \geqslant \min \left\{\left[A B Z^{\prime}\right],\left[B C X^{\prime}\right],\left[C A Y^{\prime}\right]\right\}>\min \{[A B Z],[B C X],[C A Y]\}, $$  so $\mathcal{T}$ is not a Thaiangulation.


Solution: We will make use of the preliminary observations from   Arguing indirectly, we choose a convex polygon $\Pi$ with the least possible number of sides such that some two Thaiangulations $\mathcal{T}_{1}$ and $\mathcal{T}_{2}$ of $\Pi$ violate the statement (thus $\Pi$ has at least five sides). Assume that $\mathcal{T}_{1}$ and $\mathcal{T}_{2}$ share a diagonal $d$ splitting $\Pi$ into two smaller polygons $\Pi_{1}$ and $\Pi_{2}$. Since the problem statement holds for any of them, the induced Thaiangulations of each of $\Pi_{i}$ differ by two triangles forming a parallelogram (the Thaiangulations induced on $\Pi_{i}$ by $\mathcal{T}_{1}$ and $T_{2}$ may not coincide, otherwise $\mathcal{T}_{1}$ and $\mathcal{T}_{2}$ would differ by at most two triangles). But both these parallelograms are contained in $\mathcal{T}_{1}$; this contradicts Lemma 1. Therefore, $\mathcal{T}_{1}$ and $\mathcal{T}_{2}$ share no diagonal. Hence they also share no triangle.  We consider two cases. Case 1. Assume that some vertex $B$ of $\Pi$ is an endpoint of some diagonal in $\mathcal{T}_{1}$, as well as an endpoint of some diagonal in $\mathcal{T}_{2}$.  Let $A$ and $C$ be the vertices of $\Pi$ adjacent to $B$. Then $\mathcal{T}_{1}$ contains some triangles $A B X$ and $B C Y$, while $\mathcal{T}_{2}$ contains some triangles $A B X^{\prime}$ and $B C Y^{\prime}$. Here, some of the points $X$, $X^{\prime}, Y$, and $Y^{\prime}$ may coincide; however, in view of our assumption together with the fact that $\mathcal{T}_{1}$ and $\mathcal{T}_{2}$ share no triangle, all four triangles $A B X, B C Y, A B X^{\prime}$, and $B C Y^{\prime}$ are distinct.  Since $[A B X]=[B C Y]=\left[A B X^{\prime}\right]=\left[B C Y^{\prime}\right]$, we have $X X^{\prime} \| A B$ and $Y Y^{\prime} \| B C$. Now, if $X=Y$, then $X^{\prime}$ and $Y^{\prime}$ lie on different lines passing through $X$ and are distinct from that point, so that $X^{\prime} \neq Y^{\prime}$. In this case, we may switch the two Thaiangulations. So, hereafter we assume that $X \neq Y$.  In the convex pentagon $A B C Y X$ we have either $\angle B A X+\angle A X Y>180^{\circ}$ or $\angle X Y C+$ $\angle Y C B>180^{\circ}$ (or both); due to the symmetry, we may assume that the first inequality holds. Let $r$ be the ray emerging from $X$ and co-directed with $\overrightarrow{A B}$; our inequality shows that $r$ points to the interior of the pentagon (and thus to the interior of $\Pi$ ). Therefore, the ray opposite to $r$ points outside $\Pi$, so $X^{\prime}$ lies on $r$; moreover, $X^{\prime}$ lies on the "arc" $C Y$ of $\Pi$ not containing $X$. So the segments $X X^{\prime}$ and $Y B$ intersect (see Figure 6).  Let $O$ be the intersection point of the rays $r$ and $B C$. Since the triangles $A B X^{\prime}$ and $B C Y^{\prime}$ have no common interior points, $Y^{\prime}$ must lie on the "arc" $C X^{\prime}$ which is situated inside the triangle $X B O$. Therefore, the line $Y Y^{\prime}$ meets two sides of $\triangle X B O$, none of which may be $X B$ (otherwise the diagonals $X B$ and $Y Y^{\prime}$ would share a common point). Thus $Y Y^{\prime}$ intersects $B O$, which contradicts $Y Y^{\prime} \| B C$. ![](https://cdn.mathpix.com/cropped/2024_11_18_62dbd531c72d0ff8164cg-64.jpg?height=518&width=892&top_left_y=1928&top_left_x=588)  Figure 6  Case 2. In the remaining case, each vertex of $\Pi$ is an endpoint of a diagonal in at most one of $\mathcal{T}_{1}$ and $\mathcal{T}_{2}$. On the other hand, a triangulation cannot contain two consecutive vertices with no diagonals from each. Therefore, the vertices of $\Pi$ alternatingly emerge diagonals in $\mathcal{T}_{1}$ and in $\mathcal{T}_{2}$. In particular, $\Pi$ has an even number of sides.  Next, we may choose five consecutive vertices $A, B, C, D$, and $E$ of $\Pi$ in such a way that  $$ \angle A B C+\angle B C D>180^{\circ} \text { and } \angle B C D+\angle C D E>180^{\circ} . $$  In order to do this, it suffices to choose three consecutive vertices $B, C$, and $D$ of $\Pi$ such that the sum of their external angles is at most $180^{\circ}$. This is possible, since $\Pi$ has at least six sides. ![](https://cdn.mathpix.com/cropped/2024_11_18_62dbd531c72d0ff8164cg-65.jpg?height=529&width=701&top_left_y=521&top_left_x=683)  Figure 7 We may assume that $\mathcal{T}_{1}$ has no diagonals from $B$ and $D$ (and thus contains the triangles $A B C$ and $C D E$ ), while $\mathcal{T}_{2}$ has no diagonals from $A, C$, and $E$ (and thus contains the triangle $B C D)$. Now, since $[A B C]=[B C D]=[C D E]$, we have $A D \| B C$ and $B E \| C D$ (see Figure 7). By (2) this yields that $A D>B C$ and $B E>C D$. Let $X=A C \cap B D$ and $Y=C E \cap B D$; then the inequalities above imply that $A X>C X$ and $E Y>C Y$.  Finally, $\mathcal{T}_{2}$ must also contain some triangle $B D Z$ with $Z \neq C$; then the ray $C Z$ lies in the angle $A C E$. Since $[B C D]=[B D Z]$, the diagonal $B D$ bisects $C Z$. Together with the inequalities above, this yields that $Z$ lies inside the triangle $A C E$ (but $Z$ is distinct from $A$ and $E$ ), which is impossible. The final contradiction.  Comment 2. Case 2 may also be accomplished with the use of Lemma 2. Indeed, since each triangulation of an $n$-gon contains $n-2$ triangles neither of which may contain three sides of $\Pi$, Lemma 2 yields that each Thaiangulation contains exactly two ears. But each vertex of $\Pi$ is a vertex of an ear either in $\mathcal{T}_{1}$ or in $\mathcal{T}_{2}$, so $\Pi$ cannot have more than four vertices.


Determine all positive integers $M$ for which the sequence $a_{0}, a_{1}, a_{2}, \ldots$, defined by $a_{0}=\frac{2 M+1}{2}$ and $a_{k+1}=a_{k}\left\lfloor a_{k}\right\rfloor$ for $k=0,1,2, \ldots$, contains at least one integer term. (Luxembourg)

Solution: Define $b_{k}=2 a_{k}$ for all $k \geqslant 0$. Then  $$ b_{k+1}=2 a_{k+1}=2 a_{k}\left\lfloor a_{k}\right\rfloor=b_{k}\left\lfloor\frac{b_{k}}{2}\right\rfloor . $$  Since $b_{0}$ is an integer, it follows that $b_{k}$ is an integer for all $k \geqslant 0$. Suppose that the sequence $a_{0}, a_{1}, a_{2}, \ldots$ does not contain any integer term. Then $b_{k}$ must be an odd integer for all $k \geqslant 0$, so that  $$ b_{k+1}=b_{k}\left\lfloor\frac{b_{k}}{2}\right\rfloor=\frac{b_{k}\left(b_{k}-1\right)}{2} $$  Hence  $$ b_{k+1}-3=\frac{b_{k}\left(b_{k}-1\right)}{2}-3=\frac{\left(b_{k}-3\right)\left(b_{k}+2\right)}{2} $$  for all $k \geqslant 0$. Suppose that $b_{0}-3>0$. Then equation (2) yields $b_{k}-3>0$ for all $k \geqslant 0$. For each $k \geqslant 0$, define $c_{k}$ to be the highest power of 2 that divides $b_{k}-3$. Since $b_{k}-3$ is even for all $k \geqslant 0$, the number $c_{k}$ is positive for every $k \geqslant 0$.  Note that $b_{k}+2$ is an odd integer. Therefore, from equation (2), we have that $c_{k+1}=c_{k}-1$. Thus, the sequence $c_{0}, c_{1}, c_{2}, \ldots$ of positive integers is strictly decreasing, a contradiction. So, $b_{0}-3 \leqslant 0$, which implies $M=1$.  For $M=1$, we can check that the sequence is constant with $a_{k}=\frac{3}{2}$ for all $k \geqslant 0$. Therefore, the answer is $M \geqslant 2$.


Solution: We provide an alternative way to show $M=1$ once equation (1) has been reached. We claim that $b_{k} \equiv 3\left(\bmod 2^{m}\right)$ for all $k \geqslant 0$ and $m \geqslant 1$. If this is true, then we would have $b_{k}=3$ for all $k \geqslant 0$ and hence $M=1$.  To establish our claim, we proceed by induction on $m$. The base case $b_{k} \equiv 3(\bmod 2)$ is true for all $k \geqslant 0$ since $b_{k}$ is odd. Now suppose that $b_{k} \equiv 3\left(\bmod 2^{m}\right)$ for all $k \geqslant 0$. Hence $b_{k}=2^{m} d_{k}+3$ for some integer $d_{k}$. We have  $$ 3 \equiv b_{k+1} \equiv\left(2^{m} d_{k}+3\right)\left(2^{m-1} d_{k}+1\right) \equiv 3 \cdot 2^{m-1} d_{k}+3 \quad\left(\bmod 2^{m}\right) $$  so that $d_{k}$ must be even. This implies that $b_{k} \equiv 3\left(\bmod 2^{m+1}\right)$, as required. Comment. The reason the number 3 which appears in both solutions is important, is that it is a nontrivial fixed point of the recurrence relation for $b_{k}$.


Let $a$ and $b$ be positive integers such that $a!b$ ! is a multiple of $a!+b!$. Prove that $3 a \geqslant 2 b+2$. (United Kingdom)

Solution: If $a>b$, we immediately get $3 a \geqslant 2 b+2$. In the case $a=b$, the required inequality is equivalent to $a \geqslant 2$, which can be checked easily since $(a, b)=(1,1)$ does not satisfy $a!+b!\mid a!b!$. We now assume $a<b$ and denote $c=b-a$. The required inequality becomes $a \geqslant 2 c+2$.  Suppose, to the contrary, that $a \leqslant 2 c+1$. Define $M=\frac{b!}{a!}=(a+1)(a+2) \cdots(a+c)$. Since $a!+b!\mid a!b!$ implies $1+M \mid a!M$, we obtain $1+M \mid a!$. Note that we must have $c<a$; otherwise $1+M>a$ !, which is impossible. We observe that $c!\mid M$ since $M$ is a product of $c$ consecutive integers. Thus $\operatorname{gcd}(1+M, c!)=1$, which implies  $$ 1+M \left\lvert\, \frac{a!}{c!}=(c+1)(c+2) \cdots a\right. $$  If $a \leqslant 2 c$, then $\frac{a!}{c!}$ is a product of $a-c \leqslant c$ integers not exceeding $a$ whereas $M$ is a product of $c$ integers exceeding $a$. Therefore, $1+M>\frac{a!}{c!}$, which is a contradiction.  It remains to exclude the case $a=2 c+1$. Since $a+1=2(c+1)$, we have $c+1 \mid M$. Hence, we can deduce from (1) that $1+M \mid(c+2)(c+3) \cdots a$. Now $(c+2)(c+3) \cdots a$ is a product of $a-c-1=c$ integers not exceeding $a$; thus it is smaller than $1+M$. Again, we arrive at a contradiction.  Comment 1. One may derive a weaker version of (1) and finish the problem as follows. After assuming $a \leqslant 2 c+1$, we have $\left\lfloor\frac{a}{2}\right\rfloor \leqslant c$, so $\left.\left\lfloor\frac{a}{2}\right\rfloor!\right\rvert\, M$. Therefore,  $$ 1+M \left\lvert\,\left(\left\lfloor\frac{a}{2}\right\rfloor+1\right)\left(\left\lfloor\frac{a}{2}\right\rfloor+2\right) \cdots a\right. $$  Observe that $\left(\left\lfloor\frac{a}{2}\right\rfloor+1\right)\left(\left\lfloor\frac{a}{2}\right\rfloor+2\right) \cdots a$ is a product of $\left\lceil\frac{a}{2}\right\rceil$ integers not exceeding $a$. This leads to a contradiction when $a$ is even since $\left\lceil\frac{a}{2}\right\rceil=\frac{a}{2} \leqslant c$ and $M$ is a product of $c$ integers exceeding $a$.  When $a$ is odd, we can further deduce that $1+M \left\lvert\,\left(\frac{a+3}{2}\right)\left(\frac{a+5}{2}\right) \cdots a\right.$ since $\left.\left\lfloor\frac{a}{2}\right\rfloor+1=\frac{a+1}{2} \right\rvert\, a+1$. Now $\left(\frac{a+3}{2}\right)\left(\frac{a+5}{2}\right) \cdots a$ is a product of $\frac{a-1}{2} \leqslant c$ numbers not exceeding $a$, and we get a contradiction.


Solution: As in   $$ N=1+(a+1)(a+2) \cdots(a+c) \mid(a+c)! $$  which implies that all prime factors of $N$ are at most $a+c$. Let $p$ be a prime factor of $N$. If $p \leqslant c$ or $p \geqslant a+1$, then $p$ divides one of $a+1, \ldots, a+c$ which is impossible. Hence $a \geqslant p \geqslant c+1$. Furthermore, we must have $2 p>a+c$; otherwise, $a+1 \leqslant 2 c+2 \leqslant 2 p \leqslant a+c$ so $p \mid N-1$, again impossible. Thus, we have $p \in\left(\frac{a+c}{2}, a\right]$, and $p^{2} \nmid(a+c)$ ! since $2 p>a+c$. Therefore, $p^{2} \nmid N$ as well.  If $a \leqslant c+2$, then the interval $\left(\frac{a+c}{2}, a\right]$ contains at most one integer and hence at most one prime number, which has to be $a$. Since $p^{2} \nmid N$, we must have $N=p=a$ or $N=1$, which is absurd since $N>a \geqslant 1$. Thus, we have $a \geqslant c+3$, and so $\frac{a+c+1}{2} \geqslant c+2$. It follows that $p$ lies in the interval $[c+2, a]$.  Thus, every prime appearing in the prime factorization of $N$ lies in the interval $[c+2, a]$, and its exponent is exactly 1 . So we must have $N \mid(c+2)(c+3) \cdots a$. However, $(c+2)(c+3) \cdots a$ is a product of $a-c-1 \leqslant c$ numbers not exceeding $a$, so it is less than $N$. This is a contradiction.  Comment 2. The original problem statement also asks to determine when the equality $3 a=2 b+2$ holds. It can be checked that the answer is $(a, b)=(2,2),(4,5)$.


Let $m$ and $n$ be positive integers such that $m>n$. Define $x_{k}=(m+k) /(n+k)$ for $k=$ $1,2, \ldots, n+1$. Prove that if all the numbers $x_{1}, x_{2}, \ldots, x_{n+1}$ are integers, then $x_{1} x_{2} \cdots x_{n+1}-1$ is divisible by an odd prime. (Austria)

Solution: Assume that $x_{1}, x_{2}, \ldots, x_{n+1}$ are integers. Define the integers  $$ a_{k}=x_{k}-1=\frac{m+k}{n+k}-1=\frac{m-n}{n+k}>0 $$  for $k=1,2, \ldots, n+1$. Let $P=x_{1} x_{2} \cdots x_{n+1}-1$. We need to prove that $P$ is divisible by an odd prime, or in other words, that $P$ is not a power of 2 . To this end, we investigate the powers of 2 dividing the numbers $a_{k}$.  Let $2^{d}$ be the largest power of 2 dividing $m-n$, and let $2^{c}$ be the largest power of 2 not exceeding $2 n+1$. Then $2 n+1 \leqslant 2^{c+1}-1$, and so $n+1 \leqslant 2^{c}$. We conclude that $2^{c}$ is one of the numbers $n+1, n+2, \ldots, 2 n+1$, and that it is the only multiple of $2^{c}$ appearing among these numbers. Let $\ell$ be such that $n+\ell=2^{c}$. Since $\frac{m-n}{n+\ell}$ is an integer, we have $d \geqslant c$. Therefore, $2^{d-c+1} \nmid a_{\ell}=\frac{m-n}{n+\ell}$, while $2^{d-c+1} \mid a_{k}$ for all $k \in\{1, \ldots, n+1\} \backslash\{\ell\}$.  Computing modulo $2^{d-c+1}$, we get  $$ P=\left(a_{1}+1\right)\left(a_{2}+1\right) \cdots\left(a_{n+1}+1\right)-1 \equiv\left(a_{\ell}+1\right) \cdot 1^{n}-1 \equiv a_{\ell} \not \equiv 0 \quad\left(\bmod 2^{d-c+1}\right) $$  Therefore, $2^{d-c+1} \nmid P$. On the other hand, for any $k \in\{1, \ldots, n+1\} \backslash\{\ell\}$, we have $2^{d-c+1} \mid a_{k}$. So $P \geqslant a_{k} \geqslant 2^{d-c+1}$, and it follows that $P$ is not a power of 2 .  Comment. Instead of attempting to show that $P$ is not a power of 2 , one may try to find an odd factor of $P$ (greater than 1) as follows:  From $a_{k}=\frac{m-n}{n+k} \in \mathbb{Z}_{>0}$, we get that $m-n$ is divisible by $n+1, n+2, \ldots, 2 n+1$, and thus it is also divisible by their least common multiple $L$. So $m-n=q L$ for some positive integer $q$; hence $x_{k}=q \cdot \frac{L}{n+k}+1$.  Then, since $n+1 \leqslant 2^{c}=n+\ell \leqslant 2 n+1 \leqslant 2^{c+1}-1$, we have $2^{c} \mid L$, but $2^{c+1} \nmid L$. So $\frac{L}{n+\ell}$ is odd, while $\frac{L}{n+k}$ is even for $k \neq \ell$. Computing modulo $2 q$ yields  $$ x_{1} x_{2} \cdots x_{n+1}-1 \equiv(q+1) \cdot 1^{n}-1 \equiv q \quad(\bmod 2 q) $$  Thus, $x_{1} x_{2} \cdots x_{n+1}-1=2 q r+q=q(2 r+1)$ for some integer $r$. Since $x_{1} x_{2} \cdots x_{n+1}-1 \geqslant x_{1} x_{2}-1 \geqslant(q+1)^{2}-1>q$, we have $r \geqslant 1$. This implies that $x_{1} x_{2} \cdots x_{n+1}-1$ is divisible by an odd prime.


Suppose that $a_{0}, a_{1}, \ldots$ and $b_{0}, b_{1}, \ldots$ are two sequences of positive integers satisfying $a_{0}, b_{0} \geqslant 2$ and  $$ a_{n+1}=\operatorname{gcd}\left(a_{n}, b_{n}\right)+1, \quad b_{n+1}=\operatorname{lcm}\left(a_{n}, b_{n}\right)-1 $$  for all $n \geqslant 0$. Prove that the sequence $\left(a_{n}\right)$ is eventually periodic; in other words, there exist integers $N \geqslant 0$ and $t>0$ such that $a_{n+t}=a_{n}$ for all $n \geqslant N$. (France)

Solution: Let $s_{n}=a_{n}+b_{n}$. Notice that if $a_{n} \mid b_{n}$, then $a_{n+1}=a_{n}+1, b_{n+1}=b_{n}-1$ and $s_{n+1}=s_{n}$. So, $a_{n}$ increases by 1 and $s_{n}$ does not change until the first index is reached with $a_{n} \nmid s_{n}$. Define  $$ W_{n}=\left\{m \in \mathbb{Z}_{>0}: m \geqslant a_{n} \text { and } m \nmid s_{n}\right\} \quad \text { and } \quad w_{n}=\min W_{n} $$  Claim 1. The sequence $\left(w_{n}\right)$ is non-increasing. Proof. If $a_{n} \mid b_{n}$ then $a_{n+1}=a_{n}+1$. Due to $a_{n} \mid s_{n}$, we have $a_{n} \notin W_{n}$. Moreover $s_{n+1}=s_{n}$; therefore, $W_{n+1}=W_{n}$ and $w_{n+1}=w_{n}$.  Otherwise, if $a_{n} \nmid b_{n}$, then $a_{n} \nmid s_{n}$, so $a_{n} \in W_{n}$ and thus $w_{n}=a_{n}$. We show that $a_{n} \in W_{n+1}$; this implies $w_{n+1} \leqslant a_{n}=w_{n}$. By the definition of $W_{n+1}$, we need that $a_{n} \geqslant a_{n+1}$ and $a_{n} \nmid s_{n+1}$. The first relation holds because of $\operatorname{gcd}\left(a_{n}, b_{n}\right)<a_{n}$. For the second relation, observe that in $s_{n+1}=\operatorname{gcd}\left(a_{n}, b_{n}\right)+\operatorname{lcm}\left(a_{n}, b_{n}\right)$, the second term is divisible by $a_{n}$, but the first term is not. So $a_{n} \nmid s_{n+1}$; that completes the proof of the claim.  Let $w=\min _{n} w_{n}$ and let $N$ be an index with $w=w_{N}$. Due to Claim 1, we have $w_{n}=w$ for all $n \geqslant N$.  Let $g_{n}=\operatorname{gcd}\left(w, s_{n}\right)$. As we have seen, starting from an arbitrary index $n \geqslant N$, the sequence $a_{n}, a_{n+1}, \ldots$ increases by 1 until it reaches $w$, which is the first value not dividing $s_{n}$; then it drops to $\operatorname{gcd}\left(w, s_{n}\right)+1=g_{n}+1$. Claim 2. The sequence $\left(g_{n}\right)$ is constant for $n \geqslant N$. Proof. If $a_{n} \mid b_{n}$, then $s_{n+1}=s_{n}$ and hence $g_{n+1}=g_{n}$. Otherwise we have $a_{n}=w$,  $$ \begin{aligned} \operatorname{gcd}\left(a_{n}, b_{n}\right) & =\operatorname{gcd}\left(a_{n}, s_{n}\right)=\operatorname{gcd}\left(w, s_{n}\right)=g_{n} \\ s_{n+1} & =\operatorname{gcd}\left(a_{n}, b_{n}\right)+\operatorname{lcm}\left(a_{n}, b_{n}\right)=g_{n}+\frac{a_{n} b_{n}}{g_{n}}=g_{n}+\frac{w\left(s_{n}-w\right)}{g_{n}} \end{aligned} $$  and $\quad g_{n+1}=\operatorname{gcd}\left(w, s_{n+1}\right)=\operatorname{gcd}\left(w, g_{n}+\frac{s_{n}-w}{g_{n}} w\right)=\operatorname{gcd}\left(w, g_{n}\right)=g_{n}$. Let $g=g_{N}$. We have proved that the sequence $\left(a_{n}\right)$ eventually repeats the following cycle:  $$ g+1 \mapsto g+2 \mapsto \ldots \mapsto w \mapsto g+1 $$


Solution: By Claim 1 in the first solution, we have $a_{n} \leqslant w_{n} \leqslant w_{0}$, so the sequence $\left(a_{n}\right)$ is bounded, and hence it has only finitely many values.  Let $M=\operatorname{lcm}\left(a_{1}, a_{2}, \ldots\right)$, and consider the sequence $b_{n}$ modulo $M$. Let $r_{n}$ be the remainder of $b_{n}$, divided by $M$. For every index $n$, since $a_{n}|M| b_{n}-r_{n}$, we have $\operatorname{gcd}\left(a_{n}, b_{n}\right)=\operatorname{gcd}\left(a_{n}, r_{n}\right)$, and therefore  $$ a_{n+1}=\operatorname{gcd}\left(a_{n}, r_{n}\right)+1 $$  Moreover,  $$ \begin{aligned} r_{n+1} & \equiv b_{n+1}=\operatorname{lcm}\left(a_{n}, b_{n}\right)-1=\frac{a_{n}}{\operatorname{gcd}\left(a_{n}, b_{n}\right)} b_{n}-1 \\ & =\frac{a_{n}}{\operatorname{gcd}\left(a_{n}, r_{n}\right)} b_{n}-1 \equiv \frac{a_{n}}{\operatorname{gcd}\left(a_{n}, r_{n}\right)} r_{n}-1 \quad(\bmod M) \end{aligned} $$  Hence, the pair $\left(a_{n}, r_{n}\right)$ uniquely determines the pair $\left(a_{n+1}, r_{n+1}\right)$. Since there are finitely many possible pairs, the sequence of pairs $\left(a_{n}, r_{n}\right)$ is eventually periodic; in particular, the sequence $\left(a_{n}\right)$ is eventually periodic.  Comment. We show that there are only four possibilities for $g$ and $w$ (as defined in Solution 1), namely  $$ (w, g) \in\{(2,1),(3,1),(4,2),(5,1)\} $$  This means that the sequence $\left(a_{n}\right)$ eventually repeats one of the following cycles:  $$ (2), \quad(2,3), \quad(3,4), \quad \text { or } \quad(2,3,4,5) $$  Using the notation of Solution 1 , for $n \geqslant N$ the sequence $\left(a_{n}\right)$ has a cycle $(g+1, g+2, \ldots, w)$ such that $g=\operatorname{gcd}\left(w, s_{n}\right)$. By the observations in the proof of Claim 2, the numbers $g+1, \ldots, w-1$ all divide $s_{n}$; so the number $L=\operatorname{lcm}(g+1, g+2, \ldots, w-1)$ also divides $s_{n}$. Moreover, $g$ also divides $w$.  Now choose any $n \geqslant N$ such that $a_{n}=w$. By (1), we have  $$ s_{n+1}=g+\frac{w\left(s_{n}-w\right)}{g}=s_{n} \cdot \frac{w}{g}-\frac{w^{2}-g^{2}}{g} . $$  Since $L$ divides both $s_{n}$ and $s_{n+1}$, it also divides the number $T=\frac{w^{2}-g^{2}}{g}$. Suppose first that $w \geqslant 6$, which yields $g+1 \leqslant \frac{w}{2}+1 \leqslant w-2$. Then $(w-2)(w-1)|L| T$, so we have either $w^{2}-g^{2} \geqslant 2(w-1)(w-2)$, or $g=1$ and $w^{2}-g^{2}=(w-1)(w-2)$. In the former case we get $(w-1)(w-5)+\left(g^{2}-1\right) \leqslant 0$ which is false by our assumption. The latter equation rewrites as $3 w=3$, so $w=1$, which is also impossible.  Now we are left with the cases when $w \leqslant 5$ and $g \mid w$. The case $(w, g)=(4,1)$ violates the condition $L \left\lvert\, \frac{w^{2}-g^{2}}{g}\right.$; all other such pairs are listed in (2).  In the table below, for each pair $(w, g)$, we provide possible sequences $\left(a_{n}\right)$ and $\left(b_{n}\right)$. That shows that the cycles shown in (3) are indeed possible.  $$ \begin{array}{llll} w=2 & g=1 & a_{n}=2 & b_{n}=2 \cdot 2^{n}+1 \\ w=3 & g=1 & \left(a_{2 k}, a_{2 k+1}\right)=(2,3) & \left(b_{2 k}, b_{2 k+1}\right)=\left(6 \cdot 3^{k}+2,6 \cdot 3^{k}+1\right) \\ w=4 & g=2 & \left(a_{2 k}, a_{2 k+1}\right)=(3,4) & \left(b_{2 k}, b_{2 k+1}\right)=\left(12 \cdot 2^{k}+3,12 \cdot 2^{k}+2\right) \\ w=5 & g=1 & \left(a_{4 k}, \ldots, a_{4 k+3}\right)=(2,3,4,5) & \left(b_{4 k}, \ldots, b_{4 k+3}\right)=\left(6 \cdot 5^{k}+4, \ldots, 6 \cdot 5^{k}+1\right) \end{array} $$  $$ b_{n}=2 \cdot 2^{n}+1 $$


Determine all triples $(a, b, c)$ of positive integers for which $a b-c, b c-a$, and $c a-b$ are powers of 2 .  Explanation: A power of 2 is an integer of the form $2^{n}$, where $n$ denotes some nonnegative integer. (Serbia)

Solution: It can easily be verified that these sixteen triples are as required. Now let ( $a, b, c$ ) be any triple with the desired property. If we would have $a=1$, then both $b-c$ and $c-b$ were powers of 2 , which is impossible since their sum is zero; because of symmetry, this argument shows $a, b, c \geqslant 2$.  Case 1. Among $a, b$, and $c$ there are at least two equal numbers. Without loss of generality we may suppose that $a=b$. Then $a^{2}-c$ and $a(c-1)$ are powers of 2 . The latter tells us that actually $a$ and $c-1$ are powers of 2 . So there are nonnegative integers $\alpha$ and $\gamma$ with $a=2^{\alpha}$ and $c=2^{\gamma}+1$. Since $a^{2}-c=2^{2 \alpha}-2^{\gamma}-1$ is a power of 2 and thus incongruent to -1 modulo 4 , we must have $\gamma \leqslant 1$. Moreover, each of the terms $2^{2 \alpha}-2$ and $2^{2 \alpha}-3$ can only be a power of 2 if $\alpha=1$. It follows that the triple $(a, b, c)$ is either $(2,2,2)$ or $(2,2,3)$.  Case 2. The numbers $a, b$, and $c$ are distinct. Due to symmetry we may suppose that  $$ 2 \leqslant a<b<c . $$  We are to prove that the triple $(a, b, c)$ is either $(2,6,11)$ or $(3,5,7)$. By our hypothesis, there exist three nonnegative integers $\alpha, \beta$, and $\gamma$ such that  $$ \begin{aligned} b c-a & =2^{\alpha}, \\ a c-b & =2^{\beta}, \\ \text { and } \quad a b-c & =2^{\gamma} . \end{aligned} $$  Evidently we have  $$ \alpha>\beta>\gamma . $$  Depending on how large $a$ is, we divide the argument into two further cases. Case 2.1. $\quad a=2$. We first prove that $\gamma=0$. Assume for the sake of contradiction that $\gamma>0$. Then $c$ is even by (4) and, similarly, $b$ is even by (5) and (3). So the left-hand side of (2) is congruent to 2 modulo 4 , which is only possible if $b c=4$. As this contradicts (1), we have thereby shown that $\gamma=0$, i.e., that $c=2 b-1$.  Now (3) yields $3 b-2=2^{\beta}$. Due to $b>2$ this is only possible if $\beta \geqslant 4$. If $\beta=4$, then we get $b=6$ and $c=2 \cdot 6-1=11$, which is a solution. It remains to deal with the case $\beta \geqslant 5$. Now (2) implies  $$ 9 \cdot 2^{\alpha}=9 b(2 b-1)-18=(3 b-2)(6 b+1)-16=2^{\beta}\left(2^{\beta+1}+5\right)-16 $$  and by $\beta \geqslant 5$ the right-hand side is not divisible by 32 . Thus $\alpha \leqslant 4$ and we get a contradiction to (5).  Case 2.2. $\quad a \geqslant 3$. Pick an integer $\vartheta \in\{-1,+1\}$ such that $c-\vartheta$ is not divisible by 4 . Now  $$ 2^{\alpha}+\vartheta \cdot 2^{\beta}=\left(b c-a \vartheta^{2}\right)+\vartheta(c a-b)=(b+a \vartheta)(c-\vartheta) $$  is divisible by $2^{\beta}$ and, consequently, $b+a \vartheta$ is divisible by $2^{\beta-1}$. On the other hand, $2^{\beta}=a c-b>$ $(a-1) c \geqslant 2 c$ implies in view of (1) that $a$ and $b$ are smaller than $2^{\beta-1}$. All this is only possible if $\vartheta=1$ and $a+b=2^{\beta-1}$. Now (3) yields  $$ a c-b=2(a+b) $$  whence $4 b>a+3 b=a(c-1) \geqslant a b$, which in turn yields $a=3$. So (6) simplifies to $c=b+2$ and (2) tells us that $b(b+2)-3=(b-1)(b+3)$ is a power of 2 . Consequently, the factors $b-1$ and $b+3$ are powers of 2 themselves. Since their difference is 4 , this is only possible if $b=5$ and thus $c=7$. Thereby the solution is complete.


Solution: As in the beginning of the first solution, we observe that $a, b, c \geqslant 2$. Depending on the parities of $a, b$, and $c$ we distinguish three cases.  Case 1. The numbers $a, b$, and $c$ are even. Let $2^{A}, 2^{B}$, and $2^{C}$ be the largest powers of 2 dividing $a, b$, and $c$ respectively. We may assume without loss of generality that $1 \leqslant A \leqslant B \leqslant C$. Now $2^{B}$ is the highest power of 2 dividing $a c-b$, whence $a c-b=2^{B} \leqslant b$. Similarly, we deduce $b c-a=2^{A} \leqslant a$. Adding both estimates we get $(a+b) c \leqslant 2(a+b)$, whence $c \leqslant 2$. So $c=2$ and thus $A=B=C=1$; moreover, we must have had equality throughout, i.e., $a=2^{A}=2$ and $b=2^{B}=2$. We have thereby found the solution $(a, b, c)=(2,2,2)$.  Case 2. The numbers $a, b$, and $c$ are odd. If any two of these numbers are equal, say $a=b$, then $a c-b=a(c-1)$ has a nontrivial odd divisor and cannot be a power of 2 . Hence $a, b$, and $c$ are distinct. So we may assume without loss of generality that $a<b<c$.  Let $\alpha$ and $\beta$ denote the nonnegative integers for which $b c-a=2^{\alpha}$ and $a c-b=2^{\beta}$ hold. Clearly, we have $\alpha>\beta$, and thus $2^{\beta}$ divides  $$ a \cdot 2^{\alpha}-b \cdot 2^{\beta}=a(b c-a)-b(a c-b)=b^{2}-a^{2}=(b+a)(b-a) $$  Since $a$ is odd, it is not possible that both factors $b+a$ and $b-a$ are divisible by 4 . Consequently, one of them has to be a multiple of $2^{\beta-1}$. Hence one of the numbers $2(b+a)$ and $2(b-a)$ is divisible by $2^{\beta}$ and in either case we have  $$ a c-b=2^{\beta} \leqslant 2(a+b) $$  This in turn yields $(a-1) b<a c-b<4 b$ and thus $a=3$ (recall that $a$ is odd and larger than 1). Substituting this back into (7) we learn $c \leqslant b+2$. But due to the parity $b<c$ entails that $b+2 \leqslant c$ holds as well. So we get $c=b+2$ and from $b c-a=(b-1)(b+3)$ being a power of 2 it follows that $b=5$ and $c=7$.  Case 3. Among $a, b$, and $c$ both parities occur. Without loss of generality, we suppose that $c$ is odd and that $a \leqslant b$. We are to show that $(a, b, c)$ is either $(2,2,3)$ or $(2,6,11)$. As at least one of $a$ and $b$ is even, the expression $a b-c$ is odd; since it is also a power of 2 , we obtain  $$ a b-c=1 $$  If $a=b$, then $c=a^{2}-1$, and from $a c-b=a\left(a^{2}-2\right)$ being a power of 2 it follows that both $a$ and $a^{2}-2$ are powers of 2 , whence $a=2$. This gives rise to the solution $(2,2,3)$.  We may suppose $a<b$ from now on. As usual, we let $\alpha>\beta$ denote the integers satisfying  $$ 2^{\alpha}=b c-a \quad \text { and } \quad 2^{\beta}=a c-b $$  If $\beta=0$ it would follow that $a c-b=a b-c=1$ and hence that $b=c=1$, which is absurd. So $\beta$ and $\alpha$ are positive and consequently $a$ and $b$ are even. Substituting $c=a b-1$ into (9) we obtain  $$ \begin{aligned} 2^{\alpha} & =a b^{2}-(a+b), \\ \text { and } \quad 2^{\beta} & =a^{2} b-(a+b) . \end{aligned} $$  The addition of both equation yields $2^{\alpha}+2^{\beta}=(a b-2)(a+b)$. Now $a b-2$ is even but not divisible by 4 , so the highest power of 2 dividing $a+b$ is $2^{\beta-1}$. For this reason, the equations (10) and (11) show that the highest powers of 2 dividing either of the numbers $a b^{2}$ and $a^{2} b$ is likewise $2^{\beta-1}$. Thus there is an integer $\tau \geqslant 1$ together with odd integers $A, B$, and $C$ such that $a=2^{\tau} A, b=2^{\tau} B, a+b=2^{3 \tau} C$, and $\beta=1+3 \tau$.  Notice that $A+B=2^{2 \tau} C \geqslant 4 C$. Moreover, (11) entails $A^{2} B-C=2$. Thus $8=$ $4 A^{2} B-4 C \geqslant 4 A^{2} B-A-B \geqslant A^{2}(3 B-1)$. Since $A$ and $B$ are odd with $A<B$, this is only possible if $A=1$ and $B=3$. Finally, one may conclude $C=1, \tau=1, a=2, b=6$, and $c=11$. We have thereby found the triple $(2,6,11)$. This completes the discussion of the third case, and hence the solution.  Comment. In both solutions, there are many alternative ways to proceed in each of its cases. Here we present a different treatment of the part " $a<b$ " of Case 3 in Solution 2, assuming that (8) and (9) have already been written down:  Put $d=\operatorname{gcd}(a, b)$ and define the integers $p$ and $q$ by $a=d p$ and $b=d q$; notice that $p<q$ and $\operatorname{gcd}(p, q)=1$. Now (8) implies $c=d^{2} p q-1$ and thus we have  $$ \begin{aligned} & 2^{\alpha} \\ & =d\left(d^{2} p q^{2}-p-q\right) \\ \text { and } \quad 2^{\beta} & =d\left(d^{2} p^{2} q-p-q\right) . \end{aligned} $$  Now $2^{\beta}$ divides $2^{\alpha}-2^{\beta}=d^{3} p q(q-p)$ and, as $p$ and $q$ are easily seen to be coprime to $d^{2} p^{2} q-p-q$, it follows that  $$ \left(d^{2} p^{2} q-p-q\right) \mid d^{2}(q-p) $$  In particular, we have $d^{2} p^{2} q-p-q \leqslant d^{2}(q-p)$, i.e., $d^{2}\left(p^{2} q+p-q\right) \leqslant p+q$. As $p^{2} q+p-q>0$, this may be weakened to $p^{2} q+p-q \leqslant p+q$. Hence $p^{2} q \leqslant 2 q$, which is only possible if $p=1$.  Going back to (13), we get  $$ \left(d^{2} q-q-1\right) \mid d^{2}(q-1) $$  Now $2\left(d^{2} q-q-1\right) \leqslant d^{2}(q-1)$ would entail $d^{2}(q+1) \leqslant 2(q+1)$ and thus $d=1$. But this would tell us that $a=d p=1$, which is absurd. This argument proves $2\left(d^{2} q-q-1\right)>d^{2}(q-1)$ and in the light of (14) it follows that $d^{2} q-q-1=d^{2}(q-1)$, i.e., $q=d^{2}-1$. Plugging this together with $p=1$ into (12) we infer $2^{\beta}=d^{3}\left(d^{2}-2\right)$. Hence $d$ and $d^{2}-2$ are powers of 2 . Consequently, $d=2, q=3$, $a=2, b=6$, and $c=11$, as desired.


Let $\mathbb{Z}_{>0}$ denote the set of positive integers. Consider a function $f: \mathbb{Z}_{>0} \rightarrow \mathbb{Z}_{>0}$. For any $m, n \in \mathbb{Z}_{>0}$ we write $f^{n}(m)=\underbrace{f(f(\ldots f}_{n}(m) \ldots))$. Suppose that $f$ has the following two properties: (i) If $m, n \in \mathbb{Z}_{>0}$, then $\frac{f^{n}(m)-m}{n} \in \mathbb{Z}_{>0}$; (ii) The set $\mathbb{Z}_{>0} \backslash\left\{f(n) \mid n \in \mathbb{Z}_{>0}\right\}$ is finite.  Prove that the sequence $f(1)-1, f(2)-2, f(3)-3, \ldots$ is periodic. (Singapore)

Solution: We split the solution into three steps. In the first of them, we show that the function $f$ is injective and explain how this leads to a useful visualization of $f$. Then comes the second step, in which most of the work happens: its goal is to show that for any $n \in \mathbb{Z}_{>0}$ the sequence $n, f(n), f^{2}(n), \ldots$ is an arithmetic progression. Finally, in the third step we put everything together, thus solving the problem. $\underline{\text { Step 1. We commence by checking that } f \text { is injective. For this purpose, we consider any }}$ $m, k \in \mathbb{Z}_{>0}$ with $f(m)=f(k)$. By $(i)$, every positive integer $n$ has the property that  $$ \frac{k-m}{n}=\frac{f^{n}(m)-m}{n}-\frac{f^{n}(k)-k}{n} $$  is a difference of two integers and thus integral as well. But for $n=|k-m|+1$ this is only possible if $k=m$. Thereby, the injectivity of $f$ is established.  Now recall that due to condition (ii) there are finitely many positive integers $a_{1}, \ldots, a_{k}$ such that $\mathbb{Z}_{>0}$ is the disjoint union of $\left\{a_{1}, \ldots, a_{k}\right\}$ and $\left\{f(n) \mid n \in \mathbb{Z}_{>0}\right\}$. Notice that by plugging $n=1$ into condition $(i)$ we get $f(m)>m$ for all $m \in \mathbb{Z}_{>0}$.  We contend that every positive integer $n$ may be expressed uniquely in the form $n=f^{j}\left(a_{i}\right)$ for some $j \geqslant 0$ and $i \in\{1, \ldots, k\}$. The uniqueness follows from the injectivity of $f$. The existence can be proved by induction on $n$ in the following way. If $n \in\left\{a_{1}, \ldots, a_{k}\right\}$, then we may take $j=0$; otherwise there is some $n^{\prime}<n$ with $f\left(n^{\prime}\right)=n$ to which the induction hypothesis may be applied.  The result of the previous paragraph means that every positive integer appears exactly once in the following infinite picture, henceforth referred to as "the Table":  | $a_{1}$ | $f\left(a_{1}\right)$ | $f^{2}\left(a_{1}\right)$ | $f^{3}\left(a_{1}\right)$ | $\ldots$ | | :---: | :---: | :---: | :---: | :---: | | $a_{2}$ | $f\left(a_{2}\right)$ | $f^{2}\left(a_{2}\right)$ | $f^{3}\left(a_{2}\right)$ | $\ldots$ | | $\vdots$ | $\vdots$ | $\vdots$ | $\vdots$ |  | | $a_{k}$ | $f\left(a_{k}\right)$ | $f^{2}\left(a_{k}\right)$ | $f^{3}\left(a_{k}\right)$ | $\ldots$ |  The Table  Step 2. Our next goal is to prove that each row of the Table is an arithmetic progression. Assume contrariwise that the number $t$ of rows which are arithmetic progressions would satisfy $0 \leqslant t<k$. By permuting the rows if necessary we may suppose that precisely the first $t$ rows are arithmetic progressions, say with steps $T_{1}, \ldots, T_{t}$. Our plan is to find a further row that is "not too sparse" in an asymptotic sense, and then to prove that such a row has to be an arithmetic progression as well.  Let us write $T=\operatorname{lcm}\left(T_{1}, T_{2}, \ldots, T_{t}\right)$ and $A=\max \left\{a_{1}, a_{2}, \ldots, a_{t}\right\}$ if $t>0$; and $T=1$ and $A=0$ if $t=0$. For every integer $n \geqslant A$, the interval $\Delta_{n}=[n+1, n+T]$ contains exactly $T / T_{i}$ elements of the $i^{\text {th }}$ row $(1 \leqslant i \leqslant t)$. Therefore, the number of elements from the last $(k-t)$ rows of the Table contained in $\Delta_{n}$ does not depend on $n \geqslant A$. It is not possible that none of these intervals $\Delta_{n}$ contains an element from the $k-t$ last rows, because infinitely many numbers appear in these rows. It follows that for each $n \geqslant A$ the interval $\Delta_{n}$ contains at least one member from these rows.  This yields that for every positive integer $d$, the interval $[A+1, A+(d+1)(k-t) T]$ contains at least $(d+1)(k-t)$ elements from the last $k-t$ rows; therefore, there exists an index $x$ with $t+1 \leqslant x \leqslant k$, possibly depending on $d$, such that our interval contains at least $d+1$ elements from the $x^{\text {th }}$ row. In this situation we have  $$ f^{d}\left(a_{x}\right) \leqslant A+(d+1)(k-t) T . $$  Finally, since there are finitely many possibilities for $x$, there exists an index $x \geqslant t+1$ such that the set  $$ X=\left\{d \in \mathbb{Z}_{>0} \mid f^{d}\left(a_{x}\right) \leqslant A+(d+1)(k-t) T\right\} $$  is infinite. Thereby we have found the "dense row" promised above. By assumption $(i)$, for every $d \in X$ the number  $$ \beta_{d}=\frac{f^{d}\left(a_{x}\right)-a_{x}}{d} $$  is a positive integer not exceeding  $$ \frac{A+(d+1)(k-t) T}{d} \leqslant \frac{A d+2 d(k-t) T}{d}=A+2(k-t) T $$  This leaves us with finitely many choices for $\beta_{d}$, which means that there exists a number $T_{x}$ such that the set  $$ Y=\left\{d \in X \mid \beta_{d}=T_{x}\right\} $$  is infinite. Notice that we have $f^{d}\left(a_{x}\right)=a_{x}+d \cdot T_{x}$ for all $d \in Y$. Now we are prepared to prove that the numbers in the $x^{\text {th }}$ row form an arithmetic progression, thus coming to a contradiction with our assumption. Let us fix any positive integer $j$. Since the set $Y$ is infinite, we can choose a number $y \in Y$ such that $y-j>\left|f^{j}\left(a_{x}\right)-\left(a_{x}+j T_{x}\right)\right|$. Notice that both numbers  $$ f^{y}\left(a_{x}\right)-f^{j}\left(a_{x}\right)=f^{y-j}\left(f^{j}\left(a_{x}\right)\right)-f^{j}\left(a_{x}\right) \quad \text { and } \quad f^{y}\left(a_{x}\right)-\left(a_{x}+j T_{x}\right)=(y-j) T_{x} $$  are divisible by $y-j$. Thus, the difference between these numbers is also divisible by $y-j$. Since the absolute value of this difference is less than $y-j$, it has to vanish, so we get $f^{j}\left(a_{x}\right)=$ $a_{x}+j \cdot T_{x}$.  Hence, it is indeed true that all rows of the Table are arithmetic progressions. Step 3. Keeping the above notation in force, we denote the step of the $i^{\text {th }}$ row of the table by $T_{i}$. Now we claim that we have $f(n)-n=f(n+T)-(n+T)$ for all $n \in \mathbb{Z}_{>0}$, where  $$ T=\operatorname{lcm}\left(T_{1}, \ldots, T_{k}\right) $$  To see this, let any $n \in \mathbb{Z}_{>0}$ be given and denote the index of the row in which it appears in the Table by $i$. Then we have $f^{j}(n)=n+j \cdot T_{i}$ for all $j \in \mathbb{Z}_{>0}$, and thus indeed  $$ f(n+T)-f(n)=f^{1+T / T_{i}}(n)-f(n)=\left(n+T+T_{i}\right)-\left(n+T_{i}\right)=T $$  This concludes the solution.  Comment 1. There are some alternative ways to complete the second part once the index $x$ corresponding to a "dense row" is found. For instance, one may show that for some integer $T_{x}^{*}$ the set  $$ Y^{*}=\left\{j \in \mathbb{Z}_{>0} \mid f^{j+1}\left(a_{x}\right)-f^{j}\left(a_{x}\right)=T_{x}^{*}\right\} $$  is infinite, and then one may conclude with a similar divisibility argument. Comment 2. It may be checked that, conversely, any way to fill out the Table with finitely many arithmetic progressions so that each positive integer appears exactly once, gives rise to a function $f$ satisfying the two conditions mentioned in the problem. For example, we may arrange the positive integers as follows:  | 2 | 4 | 6 | 8 | 10 | $\ldots$ | | :---: | :---: | :---: | :---: | :---: | :---: | | 1 | 5 | 9 | 13 | 17 | $\ldots$ | | 3 | 7 | 11 | 15 | 19 | $\ldots$ |  This corresponds to the function  $$ f(n)= \begin{cases}n+2 & \text { if } n \text { is even } \\ n+4 & \text { if } n \text { is odd }\end{cases} $$  As this example shows, it is not true that the function $n \mapsto f(n)-n$ has to be constant.


Let $\mathbb{Z}_{>0}$ denote the set of positive integers. For any positive integer $k$, a function $f: \mathbb{Z}_{>0} \rightarrow \mathbb{Z}_{>0}$ is called $k$-good if $\operatorname{gcd}(f(m)+n, f(n)+m) \leqslant k$ for all $m \neq n$. Find all $k$ such that there exists a $k$-good function. (Canada)

Solution: For any function $f: \mathbb{Z}_{>0} \rightarrow \mathbb{Z}_{>0}$, let $G_{f}(m, n)=\operatorname{gcd}(f(m)+n, f(n)+m)$. Note that a $k$-good function is also $(k+1)$-good for any positive integer $k$. Hence, it suffices to show that there does not exist a 1-good function and that there exists a 2-good function.  We first show that there is no 1 -good function. Suppose that there exists a function $f$ such that $G_{f}(m, n)=1$ for all $m \neq n$. Now, if there are two distinct even numbers $m$ and $n$ such that $f(m)$ and $f(n)$ are both even, then $2 \mid G_{f}(m, n)$, a contradiction. A similar argument holds if there are two distinct odd numbers $m$ and $n$ such that $f(m)$ and $f(n)$ are both odd. Hence we can choose an even $m$ and an odd $n$ such that $f(m)$ is odd and $f(n)$ is even. This also implies that $2 \mid G_{f}(m, n)$, a contradiction.  We now construct a 2-good function. Define $f(n)=2^{g(n)+1}-n-1$, where $g$ is defined recursively by $g(1)=1$ and $g(n+1)=\left(2^{g(n)+1}\right)!$.  For any positive integers $m>n$, set  $$ A=f(m)+n=2^{g(m)+1}-m+n-1, \quad B=f(n)+m=2^{g(n)+1}-n+m-1 $$  We need to show that $\operatorname{gcd}(A, B) \leqslant 2$. First, note that $A+B=2^{g(m)+1}+2^{g(n)+1}-2$ is not divisible by 4 , so that $4 \nmid \operatorname{gcd}(A, B)$. Now we suppose that there is an odd prime $p$ for which $p \mid \operatorname{gcd}(A, B)$ and derive a contradiction.  We first claim that $2^{g(m-1)+1} \geqslant B$. This is a rather weak bound; one way to prove it is as follows. Observe that $g(k+1)>g(k)$ and hence $2^{g(k+1)+1} \geqslant 2^{g(k)+1}+1$ for every positive integer $k$. By repeatedly applying this inequality, we obtain $2^{g(m-1)+1} \geqslant 2^{g(n)+1}+(m-1)-n=B$.  Now, since $p \mid B$, we have $p-1<B \leqslant 2^{g(m-1)+1}$, so that $p-1 \mid\left(2^{g(m-1)+1}\right)!=g(m)$. Hence $2^{g(m)} \equiv 1(\bmod p)$, which yields $A+B \equiv 2^{g(n)+1}(\bmod p)$. However, since $p \mid A+B$, this implies that $p=2$, a contradiction.


Solution: We provide an alternative construction of a 2 -good function $f$. Let $\mathcal{P}$ be the set consisting of 4 and all odd primes. For every $p \in \mathcal{P}$, we say that a number $a \in\{0,1, \ldots, p-1\}$ is $p$-useful if $a \not \equiv-a(\bmod p)$. Note that a residue modulo $p$ which is neither 0 nor 2 is $p$-useful (the latter is needed only when $p=4$ ).  We will construct $f$ recursively; in some steps, we will also define a $p$-useful number $a_{p}$. After the $m^{\text {th }}$ step, the construction will satisfy the following conditions: ( $i$ ) The values of $f(n)$ have already been defined for all $n \leqslant m$, and $p$-useful numbers $a_{p}$ have already been defined for all $p \leqslant m+2$; (ii) If $n \leqslant m$ and $p \leqslant m+2$, then $f(n)+n \not \equiv a_{p}(\bmod p)$; (iii) $\operatorname{gcd}\left(f\left(n_{1}\right)+n_{2}, f\left(n_{2}\right)+n_{1}\right) \leqslant 2$ for all $n_{1}<n_{2} \leqslant m$.  If these conditions are satisfied, then $f$ will be a 2 -good function. ![](https://cdn.mathpix.com/cropped/2024_11_18_62dbd531c72d0ff8164cg-77.jpg?height=63&width=1320&top_left_y=2547&top_left_x=185) ![](https://cdn.mathpix.com/cropped/2024_11_18_62dbd531c72d0ff8164cg-77.jpg?height=64&width=1551&top_left_y=2618&top_left_x=184) Defining $f(m)$. Let $X_{m}=\{p \in \mathcal{P}: p \mid f(n)+m$ for some $n<m\}$. We will determine $f(m) \bmod p$ for all $p \in X_{m}$ and then choose $f(m)$ using the Chinese Remainder Theorem.  Take any $p \in X_{m}$. If $p \leqslant m+1$, then we define $f(m) \equiv-a_{p}-m(\bmod p)$. Otherwise, if $p \geqslant m+2$, then we define $f(m) \equiv 0(\bmod p)$. Defining $a_{m+2}$. Now let $p=m+2$ and suppose that $p \in \mathcal{P}$. We choose $a_{p}$ to be a residue modulo $p$ that is not congruent to 0,2 , or $f(n)+n$ for any $n \leqslant m$. Since $f(1)+1=2$, there are at most $m+1<p$ residues to avoid, so we can always choose a remaining residue.  We first check that $(i i)$ is satisfied. We only need to check it if $p=m+2$ or $n=m$. In the former case, we have $f(n)+n \not \equiv a_{p}(\bmod p)$ by construction. In the latter case, if $n=m$ and $p \leqslant m+1$, then we have $f(m)+m \equiv-a_{p} \not \equiv a_{p}(\bmod p)$, where we make use of the fact that $a_{p}$ is $p$-useful.  Now we check that (iii) holds. Suppose, to the contrary, that $p \mid \operatorname{gcd}(f(n)+m, f(m)+n)$ for some $n<m$. Then $p \in X_{m}$ and $p \mid f(m)+n$. If $p \geqslant m+2$, then $0 \equiv f(m)+n \equiv n(\bmod p)$, which is impossible since $n<m<p$.  Otherwise, if $p \leqslant m+1$, then  $$ 0 \equiv(f(m)+n)+(f(n)+m) \equiv(f(n)+n)+(f(m)+m) \equiv(f(n)+n)-a_{p} \quad(\bmod p) $$  This implies that $f(n)+n \equiv a_{p}(\bmod p)$, a contradiction with $(i i)$. Comment 1. For any $p \in \mathcal{P}$, we may also define $a_{p}$ at step $m$ for an arbitrary $m \leqslant p-2$. The construction will work as long as we define a finite number of $a_{p}$ at each step.  Comment 2. When attempting to construct a 2 -good function $f$ recursively, the following way seems natural. Start with setting $f(1)=1$. Next, for each integer $m>1$, introduce the set $X_{m}$ like in Solution 2 and define $f(m)$ so as to satisfy  $$ \begin{array}{rll} f(m) \equiv f(m-p) & (\bmod p) & \text { for all } p \in X_{m} \text { with } p<m, \quad \text { and } \\ f(m) \equiv 0 & (\bmod p) & \text { for all } p \in X_{m} \text { with } p \geqslant m \end{array} $$  This construction might seem to work. Indeed, consider a fixed $p \in \mathcal{P}$, and suppose that $p$ divides $\operatorname{gcd}(f(n)+m, f(m)+n)$ for some $n<m$. Choose such $m$ and $n$ so that $\max (m, n)$ is minimal. Then $p \in X_{m}$. We can check that $p<m$, so that the construction implies that $p$ divides $\operatorname{gcd}(f(n)+(m-p), f(m-p)+n)$. Since $\max (n, m-p)<\max (m, n)$, this almost leads to a contradiction - the only trouble is the possibility that $n=m-p$. However, this flaw may happen to be not so easy to fix.  We will present one possible way to repair this argument in the next comment. Comment 3. There are many recursive constructions for a 2 -good function $f$. Here we sketch one general approach which may be specified in different ways. For convenience, we denote by $\mathbb{Z}_{p}$ the set of residues modulo $p$; all operations on elements of $\mathbb{Z}_{p}$ are also performed modulo $p$.  The general structure is the same as in Solution 2, i.e. using the Chinese Remainder Theorem to successively determine $f(m)$. But instead of designating a common "safe" residue $a_{p}$ for future steps, we act as follows.  For every $p \in \mathcal{P}$, in some step of the process we define $p$ subsets $B_{p}^{(1)}, B_{p}^{(2)}, \ldots, B_{p}^{(p)} \subset \mathbb{Z}_{p}$. The meaning of these sets is that $f(m)+m$ should be congruent to some element in $B_{p}^{(i)}$ whenever $m \equiv i(\bmod p)$ for $i \in \mathbb{Z}_{p}$. Moreover, in every such subset we specify a safe element $b_{p}^{(i)} \in B_{p}^{(i)}$. The meaning now is that in future steps, it is safe to set $f(m)+m \equiv b_{p}^{(i)}(\bmod p)$ whenever $m \equiv i(\bmod p)$. In view of $(1)$, this safety will follow from the condition that $p \nmid \operatorname{gcd}\left(b_{p}^{(i)}+(j-i), c^{(j)}-(j-i)\right)$ for all $j \in \mathbb{Z}_{p}$ and all $c^{(j)} \in B_{p}^{(j)}$. In turn, this condition can be rewritten as  $$ -b_{p}^{(i)} \notin B_{p}^{(j)}, \quad \text { where } \quad j \equiv i-b_{p}^{(i)} \quad(\bmod p) $$  The construction in Solution 2 is equivalent to setting $b_{p}^{(i)}=-a_{p}$ and $B_{p}^{(i)}=\mathbb{Z}_{p} \backslash\left\{a_{p}\right\}$ for all $i$. However, there are different, more technical specifications of our approach.  One may view the (incomplete) construction in Comment 2 as defining $B_{p}^{(i)}$ and $b_{p}^{(i)}$ at step $p-1$ by setting $B_{p}^{(0)}=\left\{b_{p}^{(0)}\right\}=\{0\}$ and $B_{p}^{(i)}=\left\{b_{p}^{(i)}\right\}=\{f(i)+i \bmod p\}$ for every $i=1,2, \ldots, p-1$. However, this construction violates (2) as soon as some number of the form $f(i)+i$ is divisible by some $p$ with $i+2 \leqslant p \in \mathcal{P}$, since then $-b_{p}^{(i)}=b_{p}^{(i)} \in B_{p}^{(i)}$.  Here is one possible way to repair this construction. For all $p \in \mathcal{P}$, we define the sets $B_{p}^{(i)}$ and the elements $b_{p}^{(i)}$ at step $(p-2)$ as follows. Set $B_{p}^{(1)}=\left\{b_{p}^{(1)}\right\}=\{2\}$ and $B_{p}^{(-1)}=B_{p}^{(0)}=\left\{b_{p}^{(-1)}\right\}=\left\{b_{p}^{(0)}\right\}=$ $\{-1\}$. Next, for all $i=2, \ldots, p-2$, define $B_{p}^{(i)}=\{i, f(i)+i \bmod p\}$ and $b_{p}^{(i)}=i$. One may see that these definitions agree with both (1) and (2).


For every positive integer $n$ with prime factorization $n=\prod_{i=1}^{k} p_{i}^{\alpha_{i}}$, define  $$ \mho(n)=\sum_{i: p_{i}>10^{100}} \alpha_{i} . $$  That is, $\mho(n)$ is the number of prime factors of $n$ greater than $10^{100}$, counted with multiplicity. Find all strictly increasing functions $f: \mathbb{Z} \rightarrow \mathbb{Z}$ such that  $$ \mho(f(a)-f(b)) \leqslant \mho(a-b) \quad \text { for all integers } a \text { and } b \text { with } a>b . $$

Solution: A straightforward check shows that all the functions listed in the answer satisfy the problem condition. It remains to show the converse.  Assume that $f$ is a function satisfying the problem condition. Notice that the function $g(x)=f(x)-f(0)$ also satisfies this condition. Replacing $f$ by $g$, we assume from now on that $f(0)=0$; then $f(n)>0$ for any positive integer $n$. Thus, we aim to prove that there exists a positive integer $a$ with $\mho(a)=0$ such that $f(n)=a n$ for all $n \in \mathbb{Z}$.  We start by introducing some notation. Set $N=10^{100}$. We say that a prime $p$ is large if $p>N$, and $p$ is small otherwise; let $\mathcal{S}$ be the set of all small primes. Next, we say that a positive integer is large or small if all its prime factors are such (thus, the number 1 is the unique number which is both large and small). For a positive integer $k$, we denote the greatest large divisor of $k$ and the greatest small divisor of $k$ by $L(k)$ and $S(k)$, respectively; thus, $k=L(k) S(k)$.  We split the proof into three steps. Step 1. We prove that for every large $k$, we have $k|f(a)-f(b) \Longleftrightarrow k| a-b$. In other words, $L(f(a)-f(b))=L(a-b)$ for all integers $a$ and $b$ with $a>b$.  We use induction on $k$. The base case $k=1$ is trivial. For the induction step, assume that $k_{0}$ is a large number, and that the statement holds for all large numbers $k$ with $k<k_{0}$. Claim 1. For any integers $x$ and $y$ with $0<x-y<k_{0}$, the number $k_{0}$ does not divide $f(x)-f(y)$. Proof. Assume, to the contrary, that $k_{0} \mid f(x)-f(y)$. Let $\ell=L(x-y)$; then $\ell \leqslant x-y<k_{0}$. By the induction hypothesis, $\ell \mid f(x)-f(y)$, and thus $\operatorname{lcm}\left(k_{0}, \ell\right) \mid f(x)-f(y)$. Notice that $\operatorname{lcm}\left(k_{0}, \ell\right)$ is large, and $\operatorname{lcm}\left(k_{0}, \ell\right) \geqslant k_{0}>\ell$. But then  $$ \mho(f(x)-f(y)) \geqslant \mho\left(\operatorname{lcm}\left(k_{0}, \ell\right)\right)>\mho(\ell)=\mho(x-y), $$  which is impossible. Now we complete the induction step. By Claim 1, for every integer $a$ each of the sequences  $$ f(a), f(a+1), \ldots, f\left(a+k_{0}-1\right) \quad \text { and } \quad f(a+1), f(a+2), \ldots, f\left(a+k_{0}\right) $$  forms a complete residue system modulo $k_{0}$. This yields $f(a) \equiv f\left(a+k_{0}\right)\left(\bmod k_{0}\right)$. Thus, $f(a) \equiv f(b)\left(\bmod k_{0}\right)$ whenever $a \equiv b\left(\bmod k_{0}\right)$.  Finally, if $a \not \equiv b\left(\bmod k_{0}\right)$ then there exists an integer $b^{\prime}$ such that $b^{\prime} \equiv b\left(\bmod k_{0}\right)$ and $\left|a-b^{\prime}\right|<k_{0}$. Then $f(b) \equiv f\left(b^{\prime}\right) \not f(a)\left(\bmod k_{0}\right)$. The induction step is proved. Step 2. We prove that for some small integer a there exist infinitely many integers $n$ such that $\overline{f(n)}=$ an. In other words, $f$ is linear on some infinite set.  We start with the following general statement.  Claim 2. There exists a constant $c$ such that $f(t)<c t$ for every positive integer $t>N$. Proof. Let $d$ be the product of all small primes, and let $\alpha$ be a positive integer such that $2^{\alpha}>f(N)$. Then, for every $p \in \mathcal{S}$ the numbers $f(0), f(1), \ldots, f(N)$ are distinct modulo $p^{\alpha}$. Set $P=d^{\alpha}$ and $c=P+f(N)$.  Choose any integer $t>N$. Due to the choice of $\alpha$, for every $p \in \mathcal{S}$ there exists at most one nonnegative integer $i \leqslant N$ with $p^{\alpha} \mid f(t)-f(i)$. Since $|\mathcal{S}|<N$, we can choose a nonnegative integer $j \leqslant N$ such that $p^{\alpha} \nmid f(t)-f(j)$ for all $p \in \mathcal{S}$. Therefore, $S(f(t)-f(j))<P$.  On the other hand, Step 1 shows that $L(f(t)-f(j))=L(t-j) \leqslant t-j$. Since $0 \leqslant j \leqslant N$, this yields  $$ f(t)=f(j)+L(f(t)-f(j)) \cdot S(f(t)-f(j))<f(N)+(t-j) P \leqslant(P+f(N)) t=c t . $$  Now let $\mathcal{T}$ be the set of large primes. For every $t \in \mathcal{T}$, Step 1 implies $L(f(t))=t$, so the ratio $f(t) / t$ is an integer. Now Claim 2 leaves us with only finitely many choices for this ratio, which means that there exists an infinite subset $\mathcal{T}^{\prime} \subseteq \mathcal{T}$ and a positive integer $a$ such that $f(t)=a t$ for all $t \in \mathcal{T}^{\prime}$, as required.  Since $L(t)=L(f(t))=L(a) L(t)$ for all $t \in \mathcal{T}^{\prime}$, we get $L(a)=1$, so the number $a$ is small. Step 3. We show that $f(x)=$ ax for all $x \in \mathbb{Z}$. Let $R_{i}=\{x \in \mathbb{Z}: x \equiv i(\bmod N!)\}$ denote the residue class of $i$ modulo $N!$. Claim 3. Assume that for some $r$, there are infinitely many $n \in R_{r}$ such that $f(n)=a n$. Then $f(x)=a x$ for all $x \in R_{r+1}$. Proof. Choose any $x \in R_{r+1}$. By our assumption, we can select $n \in R_{r}$ such that $f(n)=a n$ and $|n-x|>|f(x)-a x|$. Since $n-x \equiv r-(r+1)=-1(\bmod N!)$, the number $|n-x|$ is large. Therefore, by Step 1 we have $f(x) \equiv f(n)=a n \equiv a x(\bmod n-x)$, so $n-x \mid f(x)-a x$. Due to the choice of $n$, this yields $f(x)=a x$.  To complete Step 3, notice that the set $\mathcal{T}^{\prime}$ found in Step 2 contains infinitely many elements of some residue class $R_{i}$. Applying Claim 3, we successively obtain that $f(x)=a x$ for all $x \in R_{i+1}, R_{i+2}, \ldots, R_{i+N!}=R_{i}$. This finishes the solution.  Comment 1. As the proposer also mentions, one may also consider the version of the problem where the condition (1) is replaced by the condition that $L(f(a)-f(b))=L(a-b)$ for all integers $a$ and $b$ with $a>b$. This allows to remove of Step 1 from the solution.  Comment 2. Step 2 is the main step of the solution. We sketch several different approaches allowing to perform this step using statements which are weaker than Claim 2. Approach 1. Let us again denote the product of all small primes by $d$. We focus on the values $f\left(d^{i}\right)$, $i \geqslant 0$. In view of Step 1, we have $L\left(f\left(d^{i}\right)-f\left(d^{k}\right)\right)=L\left(d^{i}-d^{k}\right)=d^{i-k}-1$ for all $i>k \geqslant 0$.  Acting similarly to the beginning of the proof of Claim 2, one may choose a number $\alpha \geqslant 0$ such that the residues of the numbers $f\left(d^{i}\right), i=0,1, \ldots, N$, are distinct modulo $p^{\alpha}$ for each $p \in \mathcal{S}$. Then, for every $i>N$, there exists an exponent $k=k(i) \leqslant N$ such that $S\left(f\left(d^{i}\right)-f\left(d^{k}\right)\right)<P=d^{\alpha}$.  Since there are only finitely many options for $k(i)$, as well as for the corresponding numbers $S\left(f\left(d^{i}\right)-f\left(d^{k}\right)\right)$, there exists an infinite set $I$ of exponents $i>N$ such that $k(i)$ attains the same value $k_{0}$ for all $i \in I$, and such that, moreover, $S\left(f\left(d^{i}\right)-f\left(d^{k_{0}}\right)\right)$ attains the same value $s_{0}$ for all $i \in I$. Therefore, for all such $i$ we have  $$ f\left(d^{i}\right)=f\left(d^{k_{0}}\right)+L\left(f\left(d^{i}\right)-f\left(d^{k_{0}}\right)\right) \cdot S\left(f\left(d^{i}\right)-f\left(d^{k_{0}}\right)\right)=f\left(d^{k_{0}}\right)+\left(d^{i-k_{0}}-1\right) s_{0}, $$  which means that $f$ is linear on the infinite set $\left\{d^{i}: i \in I\right\}$ (although with rational coefficients). Finally, one may implement the relation $f\left(d^{i}\right) \equiv f(1)\left(\bmod d^{i}-1\right)$ in order to establish that in fact $f\left(d^{i}\right) / d^{i}$ is a (small and fixed) integer for all $i \in I$.  Approach 2. Alternatively, one may start with the following lemma. Lemma. There exists a positive constant $c$ such that  $$ L\left(\prod_{i=1}^{3 N}(f(k)-f(i))\right)=\prod_{i=1}^{3 N} L(f(k)-f(i)) \geqslant c(f(k))^{2 N} $$  for all $k>3 N$. Proof. Let $k$ be an integer with $k>3 N$. Set $\Pi=\prod_{i=1}^{3 N}(f(k)-f(i))$. Notice that for every prime $p \in \mathcal{S}$, at most one of the numbers in the set  $$ \mathcal{H}=\{f(k)-f(i): 1 \leqslant i \leqslant 3 N\} $$  is divisible by a power of $p$ which is greater than $f(3 N)$; we say that such elements of $\mathcal{H}$ are bad. Now, for each element $h \in \mathcal{H}$ which is not bad we have $S(h) \leqslant f(3 N)^{N}$, while the bad elements do not exceed $f(k)$. Moreover, there are less than $N$ bad elements in $\mathcal{H}$. Therefore,  $$ S(\Pi)=\prod_{h \in \mathcal{H}} S(h) \leqslant(f(3 N))^{3 N^{2}} \cdot(f(k))^{N} . $$  This easily yields the lemma statement in view of the fact that $L(\Pi) S(\Pi)=\Pi \geqslant \mu(f(k))^{3 N}$ for some absolute constant $\mu$.  As a corollary of the lemma, one may get a weaker version of Claim 2 stating that there exists a positive constant $C$ such that $f(k) \leqslant C k^{3 / 2}$ for all $k>3 N$. Indeed, from Step 1 we have  $$ k^{3 N} \geqslant \prod_{i=1}^{3 N} L(k-i)=\prod_{i=1}^{3 N} L(f(k)-f(i)) \geqslant c(f(k))^{2 N} $$  so $f(k) \leqslant c^{-1 /(2 N)} k^{3 / 2}$. To complete Step 2 now, set $a=f(1)$. Due to the estimates above, we may choose a positive integer $n_{0}$ such that $|f(n)-a n|<\frac{n(n-1)}{2}$ for all $n \geqslant n_{0}$.  Take any $n \geqslant n_{0}$ with $n \equiv 2(\bmod N!)$. Then $L(f(n)-f(0))=L(n)=n / 2$ and $L(f(n)-f(1))=$ $L(n-1)=n-1$; these relations yield $f(n) \equiv f(0)=0 \equiv a n(\bmod n / 2)$ and $f(n) \equiv f(1)=a \equiv a n$ $(\bmod n-1)$, respectively. Thus, $\left.\frac{n(n-1)}{2} \right\rvert\, f(n)-a n$, which shows that $f(n)=a n$ in view of the estimate above.  Comment 3. In order to perform Step 3, it suffices to establish the equality $f(n)=a n$ for any infinite set of values of $n$. However, if this set has some good structure, then one may find easier ways to complete this step.  For instance, after showing, as in Approach 2 , that $f(n)=$ an for all $n \geqslant n_{0}$ with $n \equiv 2(\bmod N!)$, one may proceed as follows. Pick an arbitrary integer $x$ and take any large prime $p$ which is greater than $|f(x)-a x|$. By the Chinese Remainder Theorem, there exists a positive integer $n>\max \left(x, n_{0}\right)$ such that $n \equiv 2(\bmod N!)$ and $n \equiv x(\bmod p)$. By Step 1 , we have $f(x) \equiv f(n)=a n \equiv a x(\bmod p)$. Due to the choice of $p$, this is possible only if $f(x)=a x$.


Determine all functions $f: \mathbb{Z} \rightarrow \mathbb{Z}$ with the property that  $$ f(x-f(y))=f(f(x))-f(y)-1 $$  holds for all $x, y \in \mathbb{Z}$. (Croatia) Answer. There are two such functions, namely the constant function $x \mapsto-1$ and the successor function $x \mapsto x+1$.

Solution: It is immediately checked that both functions mentioned in the answer are as desired.  Now let $f$ denote any function satisfying (1) for all $x, y \in \mathbb{Z}$. Substituting $x=0$ and $y=f(0)$ into (1) we learn that the number $z=-f(f(0))$ satisfies $f(z)=-1$. So by plugging $y=z$ into (1) we deduce that  $$ f(x+1)=f(f(x)) $$  holds for all $x \in \mathbb{Z}$. Thereby (1) simplifies to  $$ f(x-f(y))=f(x+1)-f(y)-1 $$  We now work towards showing that $f$ is linear by contemplating the difference $f(x+1)-f(x)$ for any $x \in \mathbb{Z}$. By applying (3) with $y=x$ and (2) in this order, we obtain  $$ f(x+1)-f(x)=f(x-f(x))+1=f(f(x-1-f(x)))+1 $$  Since (3) shows $f(x-1-f(x))=f(x)-f(x)-1=-1$, this simplifies to  $$ f(x+1)=f(x)+A, $$  where $A=f(-1)+1$ is some absolute constant. Now a standard induction in both directions reveals that $f$ is indeed linear and that in fact we have $f(x)=A x+B$ for all $x \in \mathbb{Z}$, where $B=f(0)$. Substituting this into (2) we obtain that  $$ A x+(A+B)=A^{2} x+(A B+B) $$  holds for all $x \in \mathbb{Z}$; applying this to $x=0$ and $x=1$ we infer $A+B=A B+B$ and $A^{2}=A$. The second equation leads to $A=0$ or $A=1$. In case $A=1$, the first equation gives $B=1$, meaning that $f$ has to be the successor function. If $A=0$, then $f$ is constant and (1) shows that its constant value has to be -1 . Thereby the solution is complete.  Comment. After (2) and (3) have been obtained, there are several other ways to combine them so as to obtain linearity properties of $f$. For instance, using (2) thrice in a row and then (3) with $x=f(y)$ one may deduce that  $$ f(y+2)=f(f(y+1))=f(f(f(y)))=f(f(y)+1)=f(y)+f(0)+1 $$  holds for all $y \in \mathbb{Z}$. It follows that $f$ behaves linearly on the even numbers and on the odd numbers separately, and moreover that the slopes of these two linear functions coincide. From this point, one may complete the solution with some straightforward case analysis.  A different approach using the equations (2) and (3) will be presented in Solution 2. To show that it is also possible to start in a completely different way, we will also present a third solution that avoids these equations entirely.


Solution: We commence by deriving (2) and (3) as in the first solution. Now provided that $f$ is injective, (2) tells us that $f$ is the successor function. Thus we may assume from now on that $f$ is not injective, i.e., that there are two integers $a>b$ with $f(a)=f(b)$. A straightforward induction using (2) in the induction step reveals that we have $f(a+n)=f(b+n)$ for all nonnegative integers $n$. Consequently, the sequence $\gamma_{n}=f(b+n)$ is periodic and thus in particular bounded, which means that the numbers  $$ \varphi=\min _{n \geqslant 0} \gamma_{n} \quad \text { and } \quad \psi=\max _{n \geqslant 0} \gamma_{n} $$  exist. Let us pick any integer $y$ with $f(y)=\varphi$ and then an integer $x \geqslant a$ with $f(x-f(y))=\varphi$. Due to the definition of $\varphi$ and (3) we have  $$ \varphi \leqslant f(x+1)=f(x-f(y))+f(y)+1=2 \varphi+1 $$  whence $\varphi \geqslant-1$. The same reasoning applied to $\psi$ yields $\psi \leqslant-1$. Since $\varphi \leqslant \psi$ holds trivially, it follows that $\varphi=\psi=-1$, or in other words that we have $f(t)=-1$ for all integers $t \geqslant a$.  Finally, if any integer $y$ is given, we may find an integer $x$ which is so large that $x+1 \geqslant a$ and $x-f(y) \geqslant a$ hold. Due to (3) and the result from the previous paragraph we get  $$ f(y)=f(x+1)-f(x-f(y))-1=(-1)-(-1)-1=-1 . $$  Thereby the problem is solved.


Solution: Set $d=f(0)$. By plugging $x=f(y)$ into (1) we obtain  $$ f^{3}(y)=f(y)+d+1 $$  for all $y \in \mathbb{Z}$, where the left-hand side abbreviates $f(f(f(y)))$. When we replace $x$ in (1) by $f(x)$ we obtain $f(f(x)-f(y))=f^{3}(x)-f(y)-1$ and as a consequence of (4) this simplifies to  $$ f(f(x)-f(y))=f(x)-f(y)+d $$  Now we consider the set  $$ E=\{f(x)-d \mid x \in \mathbb{Z}\} $$  Given two integers $a$ and $b$ from $E$, we may pick some integers $x$ and $y$ with $f(x)=a+d$ and $f(y)=b+d$; now (5) tells us that $f(a-b)=(a-b)+d$, which means that $a-b$ itself exemplifies $a-b \in E$. Thus,  $$ E \text { is closed under taking differences. } $$  Also, the definitions of $d$ and $E$ yield $0 \in E$. If $E=\{0\}$, then $f$ is a constant function and (1) implies that the only value attained by $f$ is indeed -1 .  So let us henceforth suppose that $E$ contains some number besides zero. It is known that in this case (6) entails $E$ to be the set of all integer multiples of some positive integer $k$. Indeed, this holds for  $$ k=\min \{|x| \mid x \in E \text { and } x \neq 0\} $$  as one may verify by an argument based on division with remainder. Thus we have  $$ \{f(x) \mid x \in \mathbb{Z}\}=\{k \cdot t+d \mid t \in \mathbb{Z}\} $$  Due to (5) and (7) we get  $$ f(k \cdot t)=k \cdot t+d $$  for all $t \in \mathbb{Z}$, whence in particular $f(k)=k+d$. So by comparing the results of substituting $y=0$ and $y=k$ into (1) we learn that  $$ f(z+k)=f(z)+k $$  holds for all integers $z$. In plain English, this means that on any residue class modulo $k$ the function $f$ is linear with slope 1.  Now by (7) the set of all values attained by $f$ is such a residue class. Hence, there exists an absolute constant $c$ such that $f(f(x))=f(x)+c$ holds for all $x \in \mathbb{Z}$. Thereby (1) simplifies to  $$ f(x-f(y))=f(x)-f(y)+c-1 $$  On the other hand, considering (1) modulo $k$ we obtain $d \equiv-1(\bmod k)$ because of (7). So by (7) again, $f$ attains the value -1 .  Thus we may apply (9) to some integer $y$ with $f(y)=-1$, which gives $f(x+1)=f(x)+c$. So $f$ is a linear function with slope $c$. Hence, (8) leads to $c=1$, wherefore there is an absolute constant $d^{\prime}$ with $f(x)=x+d^{\prime}$ for all $x \in \mathbb{Z}$. Using this for $x=0$ we obtain $d^{\prime}=d$ and finally (4) discloses $d=1$, meaning that $f$ is indeed the successor function.