Let $N$ be a positive integer. Prove that there exist three permutations $a_{1}, a_{2}, \ldots, a_{N}$; $b_{1}, b_{2}, \ldots, b_{N}$; and $c_{1}, c_{2}, \ldots, c_{N}$ of $1,2, \ldots, N$ such that  $$ \left|\sqrt{a_{k}}+\sqrt{b_{k}}+\sqrt{c_{k}}-2 \sqrt{N}\right|<2023 $$  for every $k=1,2, \ldots, N$. (China)

Solution: The idea is to approximate the numbers $\sqrt{1}, \sqrt{2}, \ldots, \sqrt{N}$ by the nearest integer with errors $<0.5$. This gives the following sequence  $$ 1,1,2,2,2,2,3,3,3,3,3,3,4, \ldots $$  More precisely, for each $k \geqslant 1$, we round $\sqrt{k^{2}-k+1}, \ldots, \sqrt{k^{2}+k}$ to $k$, so that there are $2 k$ copies of $k$.  Step 1. We first consider the easier case when $N$ has the form  $$ N=m(m+1) . $$  In this case, the numbers $\sqrt{1}, \sqrt{2}, \ldots, \sqrt{N}$ are approximated by the elements of the multiset $\left\{1_{\times 2}, 2_{\times 4}, 3_{\times 6}, \ldots, m_{\times 2 m}\right\}$. Let $T_{m}$ denote "half of" the multiset, i.e.  $$ T_{m}:=\left\{1_{\times 1}, 2_{\times 2}, 3_{\times 3}, \ldots, m_{\times m}\right\} . $$  We will prove by induction that there exists three permutations $\left(u_{k}\right),\left(v_{k}\right)$, and $\left(w_{k}\right)$ of the elements in the multiset $T_{m}$ such that $u_{k}+v_{k}+w_{k}=2 m+1$ is constant for $k=1,2, \ldots, \frac{m(m+1)}{2}$.  When $m=1$, take $1+1+1=3$. When $m=2$, take $(1,2,2)+(2,1,2)+(2,2,1)=(5,5,5)$. Suppose that we have constructed three permutations $\left(u_{k}\right),\left(v_{k}\right)$, and $\left(w_{k}\right)$ of $T_{m-1}$ satisfying $u_{k}+v_{k}+w_{k}=2 m-1$ for every $k=1,2, \ldots, \frac{m(m-1)}{2}$. For $T_{m}$, we note that  $$ T_{m}=T_{m-1} \sqcup\left\{m_{\times m}\right\}, $$  and also  $$ T_{m}=\left(T_{m-1}+1\right) \sqcup\{1,2, \ldots, m\} . $$  Here $T_{m-1}+1$ means to add 1 to all elements in $T_{m-1}$. We construct the permutations $\left(u_{k}^{\prime}\right)$, $\left(v_{k}^{\prime}\right)$, and $\left(w_{k}^{\prime}\right)$ of $T_{m}$ as follows:  - For $k=1,2, \ldots, \frac{m(m-1)}{2}$, we set $u_{k}^{\prime}=u_{k}, v_{k}^{\prime}=v_{k}+1, w_{k}^{\prime}=w_{k}+1$. - For $k=\frac{m(m-1)}{2}+r$ with $r=1,2, \ldots, m$, we set $u_{k}^{\prime}=m, v_{k}^{\prime}=r, w_{k}^{\prime}=m+1-r$.  It is clear from (1) that $\left(u_{k}^{\prime}\right),\left(v_{k}^{\prime}\right)$, and $\left(w_{k}^{\prime}\right)$ give three permutations of $T_{m}$, and that they satisfy $u_{k}^{\prime}+v_{k}^{\prime}+w_{k}^{\prime}=2 m+1$ for every $k=1,2, \ldots, \frac{m(m+1)}{2}$.  The inductive construction can be visualised by the $3 \times \frac{m(m+1)}{2}$ matrix  $$ \left[\begin{array}{cccccc} u_{1} & \ldots & u_{m(m-1) / 2} & m & \ldots & m \\ v_{1}+1 & \ldots & v_{m(m-1) / 2}+1 & 1 & \ldots & m \\ w_{1}+1 & \ldots & w_{m(m-1) / 2}+1 & m & \ldots & 1 \end{array}\right] $$  in which the three rows represent the permutations $\left(u_{k}^{\prime}\right),\left(v_{k}^{\prime}\right),\left(w_{k}^{\prime}\right)$, and the sum of the three entries of each column is $2 m+1$.  Thus, when $N=m^{2}+m$, we can construct permutations $\left(a_{k}\right),\left(b_{k}\right)$, and $\left(c_{k}\right)$ of $1,2, \ldots, N$ such that  $$ 2 m+1-1.5<\sqrt{a_{k}}+\sqrt{b_{k}}+\sqrt{c_{k}}<2 m+1+1.5 $$  This gives  $$ \left|\sqrt{a_{k}}+\sqrt{b_{k}}+\sqrt{c_{k}}-2 \sqrt{N}\right|<2.5<2023 $$  where we used that $-1<2 m-2 \sqrt{m^{2}+m}<0$ for positive $m$. Step 2. We now proceed to the general case. Let $m$ be such that  $$ m(m+1) \leqslant N<(m+1)(m+2) $$  Write $N=m(m+1)+t$ for some $t \in\{0,1, \ldots, 2 m+1\}$ and let  $$ L:=\left\lfloor\frac{4}{9} N\right\rfloor . $$  We will make use of the following inequalities below:  $$ N>m^{2}, \quad N<(m+2)^{2}, \quad t \leqslant 2 m+1, \quad L+1>4 N / 9, \quad L \leqslant 4 N / 9 . $$  As above, we construct three permutations $\left(a_{k}\right),\left(b_{k}\right)$, and $\left(c_{k}\right)$ of $1,2, \ldots, m(m+1)$ satisfying (2). Now we construct the three required permutations $\left(A_{k}\right),\left(B_{k}\right)$, and $\left(C_{k}\right)$ of $1,2, \ldots, N$ as follows:  For $k=1,2, \ldots, m(m+1)$, if $a_{k} \leqslant L$, take $A_{k}=a_{k}$, and if $a_{k}>L$, take $A_{k}=a_{k}+t$. For $k=m(m+1)+r$ with $r=1,2, \ldots, t$, set $A_{k}=L+r$. Define the permutations $\left(B_{k}\right)$ and $\left(C_{k}\right)$ similarly. Now for $k=1,2, \ldots, m(m+1)$, we show $0 \leqslant \sqrt{A_{k}}-\sqrt{a_{k}} \leqslant 2$. The lower bound is obvious. If $m \leqslant 1$, then $N \leqslant 5$ and hence $\sqrt{A_{k}}-\sqrt{a_{k}} \leqslant \sqrt{5}-\sqrt{1} \leqslant 2$. If $m \geqslant 2$, then  $$ \sqrt{A_{k}}-\sqrt{a_{k}}=\frac{A_{k}-a_{k}}{\sqrt{A_{k}}+\sqrt{a_{k}}} \leqslant \frac{t}{2 \sqrt{L+1}} \leqslant \frac{2 m+1}{\frac{4}{3} m} \leqslant 2 . $$  We have similar inequalities for $\left(B_{k}\right)$ and $\left(C_{k}\right)$. Thus  $$ 2 \sqrt{N}-4.5<2 m+1-1.5 \leqslant \sqrt{A_{k}}+\sqrt{B_{k}}+\sqrt{C_{k}} \leqslant 2 m+1+1.5+6<2 \sqrt{N}+8.5 . $$  For $k=m^{2}+m+1, \ldots, m^{2}+m+t$, we have  $$ 2 \sqrt{N}<3 \sqrt{L+1} \leqslant \sqrt{A_{k}}+\sqrt{B_{k}}+\sqrt{C_{k}} \leqslant 3 \sqrt{L+t} \leqslant \sqrt{4 N+9 t}<2 \sqrt{N}+8.5 $$  To sum up, we have defined three permutations $\left(A_{k}\right),\left(B_{k}\right)$, and $\left(C_{k}\right)$ of $1,2, \ldots, N$, such that  $$ \left|\sqrt{A_{k}}+\sqrt{B_{k}}+\sqrt{C_{k}}-2 \sqrt{N}\right|<8.5<2023 $$  holds for every $k=1,2, \ldots, N$.


Solution: This is a variation of  Let $n$ be an integer satisfying $0 \leqslant n \leqslant m+1$ and define the multiset $T_{m, n}$ by  $$ T_{m, n}:=\left\{1_{\times 1}, 2_{\times 2}, 3_{\times 3}, \ldots, m_{\times m},(m+1)_{\times n}\right\} . $$  In other words, $T_{m, 0}=T_{m}, T_{m, n}=T_{m} \sqcup\left\{(m+1)_{\times n}\right\}$ and $T_{m, m+1}=T_{m+1}$, where $T_{m}$ is the set defined in Solution 1.  Claim. There exist three permutations $\left(u_{k}\right),\left(v_{k}\right),\left(w_{k}\right)$ of $T_{m, n}$ such that  $$ \begin{cases}u_{k}+v_{k}+w_{k}=2 m+1 & (n=0) \\ u_{k}+v_{k}+w_{k} \in\{2 m+1,2 m+2,2 m+3\} & (1 \leqslant n \leqslant m) \\ u_{k}+v_{k}+w_{k}=2 m+3 & (n=m+1)\end{cases} $$  Proof. We proceed by induction on $m$. If $n=0$ or $n=m+1$, the assertion can be proved as in Solution 1. If $1 \leqslant n \leqslant m$, we note that  $$ T_{m, n}=T_{m-1, n} \sqcup\left\{m_{\times(m-n)},(m+1)_{\times n}\right\}=\left(T_{m-1, n}+1\right) \sqcup\{1,2, \ldots, m\} . $$  From the hypothesis of induction, it follows that we have three permutations $\left(u_{k}\right),\left(v_{k}\right),\left(w_{k}\right)$ of $T_{m-1, n}$ satisfying $u_{k}+v_{k}+w_{k} \in\{2 m-1,2 m, 2 m+1\}$ for every $k$. We construct the permutations $\left(u_{k}^{\prime}\right),\left(v_{k}^{\prime}\right)$, and $\left(w_{k}^{\prime}\right)$ of $T_{m, n}$ as follows:  - For $k=1,2, \ldots, \frac{m(m-1)}{2}+n$, we set $u_{k}^{\prime}=u_{k}, v_{k}^{\prime}=v_{k}+1$, and $w_{k}^{\prime}=w_{k}+1$. - For $k=\frac{m(m-1)}{2}+n+r$ with $r=1,2, \ldots, m$, we set $u_{k}^{\prime}=m$ if $1 \leqslant r \leqslant m-n$ while $u_{k}^{\prime}=m+1$ if $m-n+1 \leqslant r \leqslant m, v_{k}^{\prime}=r$, and $w_{k}^{\prime}=m+1-r$.  It is clear from the construction that $\left(u_{k}^{\prime}\right),\left(v_{k}^{\prime}\right)$, and $\left(w_{k}^{\prime}\right)$ give three permutations of $T_{m, n}$, and they satisfy $u_{k}^{\prime}+v_{k}^{\prime}+w_{k}^{\prime} \in\{2 m+1,2 m+2,2 m+3\}$ for every $k=1,2, \ldots, \frac{m(m+1)}{2}+n$.  Again, we can visualise the construction using the matrix  $$ \left[\begin{array}{ccccccccc} u_{1} & \ldots & u_{m(m-1) / 2+n} & m & \ldots & m & m+1 & \ldots & m+1 \\ v_{1}+1 & \ldots & v_{m(m-1) / 2+n}+1 & 1 & \ldots & \ldots & \ldots & \ldots & m \\ w_{1}+1 & \ldots & w_{m(m-1) / 2+n}+1 & m & \ldots & \ldots & \ldots & \ldots & 1 \end{array}\right] $$  In general, we have $m(m+1) \leqslant N<(m+1)(m+2)$ for some $m \geqslant 0$. Set $N=m(m+1)+t$ for some $t \in\{0,1, \ldots, 2 m+1\}$. Then the approximation of $\{\sqrt{1}, \sqrt{2}, \ldots, \sqrt{N}\}$ by the nearest integer with errors $<0.5$ is a multiset  $$ \left\{1_{\times 2}, 2_{\times 4}, \ldots, m_{\times 2 m},(m+1)_{\times t}\right\}=T_{m, n_{1}} \sqcup T_{m, n_{2}} $$  with $n_{1}=\lfloor t / 2\rfloor$ and $n_{2}=\lceil t / 2\rceil$. Since $0 \leqslant n_{1} \leqslant n_{2} \leqslant m+1$, by using the Claim we can construct permutations $\left(a_{k}\right)$, $\left(b_{k}\right)$, and $\left(c_{k}\right)$ to satisfy the following inequality:  $$ 2 m+1-1.5<\sqrt{a_{k}}+\sqrt{b_{k}}+\sqrt{c_{k}}<2 m+3+1.5 $$  Since $m<\sqrt{N}<m+2$, it follows that  $$ 2 \sqrt{N}-4.5<2 m+1-1.5<\sqrt{a_{k}}+\sqrt{b_{k}}+\sqrt{c_{k}}<2 m+3+1.5<2 \sqrt{N}+4.5 $$  and so  $$ \left|\sqrt{A_{k}}+\sqrt{B_{k}}+\sqrt{C_{k}}-2 \sqrt{N}\right|<4.5<2023 $$  ![](https://cdn.mathpix.com/cropped/2025_01_09_9538693ed865d47d2de5g-32.jpg?height=470&width=595&top_left_y=242&top_left_x=733)


Solution: This solution is based on the geometrical insight of equilateral triangles. Step 1. We first consider the easier case of triangle numbers  $$ N=\frac{m(m+1)}{2} $$  As shown in the following picture, consider the triangular shaped lattice points inside an equilateral triangle $A B C$ with a total of $N$ points. The lattice is built in a way that the $\ell^{\text {th }}$ row has exactly $\ell$ points for each $\ell=1,2, \ldots, m$. Rows are numbered in three different ways, one for each vertex.  Each point $P_{k}$ in the triangular lattice is labelled with a triple of integers $\left(a_{k}, b_{k}, c_{k}\right)$ as follows. The first coordinate is called the $A$-coordinate, and so on for $B, C$. To define the $A$-coordinate, denoted $W_{a}(\bullet)$, first label the lattice points by $1,2,3, \ldots$ starting with the point closest to $A$ and then going down the rows with the rule that within a row, the labelling is from left to right (see right picture). The $B$-coordinate, denoted $W_{b}(\bullet)$, is defined by rotating the $A$-coordinate counterclockwise by $120^{\circ}$. The $C$-coordinate, denoted $W_{c}(\bullet)$, similarly, by rotating the $A$-coordinate counterclockwise by $240^{\circ}$.  Assume that a point $P$ lies in the $\ell_{a}{ }^{\text {th }}$ row from the vertex $A$, in the $\ell_{b}{ }^{\text {th }}$ row from the vertex $B$, and in the $\ell_{c}^{\text {th }}$ row from the vertex $C$. Note that $\ell_{a}$ is proportional to the height of $A$ in the triangle, minus the height of $P$. Since inside an equilateral triangle, the sum of the lengths of the heights from a point to the three sides is independent of the point, we must have  $$ \ell_{a}+\ell_{b}+\ell_{c}=2 m+1=\sqrt{8 N+1} $$  Since there are exactly $1+2+\cdots+\ell=\frac{\ell(\ell+1)}{2}$ points in the first $\ell$ rows, the $A$-labeling $W_{a}(P)$ of the point $P$ satisfies  $$ \frac{\ell_{a}\left(\ell_{a}-1\right)}{2}+1 \leqslant W_{a}(P) \leqslant \frac{\ell_{a}\left(\ell_{a}+1\right)}{2} . $$  In paticular,  $$ \left(\ell_{a}-\frac{1}{2}\right)^{2}<2 W_{a}(P)<\left(\ell_{a}+\frac{1}{2}\right)^{2} $$  Taking the cyclic sum gives  $$ \left|\sqrt{2 W_{a}(P)}+\sqrt{2 W_{b}(P)}+\sqrt{2 W_{c}(P)}-\left(\ell_{a}+\ell_{b}+\ell_{c}\right)\right|<\frac{3}{2} $$  and thus  $$ \left|\sqrt{W_{a}(P)}+\sqrt{W_{b}(P)}+\sqrt{W_{c}(P)}-2 \sqrt{N+\frac{1}{8}}\right|<\frac{3}{2} \cdot \frac{1}{\sqrt{2}}=\frac{3 \sqrt{2}}{4} . $$  Step 2. Now, for a general positive integer $N$, there exists a positive integer $m$ such that  $$ \frac{m(m-1)}{2}+1 \leqslant N \leqslant \frac{m(m+1)}{2} $$  Write $N=\frac{m(m+1)}{2}-t$ with $t \in\{0,1, \ldots, m-1\}$. We modify the above construction for $\frac{m(m+1)}{2}$ points into a construction for $N$ points as follows. We remove $t$ arbitrary points from the $m^{\text {th }}$ row (namely the bottom row) of the triangular lattice. The remaining triangular lattice has $\frac{m(m+1)}{2}-t=N$ points, and we assign their $A$-, $B$-, and $C$-coordinates as before (in the same order, yet skipping over the points that are removed so that the coordinates exactly form permutations of $1,2, \ldots, N)$.  For each point $P$ in the triangular lattice (that was not removed earlier), suppose that it is in the $\ell_{a}^{\text {th }}, \ell_{b}^{\text {th }}$, and $\ell_{c}^{\text {th }}$ row when viewed from $A, B$, and $C$, respectively. Now the $A$-coordinates $W_{a}(P)$ still satisfies  $$ \frac{\ell_{a}\left(\ell_{a}-1\right)}{2}+1 \leqslant W_{a}(P) \leqslant \frac{\ell_{a}\left(\ell_{a}+1\right)}{2} . $$  The $B$-coordinate $W_{b}(P)$ satisfies  $$ \frac{\left(\ell_{b}-1\right)\left(\ell_{b}-2\right)}{2}+1 \leqslant W_{b}(P) \leqslant \frac{\ell_{b}\left(\ell_{b}+1\right)}{2} $$  because, viewing from point $B$, we have removed either 0 or 1 point from each row, and the first $\ell_{b}-1$ rows have at least $0+1+\cdots+\left(\ell_{b}-2\right)=\frac{\left(\ell_{b}-1\right)\left(\ell_{b}-2\right)}{2}$ points left. For the same reason, the $C$-labeling $W_{c}(P)$ satisfies  $$ \frac{\left(\ell_{c}-1\right)\left(\ell_{c}-2\right)}{2}+1 \leqslant W_{c}(P) \leqslant \frac{\ell_{c}\left(\ell_{c}+1\right)}{2} . $$  From this, we deduce that  $$ \begin{aligned} & \ell_{a}-\frac{1}{2}<\sqrt{2 W_{a}(P)}<\ell_{a}+\frac{1}{2} \\ & \ell_{b}-\frac{3}{2}<\sqrt{2 W_{b}(P)}<\ell_{b}+\frac{1}{2} \\ & \ell_{c}-\frac{3}{2}<\sqrt{2 W_{c}(P)}<\ell_{c}+\frac{1}{2} . \end{aligned} $$  Combining all above with the inequalities $2 m-1<2 \sqrt{2 N}<2 m+1$ and $\ell_{a}+\ell_{b}+\ell_{c}=2 m+1$, we deduce that  $$ \begin{aligned} 2 \sqrt{2 N}-\frac{7}{2}<(2 m+1)-\frac{7}{2}<\sqrt{2 W_{a}(P)} & +\sqrt{2 W_{b}(P)}+\sqrt{2 W_{c}(P)} \\ & <(2 m+1)+\frac{3}{2}<2 \sqrt{2 N}+\frac{7}{2} \end{aligned} $$  Therefore, for each point $P$, we have  $$ \left|\sqrt{W_{a}(P)}+\sqrt{W_{b}(P)}+\sqrt{W_{c}(P)}-2 \sqrt{N}\right|<\frac{7}{2} \cdot \frac{1}{\sqrt{2}}<2.5<2013 $$  We may finally order of the $N$ points in an arbitrary way. Then the $A$-labelings $W_{a}(\bullet)$ give the permutation $a_{1}, \ldots, a_{N}$, the $B$-labelings $W_{b}(\bullet)$ give $b_{1}, \ldots, b_{N}$, and the $C$-labelings $W_{c}(\bullet)$ give $c_{1}, \ldots, c_{N}$.  For each $k=1,2, \ldots, N$, we have  $$ \left|\sqrt{a_{k}}+\sqrt{b_{k}}+\sqrt{c_{k}}-2 \sqrt{N}\right|<2.5<2023 $$  Comment. We can make the same argument as in Solution 3 without using geometry or diagram instead using barycentric coordinates in integers and lexicographic order.  For $N=\frac{m(m+1)}{2}$, consider a set  $$ X=\left\{(x, y, z) \in \mathbb{Z}^{3} \mid 0 \leqslant x, y, z \leqslant m-1, x+y+z=m-1\right\} . $$  and the lexicographic order of $X$, i.e.  $$ (x, y, z)>\left(x^{\prime}, y^{\prime}, z^{\prime}\right) \Longleftrightarrow\left\{\begin{array}{l} x>x^{\prime} \text { or } \\ x=x^{\prime} \text { and } y>y^{\prime} \text { or } \\ x=x^{\prime} \text { and } y=y^{\prime} \text { and } z>z^{\prime} . \end{array}\right. $$  Then for an element $Q_{k}=\left(x_{k}, y_{k}, z_{k}\right)$  - Define $W_{a}\left(Q_{k}\right)$ so that $\left(x_{k}, y_{k}, z_{k}\right)$ is the $W_{a}\left(Q_{k}\right)^{\text {th }}$ biggest element in $X$. - Define $W_{b}\left(Q_{k}\right)$ so that $\left(y_{k}, z_{k}, x_{k}\right)$ is the $W_{b}\left(Q_{k}\right)^{\text {th }}$ biggest element in $X^{\prime}=\{(y, z, x) \mid(x, y, z) \in X\}$. - Define $W_{c}\left(Q_{k}\right)$ so that $\left(z_{k}, x_{k}, y_{k}\right)$ is the $W_{c}\left(Q_{k}\right)^{\text {th }}$ biggest element in $X^{\prime \prime}=\{(z, x, y) \mid(x, y, z) \in X\}$.  The same argument as in Solution 2 then holds. Observe that for an element $Q_{k}=\left(x_{k}, y_{k}, z_{k}\right)$, it holds that $\ell_{a}=m-x_{k}, \ell_{b}=m-y_{k}$, and $\ell_{c}=m-z_{k}$.


Let $m$ and $n$ be positive integers greater than 1 . In each unit square of an $m \times n$ grid lies a coin with its tail-side up. A move consists of the following steps:  1. select a $2 \times 2$ square in the grid; 2. flip the coins in the top-left and bottom-right unit squares; 3. flip the coin in either the top-right or bottom-left unit square.  Determine all pairs $(m, n)$ for which it is possible that every coin shows head-side up after a finite number of moves. (Thailand) Answer: The answer is all pairs $(m, n)$ satisfying $3 \mid m n$.

Solution: Let us denote by $(i, j)$-square the unit square in the $i^{\text {th }}$ row and the $j^{\text {th }}$ column. We first prove that when $3 \mid m n$, it is possible to make all the coins show head-side up. For integers $1 \leqslant i \leqslant m-1$ and $1 \leqslant j \leqslant n-1$, denote by $A(i, j)$ the move that flips the coin in the ( $i, j$ )-square, the $(i+1, j+1)$-square and the $(i, j+1)$-square. Similarly, denote by $B(i, j)$ the move that flips the coin in the $(i, j)$-square, $(i+1, j+1)$-square, and the $(i+1, j)$-square. Without loss of generality, we may assume that $3 \mid m$.  Case 1: $n$ is even. We apply the moves  - $A(3 k-2,2 l-1)$ for all $1 \leqslant k \leqslant \frac{m}{3}$ and $1 \leqslant l \leqslant \frac{n}{2}$, - $B(3 k-1,2 l-1)$ for all $1 \leqslant k \leqslant \frac{m}{3}$ and $1 \leqslant l \leqslant \frac{n}{2}$.  This process will flip each coin exactly once, hence all the coins will face head-side up afterwards. ![](https://cdn.mathpix.com/cropped/2025_01_09_9538693ed865d47d2de5g-35.jpg?height=332&width=438&top_left_y=1881&top_left_x=809)


Determine the maximal length $L$ of a sequence $a_{1}, \ldots, a_{L}$ of positive integers satisfying both the following properties:  - every term in the sequence is less than or equal to $2^{2023}$, and - there does not exist a consecutive subsequence $a_{i}, a_{i+1}, \ldots, a_{j}$ (where $1 \leqslant i \leqslant j \leqslant L$ ) with a choice of signs $s_{i}, s_{i+1}, \ldots, s_{j} \in\{1,-1\}$ for which  $$ s_{i} a_{i}+s_{i+1} a_{i+1}+\cdots+s_{j} a_{j}=0 $$  (Czech Republic) Answer: The answer is $L=2^{2024}-1$.

Solution: We prove more generally that the answer is $2^{k+1}-1$ when $2^{2023}$ is replaced by $2^{k}$ for an arbitrary positive integer $k$. Write $n=2^{k}$.  We first show that there exists a sequence of length $L=2 n-1$ satisfying the properties. For a positive integer $x$, denote by $v_{2}(x)$ the maximal nonnegative integer $v$ such that $2^{v}$ divides $x$. Consider the sequence $a_{1}, \ldots, a_{2 n-1}$ defined as  $$ a_{i}=2^{k-v_{2}(i)} . $$  For example, when $k=2$ and $n=4$, the sequence is  $$ 4,2,4,1,4,2,4 $$  This indeed consists of positive integers less than or equal to $n=2^{k}$, because $0 \leqslant v_{2}(i) \leqslant k$ for $1 \leqslant i \leqslant 2^{k+1}-1$. Claim 1. This sequence $a_{1}, \ldots, a_{2 n-1}$ does not have a consecutive subsequence with a choice of signs such that the signed sum equals zero. Proof. Let $1 \leqslant i \leqslant j \leqslant 2 n-1$ be integers. The main observation is that amongst the integers  $$ i, i+1, \ldots, j-1, j $$  there exists a unique integer $x$ with the maximal value of $v_{2}(x)$. To see this, write $v=$ $\max \left(v_{2}(i), \ldots, v_{2}(j)\right)$. If there exist at least two multiples of $2^{v}$ amongst $i, i+1, \ldots, j$, then one of them must be a multiple of $2^{v+1}$, which is a contradiction.  Therefore there is exactly one $i \leqslant x \leqslant j$ with $v_{2}(x)=v$, which implies that all terms except for $a_{x}=2^{k-v}$ in the sequence  $$ a_{i}, a_{i+1}, \ldots, a_{j} $$  are a multiple of $2^{k-v+1}$. The same holds for the terms $s_{i} a_{i}, s_{i+1} a_{i+1}, \ldots, s_{j} a_{j}$, hence the sum cannot be equal to zero.  We now prove that there does not exist a sequence of length $L \geqslant 2 n$ satisfying the conditions of the problem. Let $a_{1}, \ldots, a_{L}$ be an arbitrary sequence consisting of positive integers less than or equal to $n$. Define a sequence $s_{1}, \ldots, s_{L}$ of signs recursively as follows:  - when $s_{1} a_{1}+\cdots+s_{i-1} a_{i-1} \leqslant 0$, set $s_{i}=+1$, - when $s_{1} a_{1}+\cdots+s_{i-1} a_{i-1} \geqslant 1$, set $s_{i}=-1$.  Write  $$ b_{i}=\sum_{j=1}^{i} s_{i} a_{i}=s_{1} a_{1}+\cdots+s_{i} a_{i} $$  and consider the sequence  $$ 0=b_{0}, b_{1}, b_{2}, \ldots, b_{L} $$  Claim 2. All terms $b_{i}$ of the sequence satisfy $-n+1 \leqslant b_{i} \leqslant n$. Proof. We prove this by induction on $i$. It is clear that $b_{0}=0$ satisfies $-n+1 \leqslant 0 \leqslant n$. We now assume $-n+1 \leqslant b_{i-1} \leqslant n$ and show that $-n+1 \leqslant b_{i} \leqslant n$. Case 1: $-n+1 \leqslant b_{i-1} \leqslant 0$. Then $b_{i}=b_{i-1}+a_{i}$ from the definition of $s_{i}$, and hence  $$ -n+1 \leqslant b_{i-1}<b_{i-1}+a_{i} \leqslant b_{i-1}+n \leqslant n . $$  Case 2: $1 \leqslant b_{i-1} \leqslant n$. Then $b_{i}=b_{i-1}-a_{i}$ from the definition of $s_{i}$, and hence  $$ -n+1 \leqslant b_{i-1}-n \leqslant b_{i-1}-a_{i}<b_{i-1} \leqslant n . $$  This finishes the proof. Because there are $2 n$ integers in the closed interval $[-n+1, n]$ and at least $2 n+1$ terms in the sequence $b_{0}, b_{1}, \ldots, b_{L}$ (as $L+1 \geqslant 2 n+1$ by assumption), the pigeonhole principle implies that two distinct terms $b_{i-1}, b_{j}$ (where $1 \leqslant i \leqslant j \leqslant L$ ) must be equal. Subtracting one from another, we obtain  $$ s_{i} a_{i}+\cdots+s_{j} a_{j}=b_{j}-b_{i-1}=0 $$  as desired. Comment. The same argument gives a bound $L \leqslant 2 n-1$ that works for all $n$, but this bound is not necessarily sharp when $n$ is not a power of 2 . For instance, when $n=3$, the longest sequence has length $L=3$.


Let $n$ be a positive integer. We arrange $1+2+\cdots+n$ circles in a triangle with $n$ rows, such that the $i^{\text {th }}$ row contains exactly $i$ circles. The following figure shows the case $n=6$. ![](https://cdn.mathpix.com/cropped/2025_01_09_9538693ed865d47d2de5g-40.jpg?height=398&width=381&top_left_y=401&top_left_x=843)  In this triangle, a ninja-path is a sequence of circles obtained by repeatedly going from a circle to one of the two circles directly below it. In terms of $n$, find the largest value of $k$ such that if one circle from every row is coloured red, we can always find a ninja-path in which at least $k$ of the circles are red. (Netherlands) Answer: The maximum value is $k=1+\left\lfloor\log _{2} n\right\rfloor$.

Solution: Write $N=\left\lfloor\log _{2} n\right\rfloor$ so that we have $2^{N} \leqslant n \leqslant 2^{N+1}-1$. We first provide a construction where every ninja-path passes through at most $N+1$ red circles. For the row $i=2^{a}+b$ for $0 \leqslant a \leqslant N$ and $0 \leqslant b<2^{a}$, we colour the $(2 b+1)^{\text {th }}$ circle. ![](https://cdn.mathpix.com/cropped/2025_01_09_9538693ed865d47d2de5g-40.jpg?height=383&width=431&top_left_y=1413&top_left_x=818)  Then every ninja-path passes through at most one red circle in each of the rows $2^{a}, 2^{a}+$ $1, \ldots, 2^{a+1}-1$ for each $0 \leqslant a \leqslant N$. It follows that every ninja-path passes through at most $N+1$ red circles.  We now prove that for every colouring, there exists a ninja-path going through at least $N+1$ red circles. For each circle $C$, we assign the maximum number of red circles in a ninja-path that starts at the top of the triangle and ends at $C$. ![](https://cdn.mathpix.com/cropped/2025_01_09_9538693ed865d47d2de5g-40.jpg?height=329&width=358&top_left_y=2160&top_left_x=849)


Solution: We give an alternative proof that there exists a ninja-path passing through at least $N+1$ red circles. Assign numbers to circles as in the previous solution, but we only focus on the numbers assigned to red circles.  For each positive integer $i$, denote by $e_{i}$ the number of red circles with number $i$. Claim 2. If the red circle on row $l$ has number $i$, then $e_{i} \leqslant l$. Proof. Note that if two circles $C$ and $C^{\prime}$ are both assigned the same number $i$, then there cannot be a ninja-path joining the two circles. We partition the triangle into a smaller triangle with the red circle in row $l$ at its top along with $l-1$ lines that together cover all other circles. ![](https://cdn.mathpix.com/cropped/2025_01_09_9538693ed865d47d2de5g-41.jpg?height=415&width=472&top_left_y=2071&top_left_x=798)  In each set, there can be at most one red circle with number $i$, and therefore $e_{i} \leqslant l$. We observe that if there exists a red circle $C$ with number $i \geqslant 2$, then there also exists a red circle with number $i-1$ in some row that is above the row containing $C$. This is because the second last red circle in the ninja-path ending at $C$ has number $i-1$. Claim 3. We have $e_{i} \leqslant 2^{i-1}$ for every positive integer $i$.  Proof. We prove by induction on $i$. The base case $i=1$ is clear, since the only red circle with number 1 is the one at the top of the triangle. We now assume that the statement is true for $1 \leqslant i \leqslant j-1$ and prove the statement for $i=j$. If $e_{j}=0$, there is nothing to prove. Otherwise, let $l$ be minimal such that the red circle on row $l$ has number $j$. Then all the red circles on row $1, \ldots, l-1$ must have number less than $j$. This shows that  $$ l-1 \leqslant e_{1}+e_{2}+\cdots+e_{j-1} \leqslant 1+2+\cdots+2^{j-2}=2^{j-1}-1 . $$  This proves that $l \leqslant 2^{j-1}$, and by Claim 2, we also have $e_{j} \leqslant l$. Therefore $e_{j} \leqslant 2^{j-1}$. We now see that  $$ e_{1}+e_{2}+\cdots+e_{N} \leqslant 1+\cdots+2^{N-1}=2^{N}-1<n $$  Therefore there exists a red circle with number at least $N+1$, which means that there exists a ninja-path passing through at least $N+1$ red circles.


Solution: We provide yet another proof that there exists a ninja-path passing through at least $N+1$ red circles. In this solution, we assign to a circle $C$ the maximum number of red circles on a ninja-path starting at $C$ (including $C$ itself). ![](https://cdn.mathpix.com/cropped/2025_01_09_9538693ed865d47d2de5g-42.jpg?height=326&width=364&top_left_y=1145&top_left_x=846)  Denote by $f_{i}$ the number of red circles with number $i$. Note that if a red circle $C$ has number $i$, and there is a ninja-path from $C$ to another red circle $C^{\prime}$, then the number assigned to $C^{\prime}$ must be less than $i$. Claim 4. If the red circle on row $l$ has number less than or equal to $i$, then $f_{i} \leqslant l$. Proof. This proof is same as the proof of Claim 2. The additional input is that if the red circle on row $l$ has number strictly less than $i$, then the smaller triangle cannot have a red circle with number $i$.  Claim 5. We have  $$ f_{1}+f_{2}+\cdots+f_{i} \leqslant n-\left\lfloor\frac{n}{2^{i}}\right\rfloor $$  for all $0 \leqslant i \leqslant N$. Proof. We use induction on $i$. The base case $i=0$ is clear as the left hand side is the empty sum and the right hand side is zero. For the induction step, we assume that $i \geqslant 1$ and that the statement is true for $i-1$. Let $l$ be minimal such that the red circle on row $l$ has number less than or equal to $i$. Then all the red circles with number less than or equal to $i$ lie on rows $l, l+1, \ldots, n$, and therefore  $$ f_{1}+f_{2}+\cdots+f_{i} \leqslant n-l+1 $$  On the other hand, the induction hypothesis together with the fact that $f_{i} \leqslant l$ shows that  $$ f_{1}+\cdots+f_{i-1}+f_{i} \leqslant n-\left\lfloor\frac{n}{2^{i-1}}\right\rfloor+l . $$  Averaging the two inequalities gives  $$ f_{1}+\cdots+f_{i} \leqslant n-\frac{1}{2}\left\lfloor\frac{n}{2^{i-1}}\right\rfloor+\frac{1}{2} . $$  Since the left hand side is an integer, we conclude that  $$ f_{1}+\cdots+f_{i} \leqslant n-\left\lfloor\frac{1}{2}\left\lfloor\frac{n}{2^{i-1}}\right\rfloor\right\rfloor=n-\left\lfloor\frac{n}{2^{i}}\right\rfloor . $$  This completes the induction step. Taking $i=N$, we obtain  $$ f_{1}+f_{2}+\cdots+f_{N} \leqslant n-\left\lfloor\frac{n}{2^{N}}\right\rfloor<n $$  This implies that there exists a ninja-path passing through at least $N+1$ red circles. Comment. Using essentially the same argument, one may inductively prove  $$ e_{a}+e_{a+1}+\cdots+e_{a+i-1} \leqslant n-\left\lfloor\frac{n}{2^{i}}\right\rfloor . $$  instead. Taking $a=1$ and $i=N$ gives the desired statement.


Let $n \geqslant 2$ be a positive integer. Paul has a $1 \times n^{2}$ rectangular strip consisting of $n^{2}$ unit squares, where the $i^{\text {th }}$ square is labelled with $i$ for all $1 \leqslant i \leqslant n^{2}$. He wishes to cut the strip into several pieces, where each piece consists of a number of consecutive unit squares, and then translate (without rotating or flipping) the pieces to obtain an $n \times n$ square satisfying the following property: if the unit square in the $i^{\text {th }}$ row and $j^{\text {th }}$ column is labelled with $a_{i j}$, then $a_{i j}-(i+j-1)$ is divisible by $n$.  Determine the smallest number of pieces Paul needs to make in order to accomplish this.  Answer: The minimum number of pieces is $2 n-1$.

Solution: For the entirety of the solution, we shall view the labels as taking values in $\mathbb{Z} / n \mathbb{Z}$, as only their values modulo $n$ play a role.  Here are two possible constructions consisting of $2 n-1$ pieces.  1. Cut into pieces of sizes $n, 1, n, 1, \ldots, n, 1,1$, and glue the pieces of size 1 to obtain the last row. 2. Cut into pieces of sizes $n, 1, n-1,2, n-2, \ldots, n-1,1$, and switch the pairs of consecutive strips that add up to size $n$.  We now prove that using $2 n-1$ pieces is optimal. It will be more helpful to think of the reverse process: start with $n$ pieces of size $1 \times n$, where the $k^{\text {th }}$ piece has squares labelled $k, k+1, \ldots, k+n-1$. The goal is to restore the original $1 \times n^{2}$ strip.  Note that each piece, after cutting at appropriate places, is of the form $a, a+1, \ldots, b-1$. Construct an (undirected but not necessarily simple) graph $\Gamma$ with vertices labelled by $1, \ldots, n$, where a piece of the form $a, a+1, \ldots, b-1$ corresponds to an edge from $a$ to $b$. We make the following observations.  - The cut pieces came from the $k^{\text {th }}$ initial piece $k, k+1, \ldots, k+n-1$ corresponds to a cycle $\gamma_{k}$ (possibly of length 1 ) containing the vertex $k$. - Since it is possible to rearrange the pieces into one single $1 \times n^{2}$ strip, the graph $\Gamma$ has an Eulerian cycle. - The number of edges of $\Gamma$ is equal to the total number of cut pieces.  The goal is to prove that $\Gamma$ has at least $2 n-1$ edges. Since $\Gamma$ has an Eulerian cycle, it is connected. For every $1 \leqslant k \leqslant n$, pick one edge from $\gamma_{k}$, delete it from $\Gamma$ to obtain a new graph $\Gamma^{\prime}$. Since no two cycles $\gamma_{i}$ and $\gamma_{j}$ share a common edge, removing one edge from each cycle does not affect the connectivity of the graph. This shows that the new graph $\Gamma^{\prime}$ must also be connected. Therefore $\Gamma^{\prime}$ has at least $n-1$ edges, which means that $\Gamma$ has at least $2 n-1$ edges.


Solution: We provide an alternative proof that at least $2 n-1$ pieces are needed. Instead of having a linear strip, we work with a number of circular strips, each having length a multiple of $n$ and labelled as  $$ 1,2, \ldots, n, 1,2, \ldots, n, \ldots, 1,2, \ldots, n $$  where there are $n^{2}$ cells in total across all circular strips. The goal is still to create the $n \times n$ square by cutting and translating. Here, when we say "translating" the strips, we imagine that each cell has a number written on it and the final $n \times n$ square is required to have every number written in the same upright, non-mirrored orientation.  Note that the number of cuts will be equal to the number of pieces, because performing $l \geqslant 1$ cuts on a single circular strip results in $l$ pieces.  Consider any "seam" in the interior of the final square, between two squares $S$ and $T$, so that $S$ and $T$ belongs to two separate pieces. We are interested in the positions of these two squares in the original circular strips, with the aim of removing the seam.  - If the two squares $S$ and $T$ come from the same circular strip and are adjacent, then the cut was unnecessary and we can simply remove the seam and reduce the number of required cuts by 1 . The circular strips are not affected. - If these two squares $S$ and $T$ were not adjacent, then they are next to two different cuts (either from the same circular strip or two different circular strips). Denote the two cuts by $(S \mid Y)$ and $(X \mid T)$. We perform these two cuts and then glue the pieces back according to $(S \mid T)$ and $(X \mid Y)$. Performing this move would either split one circular strip into two or merge two circular strips into one, changing the number of circular strips by at most one. Afterwards, we may eliminate cut $(S \mid T)$ since it is no longer needed, which also removes the corresponding seam from the final square.  By iterating this process, eventually we reach a state where there are some number of circular strips, but the final $n \times n$ square no longer has any interior seams.  Since no two rows of the square can be glued together while maintaining the consecutive numbering, the only possibility is to have exactly $n$ circular strips, each with length $n$. In this state at least $n$ cuts are required to reassemble the square. Recall that each seam removal operation changed the number of circular strips by at most one. So if we started with only one initial circular strip, then at least $n-1$ seams were removed. Hence in total, at least $n+(n-1)=2 n-1$ cuts are required to transform one initial circular strip into the final square. Hence at least $2 n-1$ pieces are required to achieve the desired outcome.


Solution: As with the previous solution, we again work with circular strips. In particular, we start out with $k$ circular strips, each having length a multiple of $n$ and labelled as  $$ 1,2, \ldots, n, 1,2, \ldots, n, \ldots, 1,2, \ldots, n $$  where there are $n^{2}$ cells in total across all $k$ circular strips. The goal is still to create the $n \times n$ square by cutting and translating the circular strips. Claim. Constructing the $n \times n$ square requires at least $2 n-k$ cuts (or alternatively, $2 n-k$ pieces). Proof. We prove by induction on $n$. The base case $n=1$ is clear, because we can only have $k=1$ and the only way of producing a $1 \times 1$ square from a $1 \times 1$ circular strip is by making a single cut. We now assume that $n \geqslant 2$ and the statement is true for $n-1$.  Each cut is a cut between a cell of label $i$ on the left and a cell of label $i+1$ on the right side, for a unique $1 \leqslant i \leqslant n$. Let $a_{i}$ be the number of such cuts, so that $a_{1}+a_{2}+\cdots+a_{n}$ is the total number of cuts. Since all the left and right edges of the $n \times n$ square at the end must be cut, we have $a_{i} \geqslant 1$ for all $1 \leqslant i \leqslant n$.  If $a_{i} \geqslant 2$ for all $i$, then  $$ a_{1}+a_{2}+\cdots+a_{n} \geqslant 2 n>2 n-k $$  and hence there is nothing to prove. We therefore assume that there exist some $1 \leqslant m \leqslant n$ for which $a_{m}=1$. This unique cut must form the two ends of the linear strip  $$ m+1, m+2, \ldots, m-1+n, m+n $$  from the final product. There are two cases. Case 1: The strip is a single connected piece.  In this case, the strip must have come from a single circular strip of length exactly $n$. We now remove this circular strip from of the cutting and pasting process. By definition of $m$, none of the edges between $m$ and $m+1$ are cut. Therefore we may pretend that all the adjacent pairs of cells labelled $m$ and $m+1$ are single cells. The induction hypothesis then implies that  $$ a_{1}+\cdots+a_{m-1}+a_{m+1}+\cdots+a_{n} \geqslant 2(n-1)-(k-1) . $$  Adding back in $a_{m}$, we obtain  $$ a_{1}+\cdots+a_{n} \geqslant 2(n-1)-(k-1)+1=2 n-k . $$  Case 2: The strip is not a single connected piece. Say the linear strip $m+1, \ldots, m+n$ is composed of $l \geqslant 2$ pieces $C_{1}, \ldots, C_{l}$. We claim that if we cut the initial circular strips along both the left and right end points of the pieces $C_{1}, \ldots, C_{l}$, and then remove them, the remaining part consists of at most $k+l-2$ connected pieces (where some of them may be circular and some of them may be linear). This is because $C_{l}, C_{1}$ form a consecutive block of cells on the circular strip, and removing $l-1$ consecutive blocks from $k$ circular strips results in at most $k+(l-1)-1$ connected pieces.  Once we have the connected pieces that form the complement of $C_{1}, \ldots, C_{l}$, we may glue them back at appropriate endpoints to form circular strips. Say we get $k^{\prime}$ circular strips after this procedure. As we are gluing back from at most $k+l-2$ connected pieces, we see that  $$ k^{\prime} \leqslant k+l-2 . $$  We again observe that to get from the new circular strips to the $n-1$ strips of size $1 \times n$, we never have to cut along the cell boundary between labels $m$ and $m+1$. Therefore the induction hypothesis applies, and we conclude that the total number of pieces is bounded below by  $$ l+\left(2(n-1)-k^{\prime}\right) \geqslant l+2(n-1)-(k+l-2)=2 n-k . $$  This finishes the induction step, and therefore the statement holds for all $n$. Taking $k=1$ in the claim, we see that to obtain a $n \times n$ square from a circular $1 \times n^{2}$ strip, we need at least $2 n-1$ connected pieces. This shows that constructing the $n \times n$ square out of a linear $1 \times n^{2}$ strip also requires at least $2 n-1$ pieces.


Let $N$ be a positive integer, and consider an $N \times N$ grid. A right-down path is a sequence of grid cells such that each cell is either one cell to the right of or one cell below the previous cell in the sequence. A right-up path is a sequence of grid cells such that each cell is either one cell to the right of or one cell above the previous cell in the sequence.  Prove that the cells of the $N \times N$ grid cannot be partitioned into less than $N$ right-down or right-up paths. For example, the following partition of the $5 \times 5$ grid uses 5 paths. ![](https://cdn.mathpix.com/cropped/2025_01_09_9538693ed865d47d2de5g-51.jpg?height=421&width=420&top_left_y=606&top_left_x=818) (Canada)

Solution: We define a good parallelogram to be a parallelogram composed of two isosceles right-angled triangles glued together as shown below. ![](https://cdn.mathpix.com/cropped/2025_01_09_9538693ed865d47d2de5g-51.jpg?height=238&width=929&top_left_y=1280&top_left_x=563)  Given any partition into $k$ right-down or right-up paths, we can find a corresponding packing of good parallelograms that leaves an area of $k$ empty. Thus, it suffices to prove that we must leave an area of at least $N$ empty when we pack good parallelograms into an $N \times N$ grid. This is actually equivalent to the original problem since we can uniquely recover the partition into right-down or right-up paths from the corresponding packing of good parallelograms. ![](https://cdn.mathpix.com/cropped/2025_01_09_9538693ed865d47d2de5g-51.jpg?height=609&width=1112&top_left_y=1834&top_left_x=475)  We draw one of the diagonals in each cell so that it does not intersect any of the good parallelograms. Now, view these segments as mirrors, and consider a laser entering each of the $4 N$ boundary edges (with starting direction being perpendicular to the edge), bouncing along these mirrors until it exits at some other edge. When a laser passes through a good parallelogram, its direction goes back to the original one after bouncing two times. Thus, if the final direction of a laser is perpendicular to its initial direction, it must pass through at least one empty triangle. Similarly, if the final direction of a laser is opposite to its initial direction, it must pass though at least two empty triangles. Using this, we will estimate the number of empty triangles in the $N \times N$ grid.  We associate the starting edge of a laser with the edge it exits at. Then, the boundary edges are divided into $2 N$ pairs. These pairs can be classified into three types: (1) a pair of a vertical and a horizontal boundary edge, (2) a pair of boundary edges from the same side, and (3) a pair of boundary edges from opposite sides.  Since the beams do not intersect, we cannot have one type (3) pair from vertical boundary edges and another type (3) pair from horizontal boundary edges. Without loss of generality, we may assume that we have $t$ pairs of type (3) and they are all from vertical boundary edges. Then, out of the remaining boundary edges, there are $2 N$ horizontal boundary edges and $2 N-2 t$ vertical boundary edges. It follows that there must be at least $t$ pairs of type (2) from horizontal boundary edges. We know that a laser corresponding to a pair of type (1) passes through at least one empty triangle, and a laser corresponding to a pair of type (2) passes through at least two empty triangles. Thus, as the beams do not intersect, we have at least $(2 N-2 t)+2 \cdot t=2 N$ empty triangles in the grid, leaving an area of at least $N$ empty as required.


Solution: We apply an induction on $N$. The base case $N=1$ is trivial. Suppose that the claim holds for $N-1$ and prove it for $N \geqslant 2$.  Let us denote the path containing the upper left corner by $P$. If $P$ is right-up, then every cell in $P$ is in the top row or in the leftmost column. By the induction hypothesis, there are at least $N-1$ paths passing through the lower right $(N-1) \times(N-1)$ subgrid. Since $P$ is not amongst them, we have at least $N$ paths.  Next, assume that $P$ is right-down. If $P$ contains the lower right corner, then we get an $(N-1) \times(N-1)$ grid by removing $P$ and glueing the remaining two parts together. The main idea is to extend $P$ so that it contains the lower right corner and the above procedure gives a valid partition of an $(N-1) \times(N-1)$ grid. ![](https://cdn.mathpix.com/cropped/2025_01_09_9538693ed865d47d2de5g-52.jpg?height=412&width=981&top_left_y=1801&top_left_x=543)  We inductively construct $Q$, which denotes an extension of $P$ as a right-down path. Initially, $Q=P$. Let $A$ be the last cell of $Q, B$ be the cell below $A$, and $C$ be the cell to the right of $A$ (if they exist). Suppose that $A$ is not the lower right corner, and that (*) both $B$ and $C$ do not belong to the same path as $A$. Then, we can extend $Q$ as follows (in case we have two or more options, we can choose any one of them to extend $Q$ ).  1. If $B$ belongs to a right-down path $R$, then we add the part of $R$, from $B$ to its end, to $Q$. 2. If $C$ belongs to a right-down path $R$, then we add the part of $R$, from $C$ to its end, to $Q$. 3. If $B$ belongs to a right-up path $R$ which ends at $B$, then we add the part of $R$ in the same column as $B$ to $Q$. 4. If $C$ belongs to a right-up path $R$ which starts at $C$, then we add the part of $R$ in the same row as $C$ to $Q$. 5. Otherwise, $B$ and $C$ must belong to the same right-up path $R$. In this case, we add $B$ and the cell to the right of $B$ to $Q$.  Note that if $B$ does not exist, then case (4) must hold. If $C$ does not exist, then case (3) must hold.  It is easily seen that such an extension also satisfies the hypothesis (*), so we can repeat this construction to get an extension of $P$ containing the lower right corner, denoted by $Q$. We show that this is a desired extension, i.e. the partition of an $(N-1) \times(N-1)$ grid obtained by removing $Q$ and glueing the remaining two parts together consists of right-down or right-up paths.  Take a path $R$ in the partition of the $N \times N$ grid intersecting $Q$. If the intersection of $Q$ and $R$ occurs in case (1) or case (2), then there exists a cell $D$ in $R$ such that the intersection of $Q$ and $R$ is the part of $R$ from $D$ to its end, so $R$ remains a right-down path after removal of $Q$. Similarly, if the intersection of $Q$ and $R$ occurs in case (3) or case (4), then $R$ remains a right-up path after removal of $Q$. If the intersection of $Q$ and $R$ occurs in case (5), then this intersection has exactly two adjacent cells. After the removal of these two cells (as we remove $Q), R$ is divided into two parts that are glued into a right-up path.  Thus, we may apply the induction hypothesis to the resulting partition of an $(N-1) \times(N-1)$ grid, to find that it must contain at least $N-1$ paths. Since $P$ is contained in $Q$ and is not amongst these paths, the original partition must contain at least $N$ paths.


The Imomi archipelago consists of $n \geqslant 2$ islands. Between each pair of distinct islands is a unique ferry line that runs in both directions, and each ferry line is operated by one of $k$ companies. It is known that if any one of the $k$ companies closes all its ferry lines, then it becomes impossible for a traveller, no matter where the traveller starts at, to visit all the islands exactly once (in particular, not returning to the island the traveller started at).  Determine the maximal possible value of $k$ in terms of $n$. (Ukraine) Answer: The largest $k$ is $k=\left\lfloor\log _{2} n\right\rfloor$.

Solution: We reformulate the problem using graph theory. We have a complete graph $K_{n}$ on $n$ nodes (corresponding to islands), and we want to colour the edges (corresponding to ferry lines) with $k$ colours (corresponding to companies), so that every Hamiltonian path contains all $k$ different colours. For a fixed set of $k$ colours, we say that an edge colouring of $K_{n}$ is good if every Hamiltonian path contains an edge of each one of these $k$ colours.  We first construct a good colouring of $K_{n}$ using $k=\left\lfloor\log _{2} n\right\rfloor$ colours. Claim 1. Take $k=\left\lfloor\log _{2} n\right\rfloor$. Consider the complete graph $K_{n}$ in which the nodes are labelled by $1,2, \ldots, n$. Colour node $i$ with colour $\min \left(\left\lfloor\log _{2} i\right\rfloor+1, k\right)$ (so the colours of the first nodes are $1,2,2,3,3,3,3,4, \ldots$ and the last $n-2^{k-1}+1$ nodes have colour $k$ ), and for $1 \leqslant i<j \leqslant n$, colour the edge $i j$ with the colour of the node $i$. Then the resulting edge colouring of $K_{n}$ is good. Proof. We need to check that every Hamiltonian path contains edges of every single colour. We first observe that the number of nodes assigned colour $k$ is $n-2^{k-1}+1$. Since $n \geqslant 2^{k}$, we have  $$ n-2^{k-1}+1 \geqslant \frac{n}{2}+1 $$  This implies that in any Hamiltonian path, there exists an edge between two nodes with colour $k$. Then that edge must have colour $k$.  We next show that for each $1 \leqslant i<k$, every Hamiltonian path contains an edge of colour $i$. Suppose the contrary, that some Hamiltonian path does not contain an edge of colour $i$. Then nodes with colour $i$ can only be adjacent to nodes with colour less than $i$ inside the Hamiltonian path. Since there are $2^{i-1}$ nodes with colour $i$ and $2^{i-1}-1$ nodes with colour less than $i$, the Hamiltonian path must take the form  $$ (i) \leftrightarrow(<i) \leftrightarrow(i) \leftrightarrow(<i) \leftrightarrow \cdots \leftrightarrow(<i) \leftrightarrow(i), $$  where $(i)$ denotes a node with colour $i,(<i)$ denotes a node with colour less than $i$, and $\leftrightarrow$ denotes an edge. But this is impossible, as the Hamiltonian path would not have any nodes with colours greater than $i$.  Fix a set of $k$ colours, we now prove that if there exists a good colouring of $K_{n}$, then $k \leqslant\left\lfloor\log _{2} n\right\rfloor$. For $n=2$, this is trivial, so we assume $n \geqslant 3$. For any node $v$ of $K_{n}$ and $1 \leqslant i \leqslant k$, we denote by $d_{i}(v)$ the number of edges with colour $i$ incident with the node $v$. Lemma 1. Consider a good colouring of $K_{n}$, and let $A B$ be an arbitrary edge with colour $i$. If $d_{i}(A)+d_{i}(B) \leqslant n-1$, then the colouring will remain good after recolouring edge $A B$ with any other colour. Proof. Suppose there exists a good colouring together with an edge $A B$ of colour $i$, such that if $A B$ is recoloured with another colour, the colouring will no longer be good. The failure of the new colouring being good will come from colour $i$, and thus there exists a Hamiltonian path containing edge $A B$ such that initially (i.e. before recolouring) $A B$ is the only edge of colour $i$ in this path. Writing $A=A_{0}$ and $B=B_{0}$, denote this Hamiltonian path by  $$ A_{s} \leftrightarrow A_{s-1} \leftrightarrow \cdots \leftrightarrow A_{1} \leftrightarrow A_{0} \leftrightarrow B_{0} \leftrightarrow B_{1} \leftrightarrow \cdots \leftrightarrow B_{t-1} \leftrightarrow B_{t}, $$  where $s, t \geqslant 0$ and $s+t+2=n$. In the initial colouring, we observe the following.  - The edge $B_{0} A_{s}$ must have colour $i$, since otherwise the path  $$ A_{0} \leftrightarrow A_{1} \leftrightarrow \cdots \leftrightarrow A_{s-1} \leftrightarrow A_{s} \leftrightarrow B_{0} \leftrightarrow B_{1} \leftrightarrow \cdots \leftrightarrow B_{t-1} \leftrightarrow B_{t} $$  has no edges of colour $i$.  - Similarly, the edge $A_{0} B_{t}$ must have colour $i$. - For each $0 \leqslant p<s$, at least one of the edges $B_{0} A_{p}$ and $A_{0} A_{p+1}$ must have colour $i$, since otherwise the path  $$ A_{s} \leftrightarrow \cdots \leftrightarrow A_{p+2} \leftrightarrow A_{p+1} \leftrightarrow A_{0} \leftrightarrow A_{1} \leftrightarrow \cdots \leftrightarrow A_{p-1} \leftrightarrow A_{p} \leftrightarrow B_{0} \leftrightarrow B_{1} \leftrightarrow \cdots \leftrightarrow B_{t} $$  has no edges of colour $i$.  - Similarly, for each $0 \leqslant q<t$, at least one of the edges $A_{0} B_{q}$ and $B_{0} B_{q+1}$ must have colour $i$.  In the above list, each edge $A_{0} X$ appears exactly once and also each edge $B_{0} X$ appears exactly once (where $A_{0} B_{0}$ and $B_{0} A_{0}$ are counted separately). Adding up the contributions to $d_{i}(A)+$ $d_{i}(B)$, we obtain  $$ d_{i}(A)+d_{i}(B) \geqslant(s+1)+(t+1)=n . $$  This contradicts our assumption that $d_{i}(A)+d_{i}(B) \leqslant n-1$. Our strategy now is to repeatedly recolour the edges using Lemma 1 until the colouring has a simple structure. For a node $v$, we define $m(v)$ to be the largest value of $d_{i}(v)$ over all colours $i$. Lemma 2. Assume we have a good colouring of $K_{n}$. Let $A, B$ be two distinct nodes, and let $j$ be the colour of edge $A B$ where $1 \leqslant j \leqslant k$. If  - $m(A) \geqslant m(B)$ and - $m(A)=d_{i}(A)$ for some $i \neq j$, then after recolouring edge $A B$ with colour $i$, the colouring remains good. Proof. Note that  $$ d_{j}(A)+d_{j}(B) \leqslant(n-1-m(A))+m(B) \leqslant n-1, $$  and so we may apply Lemma 1. Lemma 3. Assume we have a good colouring of $K_{n}$. Let $S$ be a nonempty set of nodes. Let $A \in S$ be a node such that $m(A) \geqslant m(B)$ for all $B \in S$, and choose $1 \leqslant i \leqslant k$ for which $d_{i}(A)=m(A)$. Then after recolouring the edge $A B$ with colour $i$ for all $B \in S$ distinct from $A$, the colouring remains good. Proof. We repeatedly perform the following operation until all edges $A B$ with $B \in S$ have colour $i$ : choose an edge $A B$ with $B \in S$ that does not have colour $i$, and recolour it with colour $i$. By Lemma 2, the colouring remains good after one operation. Moreover, $m(A)$ increase by 1 during an operation, and all other $m(B)$ may increase by at most 1 . This shows that $m(A)$ will remain maximal amongst $m(B)$ for $B \in S$. We will also have $d_{i}(A)=m(A)$ after the operation, since both sides increase by 1 . Therefore the operation can be performed repeatedly, and the colouring remains good.  We first apply Lemma 3 to the set of all $n$ nodes in $K_{n}$. After recolouring, there exists a node $A_{1}$ such that every edge incident with $A_{1}$ has colour $c_{1}$. We then apply Lemma 3 to the set of nodes excluding $A_{1}$, and we obtain a colouring where  - every edge incident with $A_{1}$ has colour $c_{1}$, - every edge incident with $A_{2}$ except for $A_{1} A_{2}$ has colour $c_{2}$.  Repeating this process, we arrive at the following configuration:  - the $n$ nodes of $K_{n}$ are labelled $A_{1}, A_{2}, \ldots, A_{n}$, - the node $A_{i}$ has a corresponding colour $c_{i}$ (as a convention, we also colour $A_{i}$ with $c_{i}$ ), - for all $1 \leqslant u<v \leqslant n$, the edge between $A_{u}$ and $A_{v}$ has colour $c_{u}$, - this colouring is good.  Claim 2. For every colour $i$, there exists a $1 \leqslant p \leqslant n$ such that the number of nodes of colour $i$ amongst $A_{1}, \ldots, A_{p}$ is greater than $p / 2$. Proof. Suppose the contrary, that for every $1 \leqslant p \leqslant n$, there are at most $\lfloor p / 2\rfloor$ nodes of colour $i$. We then construct a Hamiltonian path not containing any edge of colour $i$. Let $A_{x_{1}}, \ldots, A_{x_{t}}$ be the nodes with colour $i$, where $x_{1}<x_{2}<\cdots<x_{t}$, and let $A_{y_{1}}, A_{y_{2}}, \ldots, A_{y_{s}}$ be the nodes with colour different from $i$, where $y_{1}<y_{2}<\cdots<y_{s}$. We have $s+t=n$ and $t \leqslant\lfloor n / 2\rfloor$, so $t \leqslant s$. We also see that $y_{j}<x_{j}$ for all $1 \leqslant j \leqslant t$, because otherwise, $A_{1}, A_{2}, \ldots, A_{x_{j}}$ will have $j$ nodes of colour $i$ and less than $j$ nodes of colour different from $i$. Then we can construct a Hamiltonian path  $$ A_{x_{1}} \leftrightarrow A_{y_{1}} \leftrightarrow A_{x_{2}} \leftrightarrow A_{y_{2}} \leftrightarrow A_{x_{3}} \leftrightarrow \cdots \leftrightarrow A_{x_{t}} \leftrightarrow A_{y_{t}} \leftrightarrow A_{y_{t+1}} \leftrightarrow \cdots \leftrightarrow A_{y_{s}} $$  that does not contain an edge with colour $i$. This contradicts that the colouring is good. So for every colour $i$, there has to be an integer $p_{i}$ with $1 \leqslant p_{i} \leqslant n$ such that there are more than $p_{i} / 2$ nodes assigned colour $i$ amongst $A_{1}, \ldots, A_{p_{i}}$. Choose the smallest such $p_{i}$ for every $i$, and without loss of generality assume  $$ p_{1}<p_{2}<\cdots<p_{k} $$  Note that the inequalities are strict by the definition of $p_{i}$. Then amongst the nodes $A_{1}, \ldots, A_{p_{i}}$, there are at least $\left\lceil\left(p_{j}+1\right) / 2\right\rceil$ nodes of colour $j$ for all $1 \leqslant j \leqslant i$. Then  $$ p_{i} \geqslant\left\lceil\frac{p_{1}+1}{2}\right\rceil+\left\lceil\frac{p_{2}+1}{2}\right\rceil+\cdots+\left\lceil\frac{p_{i}+1}{2}\right\rceil . $$  This inductively shows that  $$ p_{i} \geqslant 2^{i}-1 $$  for all $1 \leqslant i \leqslant k$, and this already proves $n \geqslant 2^{k}-1$. It remains to show that $n=2^{k}-1$ is not possible. If $n=2^{k}-1$, then all inequalities have to be equalities, so $p_{i}=2^{i}-1$ and there must be exactly $2^{i-1}$ nodes of colour $i$. Moreover, there cannot be a node of colour $i$ amongst $A_{1}, A_{2}, \ldots, A_{p_{i-1}}$, and so the set of nodes of colour $i$ must precisely be  $$ A_{2^{i-1}}, A_{2^{i-1}+1}, \ldots, A_{2^{i}-1} $$  Then we can form a Hamiltonian path  $$ A_{2^{k-1}} \leftrightarrow A_{1} \leftrightarrow A_{2^{k-1}+1} \leftrightarrow A_{2} \leftrightarrow A_{2^{k-1}+2} \leftrightarrow A_{3} \leftrightarrow \ldots \leftrightarrow A_{n} $$  which does not contain an edge of colour $k$. This is a contradiction, and therefore $n \geqslant 2^{k}$.


Let $A B C$ be a triangle with $A C>B C$. Let $\omega$ be the circumcircle of triangle $A B C$ and let $r$ be the radius of $\omega$. Point $P$ lies on segment $A C$ such that $B C=C P$ and point $S$ is the foot of the perpendicular from $P$ to line $A B$. Let ray $B P$ intersect $\omega$ again at $D$ and let $Q$ lie on line $S P$ such that $P Q=r$ and $S, P, Q$ lie on the line in that order. Finally, let the line perpendicular to $C Q$ from $A$ intersect the line perpendicular to $D Q$ from $B$ at $E$.  Prove that $E$ lies on $\omega$.  Solution 1 (Similar Triangles). ![](https://cdn.mathpix.com/cropped/2025_01_09_9538693ed865d47d2de5g-60.jpg?height=1166&width=1200&top_left_y=748&top_left_x=422)  First observe that  $$ \angle D P A=\angle B P C \stackrel{C P=C B}{=} \angle C B P=\angle C B D=\angle C A D=\angle P A D $$  so $D P=D A$. Thus there is a symmetry in the problem statement swapping $(A, D) \leftrightarrow(B, C)$. Let $O$ be the centre of $\omega$ and let $E$ be the reflection of $P$ in $C D$ which, by  $$ \angle C E D=\angle D P C=180^{\circ}-\angle C P B B^{C P=C B} 180^{\circ}-\angle P B C=180^{\circ}-\angle D B C $$  lies on $\omega$. We claim the two lines concur at $E$. By the symmetry noted above, it suffices to prove that $B E \perp D Q$ and then $A E \perp C Q$ will follow by symmetry.  We have $A O=P Q, A D=D P$ and  $$ \angle D A O=90^{\circ}-\angle A B D^{P Q \perp A B} \angle D P Q $$  Hence $\triangle A O D \cong \triangle P Q D$. Thus $\angle Q D B+\angle D B E=\angle O D A+\angle D A E \stackrel{D E \equiv D A}{=} \angle O D A+\angle A E D=\left(90^{\circ}-\angle A E D\right)+\angle A E D=90^{\circ}$ giving $B E \perp D Q$ as required.


Let $A B C$ be an acute-angled triangle with $A B<A C$. Denote its circumcircle by $\Omega$ and denote the midpoint of $\operatorname{arc} C A B$ by $S$. Let the perpendicular from $A$ to $B C$ meet $B S$ and $\Omega$ at $D$ and $E \neq A$ respectively. Let the line through $D$ parallel to $B C$ meet line $B E$ at $L$ and denote the circumcircle of triangle $B D L$ by $\omega$. Let $\omega$ meet $\Omega$ again at $P \neq B$.  Prove that the line tangent to $\omega$ at $P$, and line $B S$ intersect on the internal bisector of $\angle B A C$. (Portugal) Solution 1 (Triangles in Perspective). Let $S^{\prime}$ be the midpoint of arc $B C$ of $\Omega$, diametrically opposite to $S$ so $S S^{\prime}$ is a diameter in $\Omega$ and $A S^{\prime}$ is the angle bisector of $\angle B A C$. Let the tangent of $\omega$ at $P$ meet $\Omega$ again at $Q \neq P$, then we have $\angle S Q S^{\prime}=90^{\circ}$.  We will show that triangles $A P D$ and $S^{\prime} Q S$ are similar and their corresponding sides are parallel. Then it will follow that the lines connecting the corresponding vertices, namely line $A S^{\prime}$, that is the angle bisector of $\angle B A C$, line $P Q$, that is the tangent to $\omega$ at $P$, and $D S$ are concurrent. Note that the sides $A D$ and $S^{\prime} S$ have opposite directions, so the three lines cannot be parallel. ![](https://cdn.mathpix.com/cropped/2025_01_09_9538693ed865d47d2de5g-65.jpg?height=1084&width=1343&top_left_y=1097&top_left_x=362)  First we show that $A P \perp D P$. Indeed, from cyclic quadrilaterals $A P B E$ and $D P L B$ we can see that  $$ \angle P A D=\angle P A E=180^{\circ}-\angle E B P=\angle P B L=\angle P D L=90^{\circ}-\angle A D P . $$  Then, in triangle $A P D$ we have $\angle D P A=180^{\circ}-\angle P A D-\angle A D P=90^{\circ}$. Now we can see that:  - Both lines $A D E$ and $S S^{\prime}$ are perpendicular to $B C$, so $A D \| S^{\prime} S$. - Line $P Q$ is tangent to circle $\omega$ at $P$ so $\angle D P Q=\angle D B P=\angle S B P=\angle S Q P$; it follows that $P D \| Q S$. - Finally, since $A P \perp P D \| Q S \perp S^{\prime} Q$, we have $A P \| S^{\prime} Q$ as well.  Hence the corresponding sides of triangles $A P D$ and $S^{\prime} Q S$ are parallel completing the solution.  Solution 2 (Pascal). Again, let $S^{\prime \prime}$ be the midpoint of arc $B C$, diametrically opposite to $S$, so $A E S^{\prime} S$ is an isosceles trapezoid, and $\angle S^{\prime} B S=\angle S^{\prime} P S=90^{\circ}$. Let lines $A E$ and $P S^{\prime}$ meet at $T$ and let $A P$ and $S^{\prime} B$ meet at point $M$.  We will need that points $L, P, S$ are collinear, and points $T$ and $M$ lie on circle $\omega$.  - From $\angle L P B=\angle L D B=90^{\circ}-\angle B D E=90^{\circ}-\angle B S S^{\prime}=\angle S S^{\prime} B=180^{\circ}-\angle B P S$ we get $\angle L P B+\angle B P S=180^{\circ}$, so $L, P$ and $S$ are indeed collinear. - Since $S S^{\prime}$ is a diameter in $\Omega$, lines $L P S$ and $P T S^{\prime}$ are perpendicular. We also have $L D \|$ $B C \perp A E$ hence $\angle L D T=\angle L P T=90^{\circ}$ and therefore $T \in \omega$. - By $\angle L P M=\angle S P A=\angle S E A=\angle E A S^{\prime}=\angle E B S^{\prime}=\angle L B M$, point $M$ is concyclic with $B, P, L$ so $M \in \omega$. ![](https://cdn.mathpix.com/cropped/2025_01_09_9538693ed865d47d2de5g-67.jpg?height=1098&width=1355&top_left_y=910&top_left_x=362)  Now let $X$ be the intersection of line $B D S$ with the tangent of $\omega$ at $P$ and apply Pascal's theorem to the degenerate cyclic hexagon $P P M B D T$. This gives points $P P \cap B D=X$, $P M \cap D T=A$ and $M B \cap T P=S^{\prime}$ are collinear so $X$ lies on line $A S^{\prime}$, that is the bisector of $\angle B A C$.  Comment. It is easy to see that $L M T D$ is a rectangle, but we did not need this information for the solution.  Solution 3 (Projections). Let $A^{\prime}$ and $S^{\prime}$ be the points of $\Omega$ diametrically opposite to $A$ and $S$ respectively. It is well-known that $E$ and $A^{\prime}$ are reflections with respect to $S S^{\prime}$ so $A S^{\prime}$ is the angle bisector of $\angle E A A^{\prime}$. Define point $T$ to be the intersection of $A E$ and $P S^{\prime}$. As in the previous two solutions, we have: $\angle D P A=90^{\circ}$ so $P D$ passes through $A^{\prime}$; points $L, P, S$ are collinear; and $T \in \omega$.  Let lines $A S^{\prime}$ and $P D A^{\prime}$ meet at $R$. From the angles of triangles $P R S^{\prime}$ and $P T E$ we get  $$ \angle A R P=\angle A S^{\prime} P+\angle S^{\prime} P A^{\prime}=\angle A E P+\angle E P S^{\prime}=\angle A T P $$  so points $A, P, T, R$ are concyclic. Denote their circle by $\gamma$. Due to $\angle R P A=\angle D P A=90^{\circ}$, segment $A R$ is a diameter in $\gamma$. ![](https://cdn.mathpix.com/cropped/2025_01_09_9538693ed865d47d2de5g-68.jpg?height=1194&width=1326&top_left_y=745&top_left_x=382)  We claim that circles $\omega$ and $\gamma$ are perpendicular. Let line $L P S$ meet $\gamma$ again at $U \neq P$, and consider triangles $P L T$ and $P T U$. By $\angle L P T=\angle T P U=90^{\circ}$ and  $$ \angle P T L=\angle P B L=180^{\circ}-\angle E B P=\angle P A E=\angle P A T=\angle P U T, $$  triangles $P L T$ and $P T U$ are similar. It follows that the spiral similarity that takes $P L T$ to PTU, maps $\omega$ to $\gamma$ and the angle of this similarity is $90^{\circ}$, so circles $\omega$ and $\gamma$ are indeed perpendicular.  Finally, let lines $B D S$ and $A R S^{\prime}$ meet at $X$. We claim that $X$ bisects $A R$, so point $X$ is the centre of $\gamma$ and, as $\omega$ and $\gamma$ are perpendicular, $P X$ is tangent to $\omega$.  Let $t$ be the tangent of $\omega$ at $D$. From $\angle(D T, t)=\angle T P D=\angle S^{\prime} P A^{\prime}=\angle E A S^{\prime}$ it can be seen that $t \| A S^{\prime}$. Let $I$ be the common point at infinity of $t$ and $A S^{\prime}$. Moreover, let lines $L P S$ and $A D T E$ meet at $V$. By projecting line $A S^{\prime}$ to circle $\omega$ through $D$, then projecting $\omega$ to line $A E$ through $L$, finally projecting $A E$ to $\Omega$ through $P$, we find  $$ \frac{A X}{R X}=(A, R ; X, I) \stackrel{D}{=}(T, P ; B, D) \stackrel{L}{\underline{L}}(T, V ; E, D) \stackrel{P}{=}\left(S^{\prime}, S ; E, A^{\prime}\right)=-1 $$  so $X$ is the midpoint of $A R$.


Let $A B C$ be an acute-angled triangle with circumcircle $\omega$. A circle $\Gamma$ is internally tangent to $\omega$ at $A$ and also tangent to $B C$ at $D$. Let $A B$ and $A C$ intersect $\Gamma$ at $P$ and $Q$ respectively. Let $M$ and $N$ be points on line $B C$ such that $B$ is the midpoint of $D M$ and $C$ is the midpoint of $D N$. Lines $M P$ and $N Q$ meet at $K$ and intersect $\Gamma$ again at $I$ and $J$ respectively. The ray $K A$ meets the circumcircle of triangle $I J K$ at $X \neq K$.  Prove that $\angle B X P=\angle C X Q$. (United Kingdom)


Let $A B C$ be an acute, scalene triangle with orthocentre $H$. Let $\ell_{a}$ be the line through the reflection of $B$ with respect to $C H$ and the reflection of $C$ with respect to $B H$. Lines $\ell_{b}$ and $\ell_{c}$ are defined similarly. Suppose lines $\ell_{a}, \ell_{b}$, and $\ell_{c}$ determine a triangle $\mathcal{T}$.  Prove that the orthocentre of $\mathcal{T}$, the circumcentre of $\mathcal{T}$ and $H$ are collinear. (Ukraine)

Solution: ![](https://cdn.mathpix.com/cropped/2025_01_09_9538693ed865d47d2de5g-76.jpg?height=1314&width=1326&top_left_y=762&top_left_x=391)  We write $\triangle P_{1} P_{2} P_{3} \stackrel{ \pm}{\sim} \triangle Q_{1} Q_{2} Q_{3}$ (resp. $\triangle P_{1} P_{2} P_{3} \approx \triangle Q_{1} Q_{2} Q_{3}$ ) to indicate that two triangles are directly (resp. oppositely) similar. We use directed angles throughout denoted with $\Varangle$.  Denote by $A_{b}, A_{c}$ the reflections of $A$ in $B H$ and $C H$ respectively. $B_{c}, B_{a}$ and $C_{a}, C_{b}$ are defined similarly. By definition, $\ell_{a}=B_{c} C_{b}, \ell_{b}=C_{a} A_{c}, \ell_{c}=A_{b} B_{a}$. Let $A_{1}=\ell_{b} \cap \ell_{c}$, $B_{1}=\ell_{c} \cap \ell_{a}, C_{1}=\ell_{a} \cap \ell_{b}$ and let $O_{1}, H_{1}$ be the orthocentre and circumcentre of $\mathcal{T} \equiv \triangle A_{1} B_{1} C_{1}$ respectively. Claim 1. $\triangle A A_{b} A_{c} \approx \triangle A B C$. Proof. Let $P=B H \cap A C, Q=C H \cap A B$, then it is well known that $\triangle A P Q \approx \triangle A B C$. By the dilation with factor 2 centred at $A, \triangle A P Q$ is sent to $\triangle A A_{b} A_{c}$, so we have $\triangle A A_{b} A_{c} \sim \triangle A B C$.  Claim 2. $\triangle A A_{b} A_{c} \stackrel{\downarrow}{\sim} \triangle A B_{a} C_{a}$ and $A_{1}$ lies on the circumcircle of $\triangle A A_{b} A_{c}$ which is centred at $H$. Proof. Since $B_{a}, C_{a}$ are reflections of $B, C$ in $A H$, we have $\triangle A B_{a} C_{a} \approx \triangle A B C$. Combining this with Claim 1, we have $\triangle A A_{b} A_{c} \stackrel{\downarrow}{\sim} \triangle A B_{a} C_{a}$, where $A$ is the centre of this similarity. Therefore, $\Varangle A_{c} A_{1} A_{b}=\Varangle A_{c} A A_{b}$ meaning $A_{1}$ lies on $\odot A A_{b} A_{c}$. By symmetry, $H A_{b}=H A=H A_{c}$, so $H$ is centre of this circle.  Claim 3. $\triangle A_{1} B_{1} C_{1} \approx \triangle A B C$. Proof. From Claim 2 we have  $$ \Varangle C_{1} A_{1} B_{1}=\Varangle A_{c} A_{1} A_{b} \stackrel{\text { Claim } 2}{=} \npreceq A_{c} A A_{b}=-\Varangle C A B $$  and similarly $\Varangle A_{1} B_{1} C_{1}=-\Varangle A B C, \Varangle B_{1} C_{1} A_{1}=-\Varangle B C A$, which imply $\triangle A_{1} B_{1} C_{1} \approx \triangle A B C$.  Denote the ratio of similitude of $\triangle A_{1} B_{1} C_{1}$ and $\triangle A B C$ by $\lambda\left(=\frac{B_{1} C_{1}}{B C}\right)$, then  $$ \lambda=\frac{H_{1} A_{1}}{H A}=\frac{H_{1} B_{1}}{H B}=\frac{H_{1} C_{1}}{H C} . $$  Since $H A=H A_{1}$ and similarly $H B=H B_{1}, H C=H C_{1}$ from Claim 2, we get  $$ \lambda=\frac{H_{1} A_{1}}{H A_{1}}=\frac{H_{1} B_{1}}{H B_{1}}=\frac{H_{1} C_{1}}{H C_{1}} . $$  Therefore, the circle $A_{1} B_{1} C_{1}$ is the Apollonian circle of the segment $H H_{1}$ with ratio $\lambda$ so the line $H H_{1}$ passes through $O_{1}$.


Solution: We use the same notation $A_{b}, A_{c}, B_{c}, B_{a}, C_{a}, C_{b}$ and $A_{1}, B_{1}, C_{1}, O_{1}, H_{1}$ as in   Let $O$ be the circumcentre of $\triangle A B C$ and $A_{2}$ be the reflection of $A_{1}$ in $A H$. As $\odot A A_{b} A_{c}$ is centred at $H, A_{2}$ also lies on this circle.  By Claim 2, $\Varangle B_{a} A_{1} C_{a}=\Varangle A_{b} A A_{c}=\Varangle B_{a} A C_{a}$, so $A_{1}$ lies on $\odot A B_{a} C_{a}$. Reflecting this in $A H$ gives that $A_{2}$ lies on $\odot A B C$. We now have circles centred at $O$ and $H$ passing through $A$ and $A_{2}$ so these points are symmetric with respect to $O H$. Define $B_{2}$ and $C_{2}$ similarly then $\triangle A B C$ and $\triangle A_{2} B_{2} C_{2}$ are symmetric with respect to $O H$ and also $\odot A B C=\odot A_{2} B_{2} C_{2}$. ![](https://cdn.mathpix.com/cropped/2025_01_09_9538693ed865d47d2de5g-78.jpg?height=1512&width=1475&top_left_y=723&top_left_x=296)  Claim 4. $A_{1} A_{2}, B_{1} B_{2}$ and $C_{1} C_{2}$ have an intersection on $\odot A B C$ which we denote by $T$. Proof. Let $T=A_{1} A_{2} \cap B_{1} B_{2}$. Since $A_{1} A_{2} \| B C$ and $B_{1} B_{2} \| A C$, we have  $$ \Varangle A_{2} T B_{2}=\Varangle B C A=-\Varangle B_{2} C_{2} A_{2}=\Varangle A_{2} C_{2} B_{2} . $$  So $T$ lies on $\odot A_{2} B_{2} C_{2}=\odot A B C$. Similarly the intersection of $A_{1} A_{2}$ and $C_{1} C_{2}$ lies on $\odot A B C$, so $C_{1} C_{2}$ also passes through $T$.  Claim 5. $T$ also lies on $\odot A_{1} B_{1} C_{1}$ and $T$ corresponds to $T$ itself under the similarity $\triangle A_{1} B_{1} C_{1} \approx$ $\triangle A B C$.  Proof. We know $\triangle A_{1} B_{1} C_{1} \sim \triangle A B C$ by Claim 3. We also have  $$ \Varangle B_{1} T C_{1}=\Varangle B_{2} T C_{2}=\Varangle B_{2} A_{2} C_{2}=-\Varangle B A C \stackrel{\text { Claim } 3}{=} \not B_{1} A_{1} C_{1}, $$  so $T$ lies on $\odot A_{1} B_{1} C_{1}$. The remaining part is concluded by the following angle chase:  $$ \Varangle A_{1} B_{1} T=\Varangle A_{1} B_{1} B_{2} \stackrel{B_{1} B_{2} \| A C}{\underline{\|}} \npreceq A_{1} A_{b} A=\Varangle A_{1} A_{2} A=-\Varangle A A_{2} T=-\Varangle A B T . $$  Claim 6. The circumradius of $\triangle A_{1} B_{1} C_{1}$ is equal to $H O$. Proof. Two circles centred at $H$ intersect $\ell_{c}$ at $A_{1}, A_{b}$ and $B_{1}, B_{a}$, so $A_{1} A_{b}$ and $B_{1} B_{a}$ have the same midpoint and thus $A_{1} B_{1}=A_{b} B_{a}$. Consider the spiral symmetry $\triangle A A_{b} A_{c} \stackrel{\downarrow}{\sim} \triangle A B_{a} C_{a}$. This takes $H$, the circumcentre of $\triangle A A_{b} A_{c}$, to the circumcentre of $\triangle A B_{a} C_{a}$, denoted by $O_{a}$, which is symmetric to $O$ in $A H$. Hence $\triangle A A_{b} B_{a} \stackrel{ \pm}{\sim} \triangle A H O_{a}$, so  $$ \frac{A A_{b}}{B_{a} A_{b}}=\frac{A H}{H O_{a}}=\frac{A H}{H O} \Longrightarrow \frac{A H}{A A_{b}}=\frac{H O}{A_{b} B_{a}} . $$  Also since $\triangle A_{1} O_{1} B_{1} \stackrel{\downarrow}{\sim} \triangle A H A_{b}$ (both of them are $\approx \triangle A O B$ ), we have  $$ \frac{A_{1} O_{1}}{A_{1} B_{1}}=\frac{A H}{A A_{b}}=\frac{H O}{A_{b} B_{a}}=\frac{H O}{A_{1} B_{1}} \Longrightarrow A_{1} O_{1}=H O $$  as desired.


Determine all positive, composite integers $n$ that satisfy the following property: if the positive divisors of $n$ are $1=d_{1}<d_{2}<\cdots<d_{k}=n$, then $d_{i}$ divides $d_{i+1}+d_{i+2}$ for every $1 \leqslant i \leqslant k-2$. (Colombia) Answer: $n=p^{r}$ is a prime power for some $r \geqslant 2$.

Solution: It is easy to see that such an $n=p^{r}$ with $r \geqslant 2$ satisfies the condition as $d_{i}=p^{i-1}$ with $1 \geqslant i \geqslant k=r+1$ and clearly  $$ p^{i-1} \mid p^{i}+p^{i+1} $$  Now, let us suppose that there is a positive integer $n$ that satisfies the divisibility condition of the problem and that has two different prime divisors $p$ and $q$. Without lost of generality, we assume $p<q$ and that they are the two smallest prime divisors of $n$. Then there is a positive integer $j$ such that  $$ d_{1}=1, d_{2}=p, \ldots, d_{j}=p^{j-1}, d_{j+1}=p^{j}, d_{j+2}=q, $$  and it follows that  $$ d_{k-j-1}=\frac{n}{q}, d_{k-j}=\frac{n}{p^{j}}, d_{k-j+1}=\frac{n}{p^{j-1}}, \ldots, d_{k-1}=\frac{n}{p}, d_{k}=n . $$  Thus  $$ d_{k-j-1}=\frac{n}{q} \left\lvert\, d_{k-j}+d_{k-j+1}=\frac{n}{p^{j}}+\frac{n}{p^{j-1}}=\frac{n}{p^{j}}(p+1) .\right. $$  This gives $p^{j} \mid q(p+1)$, which is a contradiction since $\operatorname{gcd}(p, p+1)=1$ and $p \neq q$.


Solution: Since $d_{i} d_{k+1-i}=n$, we have the equivalence:  $$ d_{k-i-1}\left|d_{k-i}+d_{k-i+1} \Longleftrightarrow \frac{n}{d_{i+2}}\right| \frac{n}{d_{i+1}}+\frac{n}{d_{i}} . $$  We multiply both sides by $d_{i} d_{i+1} d_{i+2}$ and cancel the $n$ 's to get  $$ d_{i} d_{i+1} \mid d_{i} d_{i+2}+d_{i+1} d_{i+2} . $$  Hence,  $$ d_{i} \mid d_{i+1} d_{i+2} $$  Moreover, by the condition of the problem,  $$ d_{i} \mid d_{i+1}\left(d_{i+1}+d_{i+2}\right)=d_{i+1}^{2}+d_{i+1} d_{i+2} . $$  Combining this with (2) we get that $d_{i} \mid d_{i+1}^{2}$ for all $1 \leqslant i \leqslant k-2$. Let $d_{2}=p$ be the smallest prime divisor of $n$. By induction on $i$ we prove that $p \mid d_{i}$ for all $2 \leqslant i \leqslant k-1$. The base case $d_{2}=p$ is obvious. Let us suppose that $p \mid d_{j}$ for some $2 \leqslant j \leqslant k-2$. Then we have that  $$ p\left|d_{j}\right| d_{j+1}^{2} \Longrightarrow p \mid d_{j+1} $$  as $p$ is prime, which completes the induction. This implies that $n$ has to be a prime power, as otherwise there would be another prime $q$ that divides $n$ and we would get that $p \mid q$ which is obviously false.  We finally check that the powers of $p$ satisfy the condition in the statement of the problem as in Solution 1.


Solution: We start by proving the following claim: Claim. $d_{i} \mid d_{i+1}$ for every $1 \leqslant i \leqslant k-1$. Proof. We prove the Claim by induction on $i$; it is trivial for $i=1$ because $d_{1}=1$. Suppose that $2 \leqslant i \leqslant k-1$ and the Claim is true for $i-1$, i.e. $d_{i-1} \mid d_{i}$. By the induction hypothesis and the problem condition, $d_{i-1} \mid d_{i}$ and $d_{i-1} \mid d_{i}+d_{i+1}$, so $d_{i-1} \mid d_{i+1}$.  Now consider the divisors $d_{k-i}=\frac{n}{d_{i+1}}, d_{k-i+1}=\frac{n}{d_{i}}, d_{k-i+2}=\frac{n}{d_{i-1}}$. By the problem condition,  $$ \frac{d_{k-i+1}+d_{k-i+2}}{d_{k-i}}=\frac{\frac{n}{d_{i}}+\frac{n}{d_{i-1}}}{\frac{n}{d_{i+1}}}=\frac{d_{i+1}}{d_{i}}+\frac{d_{i+1}}{d_{i-1}} $$  is an integer. We conclude that $\frac{d_{i+1}}{d_{i}}$ is an integer, so $d_{i} \mid d_{i+1}$. By the Claim, $n$ cannot have two different prime divisors because the smallest one would divide the other one. Hence, $n$ must be a power of a prime, and powers of primes satisfy the condition of the problem as we saw in Solution 1.


Solution: We present here a more technical way of finishing   $$ v_{p}\left(\frac{n}{p^{j}}(p+1)\right)=v_{p}(n)-j $$  as $\operatorname{gcd}(p, p+1)=1$. But (1) implies  $$ v_{p}(n)=v_{p}(n / q) \leqslant v_{p}\left(\frac{n}{p^{j}}(p+1)\right)=v_{p}(n)-j $$  which is a contradiction. Thus $n$ has only one prime divisor as desired.


Determine all pairs $(a, p)$ of positive integers with $p$ prime such that $p^{a}+a^{4}$ is a perfect square. (Bangladesh) Answer: $(a, p)=(1,3),(2,3),(6,3),(9,3)$ are all the possible solutions.

Solution: Let $p^{a}+a^{4}=b^{2}$ for some positive integer $b$. Then we have  $$ p^{a}=b^{2}-a^{4}=\left(b+a^{2}\right)\left(b-a^{2}\right) . $$  Hence both $b+a^{2}$ and $b-a^{2}$ are powers of $p$. Let $b-a^{2}=p^{x}$ for some integer $x$. Then $b+a^{2}=p^{a-x}$ and $a-x>x$. Therefore, we have  $$ 2 a^{2}=\left(b+a^{2}\right)-\left(b-a^{2}\right)=p^{a-x}-p^{x}=p^{x}\left(p^{a-2 x}-1\right) . $$  We shall consider two cases according to whether $p=2$ or $p \neq 2$. We let $v_{p}(m)$ denote the $p$-adic valuation of $m$.  Case $1(p=2)$ : In this case,  $$ a^{2}=2^{x-1}\left(2^{a-2 x}-1\right)=2^{2 v_{2}(a)}\left(2^{a-2 x}-1\right) $$  where the first equality comes from (1) and the second one from $\operatorname{gcd}\left(2,2^{a-2 x}-1\right)=1$. So, $2^{a-2 x}-1$ is a square.  If $v_{2}(a)>0$, then $2^{a-2 x}$ is also a square. So, $2^{a-2 x}-1=0$, and $a=0$ which is a contradiction. If $v_{2}(a)=0$, then $x=1$, and $a^{2}=2^{a-2}-1$. If $a \geqslant 4$, the right hand side is congruent to 3 modulo 4 , thus cannot be a square. It is easy to see that $a=1,2,3$ do not satisfy this condition.  Therefore, we do not get any solutions in this case. Case $2(p \neq 2)$ : In this case, we have $2 v_{p}(a)=x$. Let $m=v_{p}(a)$. Then we have $a^{2}=p^{2 m} \cdot n^{2}$ for some integer $n \geqslant 1$. So, $2 n^{2}=p^{a-2 x}-1=p^{p^{m} \cdot n-4 m}-1$.  We consider two subcases. Subcase 2-1 $(p \geqslant 5)$ : By induction, one can easily prove that $p^{m} \geqslant 5^{m}>4 m$ for all $m$. Then we have  $$ 2 n^{2}+1=p^{p^{m} \cdot n-4 m}>p^{p^{m} \cdot n-p^{m}} \geqslant 5^{5^{m} \cdot(n-1)} \geqslant 5^{n-1} . $$  But, by induction, one can easily prove that $5^{n-1}>2 n^{2}+1$ for all $n \geqslant 3$. Therefore, we conclude that $n=1$ or 2 . If $n=1$ or 2 , then $p=3$, which is a contradiction. So there are no solutions in this subcase.  Subcase 2-2 $(p=3)$ : Then we have $2 n^{2}+1=3^{3^{m} \cdot n-4 m}$. If $m \geqslant 2$, one can easily prove by induction that $3^{m}>4 m$. Then we have  $$ 2 n^{2}+1=3^{3^{m} \cdot n-4 m}>3^{3^{m} \cdot n-3^{m}}=3^{3^{m} \cdot(n-1)} \geqslant 3^{9(n-1)} . $$  Again, by induction, one can easily prove that $3^{9(n-1)}>2 n^{2}+1$ for all $n \geqslant 2$. Therefore, we conclude that $n=1$. Then we have $2 \cdot 1^{2}+1=3^{3^{m}-4 m}$ hence $3=3^{3^{m}-4 m}$. Consequently, we have $3^{m}-4 m=1$. The only solution of this equation is $m=2$ in which case we have $a=3^{m} \cdot n=3^{2} \cdot 1=9$. If $m \leqslant 1$, then there are two possible cases: $m=0$ or $m=1$.  - If $m=1$, then we have $2 n^{2}+1=3^{3 n-4}$. Again, by induction, one can easily prove that $3^{3 n-4}>2 n^{2}+1$ for all $n \geqslant 3$. By checking $n=1,2$, we only get $n=2$ as a solution. This gives $a=3^{m} \cdot n=3^{1} \cdot 2=6$. - If $m=0$, then we have $2 n^{2}+1=3^{n}$. By induction, one can easily prove that $3^{n}>2 n^{2}+1$ for all $n \geqslant 3$. By checking $n=1,2$, we find the solutions $a=3^{0} \cdot 1=1$ and $a=3^{0} \cdot 2=2$.  Therefore, $(a, p)=(1,3),(2,3),(6,3),(9,3)$ are all the possible solutions.


For positive integers $n$ and $k \geqslant 2$ define $E_{k}(n)$ as the greatest exponent $r$ such that $k^{r}$ divides $n$ !. Prove that there are infinitely many $n$ such that $E_{10}(n)>E_{9}(n)$ and infinitely many $m$ such that $E_{10}(m)<E_{9}(m)$. (Brazil)

Solution: We let $v_{p}(m)$ denote the $p$-adic valuation of $m$. By Legendre's Formula we know, for $p$ prime, that $v_{p}(n!)=\lfloor n / p\rfloor+\left\lfloor n / p^{2}\right\rfloor+\cdots$. We can see that $E_{9}(n)=\left\lfloor\frac{v_{3}(n!)}{2}\right\rfloor$. Since $v_{5}(n!) \leqslant v_{2}(n!)$ and $E_{10}(n)=\min \left(v_{5}(n!), v_{2}(n!)\right)$, we have $E_{10}(n)=v_{5}(n!)$.  Let $l$ be a positive integer. Set $n=5^{2 l-1}$. Then we have  $$ E_{10}(n)=v_{5}(n!)=5^{2 l-2}+5^{2 l-3}+\cdots+5+1=\frac{5^{2 l-1}-1}{4}=\frac{n-1}{4} $$  Since $n=5^{2 l-1} \equiv 2(\bmod 3)$, we have $\left\lfloor\frac{n}{3}\right\rfloor=\frac{n-2}{3}$ and it implying  $$ v_{3}(n!)=\left\lfloor\frac{n}{3}\right\rfloor+\left\lfloor\frac{n}{3^{2}}\right\rfloor+\left\lfloor\frac{n}{3^{3}}\right\rfloor+\cdots<\frac{n-2}{3}+\frac{n}{3^{2}}+\frac{n}{3^{3}}+\cdots=\frac{n}{2}-\frac{2}{3} . $$  From this we obtain  $$ E_{9}(n)=\left\lfloor\frac{v_{3}(n!)}{2}\right\rfloor \leqslant \frac{v_{3}(n!)}{2} \leqslant \frac{n}{4}-\frac{1}{3}<\frac{n}{4}-\frac{1}{4}=E_{10}(n) . $$  In a similar way, we set now $m=3^{4 l-2}$. Then we have  $$ v_{3}(m!)=3^{4 l-3}+3^{4 l-4}+\cdots+3+1=\frac{3^{4 l-2}-1}{2}=\frac{m-1}{2} . $$  Note that $m=3^{4 l-2} \equiv 1(\bmod 4)$ and hence $E_{9}(m)=\left\lfloor\frac{v_{3}(m!)}{2}\right\rfloor=\left\lfloor\frac{m-1}{4}\right\rfloor=\frac{m-1}{4}$. We also have $m=3^{4 l-2} \equiv 4(\bmod 5)$ implying $\left\lfloor\frac{m}{5}\right\rfloor=\frac{m-4}{5}$. Therefore we obtain  $$ E_{10}(m)=v_{5}(m!)=\left\lfloor\frac{m}{5}\right\rfloor+\left\lfloor\frac{m}{5^{2}}\right\rfloor+\cdots<\frac{m-4}{5}+\frac{m}{5^{2}}+\cdots=\frac{m}{4}-\frac{4}{5}<\frac{m}{4}-\frac{1}{4}=E_{9}(m) $$  We can take infinitely many $n=5^{2 l-1}$ and $m=3^{4 l-2}$ completing the proof.


Solution: In the setting of  First, we take $n=5^{3^{b-1}}$ with $b \geqslant 2$. Because 5 is not a square modulo 3 and $\varphi\left(3^{b}\right)=2 \cdot 3^{b-1}$, we have $n \equiv-1\left(\bmod 3^{b}\right)$. Hence,  $$ v_{3}(n!)=\left\lfloor\frac{n}{3}\right\rfloor+\left\lfloor\frac{n}{3^{2}}\right\rfloor+\cdots<\frac{n-2}{3}+\frac{n-8}{9}+\cdots+\frac{n-\left(3^{b}-1\right)}{3^{b}}+\frac{n}{3^{b+1}}+\cdots<\frac{n}{2}-b+\frac{1}{2}, $$  and $E_{10}(n)=\frac{n-1}{4}>\frac{n+1-2 b}{4}>E_{9}(n)$. In the same way, for $m=3^{2 \cdot 5^{b-1}} \equiv-1\left(\bmod 5^{b}\right)$ with $b \geqslant 2$, $E_{10}(m)=\left\lfloor\frac{m}{5}\right\rfloor+\left\lfloor\frac{m}{5^{2}}\right\rfloor+\cdots<\frac{m-4}{5}+\frac{m-24}{25}+\cdots+\frac{m-\left(5^{b}-1\right)}{5^{b}}+\frac{m}{5^{b+1}}+\cdots<\frac{m}{4}-b+\frac{1}{4}$, and $E_{9}(m)=\frac{m-1}{4}>E_{10}(m)$ holds. Comment. From Solution 2 we can see that for any positive real $B$, there exist infinitely many positive integers $m$ and $n$ such that $E_{10}(n)-E_{9}(n)>B$ and $E_{10}(m)-E_{9}(m)<-B$.


Let $a_{1}, a_{2}, \ldots, a_{n}, b_{1}, b_{2}, \ldots, b_{n}$ be $2 n$ positive integers such that the $n+1$ products  $$ \begin{gathered} a_{1} a_{2} a_{3} \cdots a_{n} \\ b_{1} a_{2} a_{3} \cdots a_{n} \\ b_{1} b_{2} a_{3} \cdots a_{n} \\ \vdots \\ b_{1} b_{2} b_{3} \cdots b_{n} \end{gathered} $$  form a strictly increasing arithmetic progression in that order. Determine the smallest positive integer that could be the common difference of such an arithmetic progression. (Canada) Answer: The smallest common difference is $n!$.

Solution: The condition in the problem is equivalent to  $$ D=\left(b_{1}-a_{1}\right) a_{2} a_{3} \cdots a_{n}=b_{1}\left(b_{2}-a_{2}\right) a_{3} a_{4} \cdots a_{n}=\cdots=b_{1} b_{2} \cdots b_{n-1}\left(b_{n}-a_{n}\right), $$  where $D$ is the common difference. Since the progression is strictly increasing, $D>0$, hence $b_{i}>a_{i}$ for every $1 \leqslant i \leqslant n$. Individually, these equalities simplify to  $$ \left(b_{i}-a_{i}\right) a_{i+1}=b_{i}\left(b_{i+1}-a_{i+1}\right) \text { for every } 1 \leqslant i \leqslant n-1 $$  If $g_{i}:=\operatorname{gcd}\left(a_{i}, b_{i}\right)>1$ for some $1 \leqslant i \leqslant n$, then we can replace $a_{i}$ with $\frac{a_{i}}{g_{i}}$ and $b_{i}$ with $\frac{b_{i}}{g_{i}}$ to get a smaller common difference. Hence we may assume $\operatorname{gcd}\left(a_{i}, b_{i}\right)=1$ for every $1 \leqslant i \leqslant n$.  Then, we have $\operatorname{gcd}\left(b_{i}-a_{i}, b_{i}\right)=\operatorname{gcd}\left(a_{i}, b_{i}\right)=1$ and $\operatorname{gcd}\left(a_{i+1}, b_{i+1}-a_{i+1}\right)=\operatorname{gcd}\left(a_{i+1}, b_{i+1}\right)=1$ for every $1 \leqslant i \leqslant n-1$. The equality (1) implies $a_{i+1}=b_{i}$ and $b_{i}-a_{i}=b_{i+1}-a_{i+1}$. Thus,  $$ a_{1}, \quad b_{1}=a_{2}, \quad b_{2}=a_{3}, \quad \ldots, \quad b_{n-1}=a_{n}, \quad b_{n} $$  is an arithmetic progression with positive common difference. Since $a_{1} \geqslant 1$, we have $a_{i} \geqslant i$ for every $1 \leqslant i \leqslant n$, so  $$ D=\left(b_{1}-a_{1}\right) a_{2} a_{3} \cdots a_{n} \geqslant 1 \cdot 2 \cdot 3 \cdots n=n! $$  Equality is achieved when $b_{i}-a_{i}=1$ for $1 \leqslant i \leqslant n$ and $a_{1}=1$, i.e. $a_{i}=i$ and $b_{i}=i+1$ for every $1 \leqslant i \leqslant n$. Indeed, it is straightforward to check that these integers produce an arithmetic progression with common difference $n!$.  Solution 2 (Variant of Solution 1). Similarly to Solution 1, we may assume $\operatorname{gcd}\left(a_{i}, b_{i}\right)=1$ for every $1 \leqslant i \leqslant n$.  Denote by $p_{1}, p_{2}, \ldots, p_{n+1}$ the sequence obtained as the product in the problem statement. Then we have $\frac{p_{i+1}}{p_{i}}=\frac{b_{i}}{a_{i}}>1$, so $b_{i}>a_{i}$. Since $p_{1}, p_{2}, \ldots, p_{n+1}$ is an arithmetic progression, we have $p_{i+2}=2 p_{i+1}-p_{i}$ hence  $$ 2-\frac{a_{i}}{b_{i}}=\frac{2 b_{i}-a_{i}}{b_{i}}=\frac{2 p_{i+1}-p_{i}}{p_{i+1}}=\frac{p_{i+2}}{p_{i+1}}=\frac{b_{i+1}}{a_{i+1}} . $$  But since the fractions on the left-hand side and the right-hand side are both irreducible, we conclude that $b_{i}=a_{i+1}$, so $2-\frac{a_{i}}{a_{i+1}}=\frac{a_{i+2}}{a_{i+1}}$. Then we have $a_{i}+a_{i+2}=2 a_{i+1}$, which means that $a_{1}, a_{2}, \ldots, a_{n}$ is an arithmetic progression with positive common difference.  We conclude as in Solution 1.


Solution: (The following solution is purely algebraic: it does not involve considerations on greatest common divisors.)  We retake Solution 1 from (1). Then we have  $$ \frac{a_{i+1}}{b_{i+1}-a_{i+1}}=\frac{b_{i}}{b_{i}-a_{i}}=1+\frac{a_{i}}{b_{i}-a_{i}} . $$  So, for $1 \leqslant i \leqslant n$,  $$ \frac{a_{i}}{b_{i}-a_{i}}=\frac{a_{1}}{b_{1}-a_{1}}+(i-1) . $$  Then  $$ a_{i} \geqslant \frac{a_{i}}{b_{i}-a_{i}}=\frac{a_{1}}{b_{1}-a_{1}}+(i-1)>i-1 . $$  since $b_{i}-a_{i} \geqslant 1$ and $b_{1}-a_{1}>0$. As $a_{i}$ is an integer, we have $a_{i} \geqslant i$. We again conclude as in Solution 1.


Let $a, b, c, d$ be positive integers satisfying  $$ \frac{a b}{a+b}+\frac{c d}{c+d}=\frac{(a+b)(c+d)}{a+b+c+d} $$  Determine all possible values of $a+b+c+d$. (Netherlands) Answer: The possible values are the positive integers that are not square-free.

Solution: First, note that if we take $a=\ell, b=k \ell, c=k \ell, d=k^{2} \ell$ for some positive integers $k$ and $\ell$, then we have  $$ \frac{a b}{a+b}+\frac{c d}{c+d}=\frac{k \ell^{2}}{\ell+k \ell}+\frac{k^{3} \ell^{2}}{k \ell+k^{2} \ell}=\frac{k \ell}{k+1}+\frac{k^{2} \ell}{k+1}=k \ell $$  and  $$ \frac{(a+b)(c+d)}{a+b+c+d}=\frac{(\ell+k \ell)\left(k \ell+k^{2} \ell\right)}{\ell+k \ell+k \ell+k^{2} \ell}=\frac{k(k+1)^{2} \ell^{2}}{\ell(k+1)^{2}}=k \ell $$  so that  $$ \frac{a b}{a+b}+\frac{c d}{c+d}=k \ell=\frac{(a+b)(c+d)}{a+b+c+d} $$  This means that $a+b+c+d=\ell\left(1+2 k+k^{2}\right)=\ell(k+1)^{2}$ can be attained. We conclude that all non-square-free positive integers can be attained.  Now, we will show that if  $$ \frac{a b}{a+b}+\frac{c d}{c+d}=\frac{(a+b)(c+d)}{a+b+c+d} $$  then $a+b+c+d$ is not square-free. We argue by contradiction. Suppose that $a+b+c+d$ is square-free, and note that after multiplying by $(a+b)(c+d)(a+b+c+d)$, we obtain  $$ (a b(c+d)+c d(a+b))(a+b+c+d)=(a+b)^{2}(c+d)^{2} . $$  A prime factor of $a+b+c+d$ must divide $a+b$ or $c+d$, and therefore divides both $a+b$ and $c+d$. Because $a+b+c+d$ is square-free, the fact that every prime factor of $a+b+c+d$ divides $a+b$ implies that $a+b+c+d$ itself divides $a+b$. Because $a+b<a+b+c+d$, this is impossible. So $a+b+c+d$ cannot be square-free.  Comment 1. Another way to conclude after obtaining (1) is by observing that  $$ (a+b)^{2}(c+d)^{2} \equiv(a+b)^{4} \quad(\bmod a+b+c+d) $$  Hence $a+b+c+d \mid(a+b)^{4}$. But if $a+b+c+d$ is square-free, this forces $a+b+c+d \mid a+b$, which is clearly a contradiction.  Comment 2. It seems difficult to characterise all quadruples ( $a, b, c, d$ ) that satisfy the equality in the problem. Many of them, including those used in the solution, are of the general form $(a, b, c, d)=$ $\left(x y^{2}, x y z, x y z, x z^{2}\right)$ for some positive integers $x, y$, and $z$, but there are more solutions than that, such as $(a, b, c, d)=(2,7,8,10)$ or $(a, b, c, d)=(13,14,16,38)$.


Let $\mathbb{Z}_{>0}$ be the set of positive integers. Determine all functions $f: \mathbb{Z}_{>0} \rightarrow \mathbb{Z}_{>0}$ such that  $$ f^{b f(a)}(a+1)=(a+1) f(b) $$  holds for all $a, b \in \mathbb{Z}_{>0}$, where $f^{k}(n)=f(f(\cdots f(n) \cdots))$ denotes the composition of $f$ with itself $k$ times. (Taiwan) Answer: The only function satisfying the condition is $f(n)=n+1$ for all $n \in \mathbb{Z}_{>0}$. Let $P(a, b)$ be the equality in the statement.

Solution: We divide the solution into 5 steps. Step 1. ( $f$ is injective) Claim 1. For any $a \geqslant 2$, the set $\left\{f^{n}(a) \mid n \in \mathbb{Z}_{>0}\right\}$ is infinite. Proof. First, we have $f^{f(a)}(a+1) \stackrel{P(a, 1)}{=}(a+1) f(1)$. Varying $a$, we see that $f\left(\mathbb{Z}_{>0}\right)$ is infinite. Next, we have $f^{b f(a-1)}(a) \stackrel{P(a-1, b)}{=} a f(b)$. So, varying $b, f^{b f(a-1)}(a)$ takes infinitely many values. Claim 2. For any $a \geqslant 2$ and $n \in \mathbb{Z}_{>0}$, we have $f^{n}(a) \neq a$. Proof. Otherwise we would get a contradiction with Claim 1. Assume $f(b)=f(c)$ for some $b<c$. Then we have  $$ \begin{aligned} (a+1) f(c) & \stackrel{P(a, c)}{=} f^{c f(a)}(a+1) \\ & =f^{(c-b) f(a)}\left(f^{b f(a)}(a+1)\right) \\ & \stackrel{P(a, b)}{=} f^{(c-b) f(a)}((a+1) f(b)) \\ & =f^{(c-b) f(a)}((a+1) f(c)), \end{aligned} $$  which contradicts Claim 2. So, $f$ is injective. Step 2. $\left(f\left(\mathbb{Z}_{>0}\right)=\mathbb{Z}_{\geqslant 2}\right)$ Claim 3. 1 is not in the range of $f$. Proof. If $f(b)=1$, then $f^{f(a)}(a+1)=a+1$ by $P(a, 1)$, which contradicts Claim 2. We say that $a$ is a descendant of $b$ if $f^{n}(b)=a$ for some $n \in \mathbb{Z}_{>0}$. Claim 4. For any $a, b \geqslant 1$, both of the following cannot happen at the same time:  - $a$ is a descendant of $b$; - $b$ is a descendant of $a$.  Proof. If both of the above hold, then $a=f^{m}(b)$ and $b=f^{n}(a)$ for some $m, n \in \mathbb{Z}_{>0}$. Then $a=f^{m+n}(a)$, which contradicts Claim 2. Claim 5. For any $a, b \geqslant 2$, exactly one of the following holds:  - $a$ is a descendant of $b$; - $b$ is a descendant of $a$; - $a=b$.  Proof. For any $c \geqslant 2$, taking $m=f^{c f(a-1)-1}(a)$ and $n=f^{c f(b-1)-1}(b)$, we have  $$ f(m)=f^{c f(a-1)}(a) \stackrel{P(a-1, c)}{=} a f(c) \text { and } f(n)=f^{c f(b-1)}(b) \stackrel{P(b-1, c)}{=} b f(c) . $$  Hence  $$ f^{n f(a-1)}(a) \stackrel{P(a-1, n)}{=} a f(n)=a b f(c)=b f(m) \stackrel{P(a-1, m)}{=} f^{m f(b-1)}(b) . $$  The assertion then follows from the injectivity of $f$ and Claim 2. Now, we show that any $a \geqslant 2$ is in the range of $f$. Let $b=f(1)$. If $a=b$, then $a$ is in the range of $f$. If $a \neq b$, either $a$ is a descendant of $b$, or $b$ is a descendant of $a$ by Claim 5. If $b$ is a descendant of $a$, then $b=f^{n}(a)$ for some $n \in \mathbb{Z}_{>0}$, so $1=f^{n-1}(a)$. Then, by Claim 3, we have $n=1$, so $1=a$, which is absurd. So, $a$ is a descendant of $b$. In particular, $a$ is in the range of $f$. Thus, $f\left(\mathbb{Z}_{>0}\right)=\mathbb{Z}_{\geqslant 2}$.  Step 3. $(f(1)=2)$ Claim 6. Let $a, n \geqslant 2$, then $n a$ is a descendant of $a$. Proof. We write $n=f(m)$ by Step 2. We have $n a=f(m) a \stackrel{P(a-1, m)}{=} f^{m f(a-1)}(a)$, which shows $n a$ is a descendant of $a$.  By Claim 6, all even integers $\geqslant 4$ are descendants of 2 . Hence $2=f(2 k+1)$ for some $k \geqslant 0$. Next, we show $f(2 k+1) \geqslant f(1)$, which implies $f(1)=2$. It trivially holds if $k=0$. If $k \geqslant 1$, let $n$ be the integer such that $f^{n}(2)=2 k+2$. For any $b>n / f(1)$, we have  $$ f^{b f(1)-n}(2 k+2)=f^{b f(1)}(2) \stackrel{P(1, b)}{=} 2 f(b) \text { and } f^{b f(2 k+1)}(2 k+2) \stackrel{P(2 k+1, b)}{=}(2 k+2) f(b) . $$  By Claim 6, $(2 k+2) f(b)$ is a descendant of $2 f(b)$. By Claim 2, we have $b f(2 k+1)>b f(1)-n$. By taking $b$ large enough, we conclude $f(2 k+1) \geqslant f(1)$.  Step 4. $(f(2)=3$ and $f(3)=4)$ From $f(1)=2$ and $P(1, b)$, we have $f^{2 b}(2)=2 f(b)$. So taking $b=1$, we obtain $f^{2}(2)=2 f(1)=4$; and taking $b=f(2)$, we have $f^{2 f(2)}(2)=2 f^{2}(2)=8$. Hence, $f^{2 f(2)-2}(4)=f^{2 f(2)}(2)=8$ and $f^{f(3)}(4) \stackrel{P(3,1)}{=} 8$ give $f(3)=2 f(2)-2$.  Claim 7. For any $m, n \in \mathbb{Z}_{>0}$, if $f(m)$ divides $f(n)$, then $m \leqslant n$. Proof. If $f(m)=f(n)$, the assertion follows from the injectivity of $f$. If $f(m)<f(n)$, by $P(a, m), P(a, n)$ and Claim 6, we have that $f^{n f(a)}(a+1)$ is a descendant of $f^{m f(a)}(a+1)$ for any $a \in \mathbb{Z}_{>0}$. So $m f(a)<n f(a)$, and $m<n$.  By Claim 7, every possible divisor of $f(2)$ is in $\{1, f(1)=2, f(2)\}$. Thus $f(2)$ is an odd prime or $f(2)=4$. Since $f^{2}(2)=4$, we have $f(2) \neq 4$, and hence $f(2)$ is an odd prime. We set $p=f(2)$.  Now, $f(3)=2 f(2)-2=2(p-1)$. Since $p-1$ divides $f(3)$, we have $p-1 \in\{1, f(1)=$ $2, f(2)=p\}$ by Claim 7, so $p-1=2$. Thus, $f(2)=p=3$ and $f(3)=2(p-1)=4$.  Step 5. $(f(n)=n+1)$ Claim 8. For any $b \geqslant 1, f(2 f(b)-1)=2 b+2$. Proof. Since $f^{2}(2)=4$, we have $f^{2 b-2}(4)=f^{2 b}(2)=2 f(b)$, so  $$ f^{f(2 f(b)-1)+2 b-2}(4)=f^{f(2 f(b)-1)}(2 f(b))^{P(2 f(b)-1,1)} 4 f(b) \stackrel{P(3, b)}{=} f^{4 b}(4), $$  which gives us $f(2 f(b)-1)=2 b+2$.  Finally, we prove $f(n)=n+1$ by induction on $n$. Suppose $f(n)=n+1$ for all $1 \leqslant n \leqslant 2 b+1$. Replace $b$ by $b+1$ in $f(2 f(b)-1)=2 b+2$ to get  $$ f(2 b+3)=f(2 f(b+1)-1)=2(b+1)+2=2 b+4 $$  By induction hypothesis, we have $f^{b}(b+2)=2 b+2$. Hence  $$ f(f(2 b+2))=f^{b+2}(b+2)=f^{f(b+1)}(b+2) \stackrel{P(b+1,1)}{=} 2(b+2)=f(2 b+3) . $$  By injectivity, $f(2 b+2)=2 b+3$. Then $f(n)=n+1$ for all $n \in \mathbb{Z}_{>0}$, which is indeed a solution.


Solution: In the same way as Steps 1-2 of   We first note that Claim 2 in Solution 1 is also true for $a=1$. Claim 2'. For any $a, n \in \mathbb{Z}_{>0}$, we have $f^{n}(a) \neq a$. Proof. If $a \geqslant 2$, the assertion was proved in Claim 2 in Solution 1. If $a=1$, we have that 1 is not in the range of $f$ by Claim 3 in Solution 1 . So, $f^{n}(1) \neq 1$ for every $n \in \mathbb{Z}_{>0}$.  For any $a, b \in \mathbb{Z}_{>0}$, we have  $$ f^{b f(f(a)-1)+1}(a)=f^{b f(f(a)-1)}(f(a)) \stackrel{P(f(a)-1, b)}{=} f(a) f(b) $$  Since the right-hand side is symmetric in $a, b$, we have  $$ f^{b f(f(a)-1)+1}(a)=f(a) f(b)=f^{a f(f(b)-1)+1}(b) $$  Since $f$ is injective, we have $f^{b f(f(a)-1)}(a)=f^{a f(f(b)-1)}(b)$. We set $g(n)=f(f(n)-1)$. Then we have $f^{b g(a)}(a)=f^{a g(b)}(b)$ for any $a, b \in \mathbb{Z}_{>0}$. We set $n_{a, b}=b g(a)-a g(b)$. Then, for sufficiently large $n$, we have $f^{n+n_{a, b}}(a)=f^{n}(b)$. For any $a, b, c \in \mathbb{Z}_{>0}$ and sufficiently large $n$, we have  $$ f^{n+n_{a, b}+n_{b, c}+n_{c, a}}(a)=f^{n}(a) . $$  By Claim 2' above, we have $n_{a, b}+n_{b, c}+n_{c, a}=0$, so  $$ (a-b) g(c)+(b-c) g(a)+(c-a) g(b)=0 . $$  Taking $(a, b, c)=(n, n+1, n+2)$, we have $g(n+1)-g(n)=g(n+2)-g(n+1)$. So, $\{g(n)\}_{n \geqslant 1}$ is an arithmetic progression.  There exist $C, D \in \mathbb{Z}$ such that $g(n)=f(f(n)-1)=C n+D$ for all $n \in \mathbb{Z}_{>0}$. By Step 2 of Solution 1, we have $f\left(\mathbb{Z}_{>0}\right)=\mathbb{Z}_{\geqslant 2}$, so $C=1$. Since $2=\min _{n \in \mathbb{Z}_{>0}}\{f(f(n)-1)\}$, we have $D=1$.  Thus, $g(n)=f(f(n)-1)=n+1$ for all $n \geqslant 1$. For any $a, b \in \mathbb{Z}_{>0}$, we have $f^{b(a+1)}(a)=$ $f^{a(b+1)}(b)$. By the injectivity of $f$, we have $f^{b}(a)=f^{a}(b)$. For any $n \in \mathbb{Z}_{>0}$, taking $(a, b)=(1, n)$, we have $f^{n}(1)=f(n)$, so $f^{n-1}(1)=n$ again by the injectivity of $f$. For any $n \geqslant 1$, we have $f(n)=f\left(f^{n-1}(1)\right)=f^{n}(1)=n+1$.


Solution: The following is another way of finishing   $$ \begin{aligned} f^{b g(a)}(f(a)) & =f^{b f(f(a)-1)}(f(a)) \stackrel{P(f(a)-1, b)}{=} f(a) f(b) \stackrel{P(f(b)-1, a)}{=} f^{a f(f(b)-1)}(f(b)) \\ & =f^{a g(b)+k}(f(a)) \end{aligned} $$  By Claim 2' in Solution 2, we have $b g(a)=a g(b)+k$, so $f^{k}(a) \cdot g(a)=a \cdot g\left(f^{k}(a)\right)+k$. Therefore, for any $n \geqslant 0$, we put $a_{n}=f^{n}(1)$. We have  $$ \left\{\begin{array}{l} a_{n+1} \cdot g\left(a_{n}\right)=a_{n} \cdot g\left(a_{n+1}\right)+1 \\ a_{n+2} \cdot g\left(a_{n+1}\right)=a_{n+1} \cdot g\left(a_{n+2}\right)+1 \\ a_{n+2} \cdot g\left(a_{n}\right)=a_{n} \cdot g\left(a_{n+2}\right)+2 \end{array}\right. $$  Then we have  $$ \begin{aligned} a_{n} \cdot a_{n+1} \cdot g\left(a_{n+2}\right)+2 a_{n+1} & =a_{n+1} \cdot a_{n+2} \cdot g\left(a_{n}\right) \\ & =a_{n+2}\left(a_{n} \cdot g\left(a_{n+1}\right)+1\right) \\ & =a_{n} \cdot a_{n+2} \cdot g\left(a_{n+1}\right)+a_{n+2} \\ & =a_{n}\left(a_{n+1} \cdot g\left(a_{n+2}\right)+1\right)+a_{n+2} \\ & =a_{n} \cdot a_{n+1} \cdot g\left(a_{n+2}\right)+a_{n}+a_{n+2} . \end{aligned} $$  From these, we have $2 a_{n+1}=a_{n}+a_{n+2}$. Thus $\left(a_{n}\right)$ is an arithmetic progression, and we have $a_{n}=f^{n}(1)=C n+D$ for some $C, D \in \mathbb{Z}$.  By Step 2 in Solution 1, any $a \in \mathbb{Z}_{>0}$ is a descendant of 1 , and $f\left(\mathbb{Z}_{>0}\right)=\mathbb{Z}_{\geqslant 2}$. Hence $D=1$ and $C=1$, and so $f^{n}(1)=n+1$. For any $n \geqslant 1$, we have $f^{n-1}(1)=n$, so $f(n)=f\left(f^{n-1}(1)\right)=$ $f^{n}(1)=n+1$.