In each square of a garden shaped like a $2022 \times 2022$ board, there is initially a tree of height 0 . A gardener and a lumberjack alternate turns playing the following game, with the gardener taking the first turn:  - The gardener chooses a square in the garden. Each tree on that square and all the surrounding squares (of which there are at most eight) then becomes one unit taller. - The lumberjack then chooses four different squares on the board. Each tree of positive height on those squares then becomes one unit shorter.  We say that a tree is majestic if its height is at least $10^{6}$. Determine the largest number $K$ such that the gardener can ensure there are eventually $K$ majestic trees on the board, no matter how the lumberjack plays. (Colombia) Answer: $K=5 \cdot \frac{2022^{2}}{9}=2271380$. In general, for a $3 N \times 3 N$ board, $K=5 N^{2}$.

Solution: We solve the problem for a general $3 N \times 3 N$ board. First, we prove that the lumberjack has a strategy to ensure there are never more than $5 N^{2}$ majestic trees. Giving the squares of the board coordinates in the natural manner, colour each square where at least one of its coordinates are divisible by 3 , shown below for a $9 \times 9$ board: ![](https://cdn.mathpix.com/cropped/2024_11_18_86efb4389f14b52b08e1g-28.jpg?height=900&width=914&top_left_y=1343&top_left_x=571)  Then, as each $3 \times 3$ square on the board contains exactly 5 coloured squares, each move of the gardener will cause at most 4 trees on non-coloured squares to grow. The lumberjack may therefore cut those trees, ensuring no tree on a non-coloured square has positive height after his turn. Hence there cannot ever be more majestic trees than coloured squares, which is $5 N^{2}$.  Next, we prove the gardener may ensure there are $5 N^{2}$ majestic trees. In fact, we prove this statement in a modified game which is more difficult for the gardener: on the lumberjack's turn in the modified game, he may decrement the height of all trees on the board except those the gardener did not just grow, in addition to four of the trees the gardener just grew. Clearly, a sequence of moves for the gardener which ensures that there are $K$ majestic trees in the modified game also ensures this in the original game.  Let $M=\binom{9}{5}$; we say that a map is one of the $M$ possible ways to mark 5 squares on a $3 \times 3$ board. In the modified game, after the gardener chooses a $3 \times 3$ subboard on the board, the lumberjack chooses a map in this subboard, and the total result of the two moves is that each tree marked on the map increases its height by 1 , each tree in the subboard which is not in the map remains unchanged, and each tree outside the subboard decreases its height by 1. Also note that if the gardener chooses a $3 \times 3$ subboard $M l$ times, the lumberjack will have to choose some map at least $l$ times, so there will be at least 5 trees which each have height $\geqslant l$.  The strategy for the gardener will be to divide the board into $N^{2}$ disjoint $3 \times 3$ subboards, number them $0, \ldots, N^{2}-1$ in some order. Then, for $b=N^{2}-1, \ldots, 0$ in order, he plays $10^{6} M(M+1)^{b}$ times on subboard number $b$. Hence, on subboard number $b$, the moves on that subboard will first ensure 5 of its trees grows by at least $10^{6}(M+1)^{b}$, and then each move after that will decrease their heights by 1 . (As the trees on subboard $b$ had height 0 before the gardener started playing there, no move made on subboards $\geqslant b$ decreased their heights.) As the gardener makes $10^{6} M(M+1)^{b-1}+\ldots=10^{6}\left((M+1)^{b}-1\right)$ moves after he finishes playing on subboard $b$, this means that on subboard $b$, there will be 5 trees of height at least $10^{6}(M+1)^{b}-10^{6}\left((M+1)^{b}-1\right)=10^{6}$, hence each of the subboard has 5 majestic trees, which was what we wanted.


Let $n>3$ be a positive integer. Suppose that $n$ children are arranged in a circle, and $n$ coins are distributed between them (some children may have no coins). At every step, a child with at least 2 coins may give 1 coin to each of their immediate neighbours on the right and left. Determine all initial distributions of coins from which it is possible that, after a finite number of steps, each child has exactly one coin. (Israel) Answer: All distributions where $\sum_{i=1}^{n} i c_{i}=\frac{n(n+1)}{2}(\bmod n)$, where $c_{i}$ denotes the number of coins the $i$-th child starts with.

Solution: Number the children $1, \ldots, n$, and denote the number of coins the $i$-th child has by $c_{i}$. A step of this process consists of reducing some $c_{i}$ by 2 , and increasing $c_{i-1}, c_{i+1}$ by 1 . (Indices are considered $(\bmod n)$.) Because $(i-1)-2 i+(i+1)=0$, the quantity $\sum_{i=1}^{n} i c_{i}(\bmod n)$ will be invariant under this process. Hence a necessary condition for the children to end up with an uniform distribution of coins is that  $$ \sum_{i=1}^{n} i c_{i}=\frac{n(n+1)}{2} \quad(\bmod n) $$  We will show that this condition is also sufficient. Consider an arbitrary initial distribution of coins. First, whenever child $i$ has more than one coin and $i \neq n$, have child $i$ pass coins to its neighbors. (Child $i$ does nothing.) Then, after some amount of such steps, it must eventually become impossible to do any more steps because no child except perhaps child $i$ has more than 1 coin. (To see this, consider e.g. the quantity $\sum_{i=1}^{n-1} i^{2} c_{i}$, which (as $(i-1)^{2}+(i+1)^{2}>2 i^{2}$ ) increases at each step.)  Hence we can reach a state of the form $\left(z_{1}, \ldots, z_{n-1}, M\right)$, where $z_{i}=0$ or 1 . Call such states semi-uniform states of irregularity $M$. Lemma. If there is a string of children having coins $a, \overbrace{1, \ldots, 1}^{k \text { ones }}, b, \overbrace{1, \ldots, 1}^{k \text { ones }}, c$, with $b \geqslant 2$, after some sequence of steps we may reach the state $a+1, \overbrace{1, \ldots, 1}^{k \text { ones }}, b-2, \overbrace{1, \ldots, 1}^{k \text { ones }}, c+1$. We call performing this sequence of steps long-passing coins. Proof. This is simply repeated application of the operation. We prove the lemma by induction on $k$. For $k=0$, this is just the operation of the problem. If $k=1$, have the child with $b$ coins pass coins, then both of their neighbors pass coins, then the child with $b$ coins pass coins again. For $k \geqslant 2$, first, have the child with $b$ coins pass coins, then have both their neigbors send coins, giving the state  $$ a, \overbrace{1, \ldots, 1}^{k-2 \text { ones }}, 2,0, b, 0,2, \overbrace{1, \ldots, 1}^{k-2 \text { ones }}, c . $$  Now set aside the children with $a, b$ and $c$ coins, and have each child with 2 coins give them to their neighbors until there are no such children remaining. This results in the state  $$ a+1,0, \overbrace{1, \ldots, 1}^{k-2}, b, \overbrace{1, \ldots, 1}^{k-2 \text { ones }}, 0, c+1 $$  By the induction hypothesis, we can have the child with $b$ coins may pass a coin to each of the children with 0 coins, proving the lemma.  Claim. We can reach a semi-uniform state of irregularity $M \leqslant 2$. Proof. If $M>3$, because there are only $n$ coins in total, there must be at least two children with 0 coins. Consider the arc of the circle spanned by the two such children closest to the child with $M$ coins. It has the form  $$ 0, \overbrace{1, \ldots, 1}^{a \text { ones }}, M, \overbrace{1, \ldots, 1}^{b \text { ones }}, 0 $$  If $a=b$, applying the previous lemma we can have the child with $M$ coins long-pass a coin to each of the children with 0 coins, which yields a semi-uniform state with lower $M$. Otherwise, WLOG $a>b$, so we can have the child with $M$ coins long-pass a coin to each of the children at distance $b$ from it, reaching a state of the form $(\alpha:=a-b-1, \beta:=b)$  $$ 0, \overbrace{1, \ldots, 1}^{\alpha \text { ones }}, 2, \overbrace{1, \ldots, 1}^{\beta \text { ones }}, M-2, \overbrace{1, \ldots, 1}^{c \text { ones }} $$  The children in the rightmost string of ones need make no further moves, so consider only the leftmost string. If $\alpha<\beta$, have the child with 2 coins long-pass coins to the child with 0 coins to its left and some child with 1 coin to its right, reaching a new state of the form $0, \overbrace{1, \ldots, 1}^{\alpha \text { ones }}, 2, \overbrace{1, \ldots, 1}^{\beta \text { ones }}, M-2$ with a smaller $\beta$. As $\beta$ cannot decrease indefinitely, eventually $\alpha \geqslant \beta$. If $\alpha=\beta$, have the child with 2 coins long-pass to the child with $M$ coins and the child with 0 coins, reaching a semi-uniform state of irregularity $M-1$ as desired. Otherwise, $\alpha<\beta$, so have the child with 2 coins long-pass to the child with $M$ coins and a child with 1 coin, reaching a state of the form  $$ 0, \overbrace{1, \ldots, 1}^{x \text { ones }}, 2, \overbrace{1, \ldots, 1}^{y \text { ones }}, 0, \overbrace{1, \ldots, 1}^{z \text { ones }}, M-1 $$  Now, consider only the substring between the two children with 0 coins, which has the form $0, \overbrace{1, \ldots, 1}^{x \text { ones }}, 2, \overbrace{1, \ldots, 1}^{y \text { ones }}, 0$. Repeatedly have the child in this substring with 2 coins long-pass to the closest child with 0 coins and some other child. If the other child has 1 coin, we have a new strictly shorter substring of the form $0, \overbrace{1, \ldots, 1}^{x \text { ones }}, 2, \overbrace{1, \ldots, 1}^{y \text { ones }}, 0$. Hence eventually it must happen that the other child also has 0 coins, at which point we reach a semi-uniform state of irregularity $M-1$, proving the claim.  We have now shown that we can reach a semi-regular state of irregularity $M \leqslant 2$, If $M=1$, each child must have one coin, as desired. Otherwise, we must have $M=2$, so there is one child with 0 coins, one child with 2 coins, and the remaining children all have 1 coin. Recall that the state we started with satisfied the invariant  $$ \sum_{i=1}^{n} i c_{i}=\frac{n(n+1)}{2} \quad(\bmod n) $$  Because each step preserves this invariant, this must also be true of the current state. Number the children so that the child with $M$ coins is child number $n$, and suppose the child with 0 coins is child $k$. Then $\frac{n(n+1)}{2}=\sum_{i=1}^{n} i c_{i}=\left(\sum_{i=1}^{n} 1 \cdot c_{i}\right)-k=\frac{n(n+1)}{2}-k(\bmod n)$, so $k=0$ $(\bmod n)$. But this is impossible, as no child except the child with $M$ coins has an index divisible by $n$. Hence we cannot end up in a semi-regular state of irregularity 2 , so we are done.


Solution: Encode the sequence $c_{i}$ as a polynomial $p(x)=\sum_{i} a_{i} x_{i}$. The cyclic nature of the problem makes it natural to work modulo $x^{n}-1$. Child $i$ performing a step is equivalent to adding $x^{i}(x-1)^{2}$ to the polynomial, and we want to reach the polynomial $q(x)=1+x+\ldots+$ $x^{n-1}$. Since we only add multiples of $(x-1)^{2}$, this is only possible if $p(x)=q(x)$ modulo the ideal generated by $x^{n}-1$ and $(x-1)^{2}$, i.e.  $$ \left(x^{n}-1,(x-1)^{2}\right)=(x-1)\left(\frac{x^{n}-1}{x-1}, x-1\right)=(x-1) \cdot(n,(x-1)) $$  This is equivalent to $p(1)=q(1)$ (which simply translates to the condition that there are $n$ coins) and $p^{\prime}(1)=q^{\prime}(1)(\bmod n)$, which translates to the invariant described in solution 1.


Let $n$ be a positive integer. We start with $n$ piles of pebbles, each initially containing a single pebble. One can perform moves of the following form: choose two piles, take an equal number of pebbles from each pile and form a new pile out of these pebbles. For each positive integer $n$, find the smallest number of non-empty piles that one can obtain by performing a finite sequence of moves of this form. (Croatia) Answer: 1 if $n$ is a power of two, and 2 otherwise.

Solution: The solution we describe is simple, but not the most effective one. We can combine two piles of $2^{k-1}$ pebbles to make one pile of $2^{k}$ pebbles. In particular, given $2^{k}$ piles of one pebble, we may combine them as follows:  $$ \begin{array}{lcc} 2^{k} \text { piles of } 1 \text { pebble } & \rightarrow & 2^{k-1} \text { piles of } 2 \text { pebbles } \\ 2^{k-1} \text { piles of } 2 \text { pebbles } & \rightarrow & 2^{k-2} \text { piles of } 4 \text { pebbles } \\ 2^{k-2} \text { piles of } 4 \text { pebbles } & \rightarrow & 2^{k-3} \text { piles of } 8 \text { pebbles } \\ & \vdots \\ 2 \text { piles of } 2^{k-1} \text { pebbles } & \rightarrow 1 \text { pile of } 2^{k} \text { pebbles } \end{array} $$  This proves the desired result in the case when $n$ is a power of 2 . If $n$ is not a power of 2 , choose $N$ such that $2^{N}<n<2^{N+1}$. Let $m=n-2^{N}$. Then $0<m<2^{N}$. Make a pile of $2^{N}$ pebbles and call it the large pile. (Alternatively, one can be more efficient and make a pile of $2^{M}$ pebbles where $m \leqslant 2^{M}$.) Since $n$ is not a power of two, there is at least one other pile with pebbles. All other piles have a single pebble (initial condition).  Choose one single pebble pile and remove the pebble and one pebble from the large pile and form a pile of 2 pebbles. If $m<2^{N}-1$, remove another pebble from the large pile and one pebble from the 2 -pile and form a new pile of 2 pebbles. Repeat until the large pile contains exactly $m$ pebbles.  At this point we have one pile of $m$ pebbles, one pile of 2 pebbles, and the rest are single pebble piles. There must be $n-m-2=2^{N}-2$ single piles. Combine two and two into piles of two pebbles. Then there are $2^{N-1}$ piles of two pebbles, which we can make into one pile of $2^{N}$ pebbles. We are left with exactly two piles of pebbles.  Lastly we will prove that it is not possible to form a single pile with all pebbles when $n$ is not a power of two. A move consists of choosing two piles of say $a$ and $b$ pebbles, then removing $c \leqslant \min (a, b)$ pebbles from both piles, and forming a new pile with $2 c$ pebbles. If we include piles of zero pebbles, then this move changes the number of pebbles in three piles as follows (and leaves all other piles unchanged):  $$ \begin{aligned} & a \rightarrow a-c \\ & b \rightarrow \\ & 0-c \\ & 0 \rightarrow \end{aligned} $$  Assume that after the move the number of pebbles in each pile is divisible by an odd integer $m$. In particular, $m|2 c, m| a-c$ and $m \mid b-c$. Since $m$ is odd, it follows that $m \mid c$, and then that $m \mid a$ and $m \mid b$. Hence also before the move the number of pebbles in each pile is divisible by the integer $m$.  If $n$ is not a power of 2 , then $n$ is divisible by an odd integer $m>1$. In order to make a single pile of $n$ pebbles, we would have to start with a distribution in which the number of pebbles in each pile is divisible by the integer $m$. This is impossible when we start with all piles containing a single pebble.  Remarks on starting configurations From any starting configuration that is not a single pile, if there are at least two piles with at least two pebbles, we can remove one pebble from two such piles, and form a new pile with 2 pebbles. We can repeat this until we have one pile of 2 pebbles and the rest are single pebble piles, and then proceed as in the solution. Hence, if $n$ is a power of two, we can make a single pile from any starting configuration.  If $n$ is of the form $n=2^{k} m$ where $m>1$ is odd, then we can make a single pile from any starting configuration in which the number of pebbles in each pile is divisible by the integer $m$, otherwise two piles is the best we can do. Half of this is proven already. For the other half, assume we start with a configuration in which the number of pebbles in each pile is divisible by the integer $m$. Replace each pile of $t m$ pebbles with a pile of $t$ boulders. We now have a total of $2^{k}$ boulders, hence we can make them into one pile of $2^{k}$ boulders. Replacing the boulders with pebbles again, we are done.


Solution: We show an alternative strategy if $n$ is not a power of 2 . Write $n$ in binary form: $n=2^{i_{1}}+2^{i_{2}}+\cdots+2^{i_{k}}$, where $i_{1}>i_{2}>\cdots>i_{k}$. Now we make piles of sizes $2^{i_{1}}, 2^{i_{2}}, \ldots, 2^{i_{k}}$. We call the pile with $2^{i_{1}}$ the large pile, all the others are the small piles.  The strategy is the following: take the two smallest small pile. If they have the same size of $2^{a}$, we make a pile of size $2^{a+1}$. If they have different sizes, we double the smaller pile using the large pile (we allow the large pile to have a negative number of pebbles: later we prove that it is not possible). We call all the new piles small. When we have only one small pile, we terminate the process: we have at most 2 piles.  After each move we have one less number of piles, and all the piles have cardinality power of 2. The number of pebbles is decreasing, and at the end of the process, it has a size of $n-2^{i_{2}+1} \geqslant n-2^{i_{1}}>0$, thus we can manage to have two piles.


Solution: Throughout the solution, we will consider the moves in reverse order. Namely, imagine we have some piles of pebbles, and we are allowed to perform moves as follows: take a pile with an even number of pebbles, split it into two equal halves and add the pebbles from each half to a different pile, possibly forming new piles (we may assume for convenience that there are infinitely many empty piles at any given moment). Given a configuration of piles $\mathcal{C}$, we will use $|\mathcal{C}|$ to denote the number of non-empty piles in $\mathcal{C}$. Given two configurations $\mathcal{C}_{1}, \mathcal{C}_{2}$, we will say that $\mathcal{C}_{2}$ is reachable from $\mathcal{C}_{1}$ if $\mathcal{C}_{2}$ can be obtained by performing a finite sequence of moves starting from $\mathcal{C}_{1}$. Call a configuration of piles $\mathcal{C}$  - simple if each (non-empty) pile in $\mathcal{C}$ consists of a single pebble; - good if at least one (non-empty) pile in $\mathcal{C}$ has an even number of pebbles and the numbers of pebbles on the piles in $\mathcal{C}$ have no non-trivial odd common divisor ( $\mathcal{C}$ has the odd divisor property); - solvable if there exists a simple configuration which is reachable from $\mathcal{C}$.  The problem asks to find the smallest number of non-empty piles in a solvable configuration consisting of $n$ pebbles. We begin the process of answering this question by making the following observation: Lemma 1. Let $\mathcal{C}$ be a configuration of piles. Let $\mathcal{C}^{\prime}$ be a configuration obtained by applying a single move to $\mathcal{C}$. Then (i) if $\mathcal{C}^{\prime}$ has the odd divisor property, then so does $\mathcal{C}$; (ii) the converse to (i) holds if $\left|\mathcal{C}^{\prime}\right| \geqslant|\mathcal{C}|$.  Proof. Suppose that the move consists of splitting a pile of size $2 a$ and adding $a$ pebbles to each of two piles of sizes $b$ and $c$. Here, $a$ is a positive integer and $b, c$ are non-negative integers. Thus, $\mathcal{C}^{\prime}$ can be obtained from $\mathcal{C}$ by replacing the piles of sizes $2 a, b, c$ by two piles of sizes $a+b$ and $a+c$. Note that the extra assumption $\left|\mathcal{C}^{\prime}\right| \geqslant|\mathcal{C}|$ of part (ii) holds if and only if at least one of $b, c$ is zero. (i) Suppose $\mathcal{C}$ doesn't have the odd divisor property, i.e. there exists an odd integer $d>1$ such that the size of each pile in $\mathcal{C}$ is divisible by $d$. In particular, $2 a, b, c$ are multiples of $d$, so since $d$ is odd, it follows that $a, b, c$ are all divisible by $d$. Thus, $a+b$ and $a+c$ are also divisible by $d$, so $d$ divides the size of each pile in $\mathcal{C}^{\prime}$. In conclusion, $\mathcal{C}^{\prime}$ doesn't have the odd divisor property. (ii) If $\mathcal{C}^{\prime}$ doesn't have the odd divisor property and at least one of $b, c$ is zero, then there exists an odd integer $d>1$ such that the size of each pile in $\mathcal{C}^{\prime}$ is divisible by $d$. In particular, $d$ divides $a+b$ and $a+c$, so since at least one of these numbers is equal to $a$, it follows that $d$ divides $a$. But then $d$ must divide all three of $a, b$ and $c$, and hence it certainly divides $2 a, b$ and $c$. Thus, $\mathcal{C}$ doesn't have the odd divisor property, as desired. Lemma 2. If $\mathcal{C}_{2}$ is reachable from $\mathcal{C}_{1}$ and $\mathcal{C}_{2}$ has the odd divisor property, then so does $\mathcal{C}_{1}$. In particular, any solvable configuration has the odd divisor property. Proof. The first statement follows by inductively applying part (i) of Lemma 1. The second statement follows from the first because every simple configuration has the odd divisor property.  The main claim is the following: Lemma 3. Let $\mathcal{C}$ be a good configuration. Then there exists a configuration $\mathcal{C}^{\prime}$ with the following properties:  - $\mathcal{C}^{\prime}$ is reachable from $\mathcal{C}$ and $\left|\mathcal{C}^{\prime}\right|>|\mathcal{C}|$; - $\mathcal{C}^{\prime}$ is either simple or good.  Proof. Call a configuration terminal if it is a counterexample to the claim. The following claim is at the heart of the proof: Claim. Let $a_{1}, \ldots, a_{k}$ be the numbers of pebbles on the non-empty piles of a terminal configuration $\mathcal{C}$. Then there exists a unique $i \in[k]$ such that $a_{i}$ is even. Moreover, for all $t \geqslant 1$ we have $a_{j} \equiv \frac{a_{i}}{2}\left(\bmod 2^{t}\right)$ for all $j \neq i$. Proof of Claim. Since the configuration is good, there must exist $i \in[k]$ such that $a_{i}$ is even. Moreover, by assumption, if we split the pile with $a_{i}$ pebbles into two equal halves, the resulting configuration will not be good. By part (ii) of Lemma 2,the only way this can happen is that $\frac{a_{i}}{2}$ and $a_{j}$ for all $j \neq i$ are odd. To prove the second assertion, we proceed by induction on $t$, with the case $t=1$ already being established. If $t \geqslant 2$, then split the pile with $a_{i}$ pebbles into two equal halves and move one half to the pile with $a_{j}$ pebbles. Since $\frac{a_{i}}{2}$ and $a_{j}$ are both odd, $a_{j}+\frac{a_{i}}{2}$ is even, so by part (ii) of Lemma 2 , the resulting configuration $\mathcal{C}^{\prime}$ is good. Thus, $\mathcal{C}^{\prime}$ is terminal, so by the induction hypothesis, we have $\frac{a_{i}}{2} \equiv \frac{1}{2}\left(a_{j}+\frac{a_{i}}{2}\right)\left(\bmod 2^{t-1}\right)$, whence $a_{j} \equiv \frac{a_{i}}{2}($ $\bmod 2^{t}$ ), as desired.  Suppose for contradiction that there exists a configuration as in the Claim. It follows that there exists $i \in[k]$ and an odd integer $x$ such that $a_{i}=2 x$ and $a_{j}=x$ for all $j \neq i$. Thus, $x$ is an odd common divisor of $a_{1}, \ldots, a_{k}$, so by the odd divisor property, we must have $x=1$. But then we can obtain a simple configuration by splitting the only pile with two pebbles into two piles each consisting of a single pebble, which is a contradiction.  With the aid of Lemmas 2 and 3, it is not hard to characterise all solvable configurations: Lemma 4. A configuration of piles $\mathcal{C}$ is solvable if and only if it is simple or good.  Proof. $(\Longrightarrow)$ Suppose $\mathcal{C}$ is not simple. Then since we have to be able to perform at least one move, there must be at least one non-empty pile in $\mathcal{C}$ with an even number of pebbles. Moreover, by Lemma $2, \mathcal{C}$ has the odd divisor property, so it must be good. $(\Longleftarrow)$ This follows by repeatedly applying Lemma 3 until we reach a simple configuration. Note that the process must stop eventually since the number of non-empty piles is bounded from above.  Finally, the answer to the problem is implied by the following corollary of Lemma 4: Lemma 5. Let $n$ be a positive integer. Then (i) a configuration consisting of a single pile of $n$ pebbles is solvable if and only if $n$ is a power of two; (ii) if $n \geqslant 2$, then the configuration consisting of piles of sizes 2 and $n-2$ is good.  Proof. (i) By Lemma 4, this configuration is solvable if and only if either $n=1$ or $n$ is even and has no non-trivial odd divisor, so the conclusion follows. (ii) Since 2 is even and has no non-trivial odd divisor, this configuration is certainly good, so the conclusion follows by Lemma 4.  Common remarks. Instead of choosing pebbles from two piles, one could allow choosing an equal number of pebbles from each of $k$ piles, where $k \geqslant 2$ is a fixed (prime) integer. However, this seems to yield a much harder problem - if $k=3$, numerical evidence suggests the same answer as in the case $k=2$ (with powers of two replaced by powers of three), but the case $k=5$ is already unclear.


Lucy starts by writing $s$ integer-valued 2022-tuples on a blackboard. After doing that, she can take any two (not necessarily distinct) tuples $\mathbf{v}=\left(v_{1}, \ldots, v_{2022}\right)$ and $\mathbf{w}=\left(w_{1}, \ldots, w_{2022}\right)$ that she has already written, and apply one of the following operations to obtain a new tuple:  $$ \begin{aligned} & \mathbf{v}+\mathbf{w}=\left(v_{1}+w_{1}, \ldots, v_{2022}+w_{2022}\right) \\ & \mathbf{v} \vee \mathbf{w}=\left(\max \left(v_{1}, w_{1}\right), \ldots, \max \left(v_{2022}, w_{2022}\right)\right) \end{aligned} $$  and then write this tuple on the blackboard. It turns out that, in this way, Lucy can write any integer-valued 2022-tuple on the blackboard after finitely many steps. What is the smallest possible number $s$ of tuples that she initially wrote? (Czech Republic) Answer: The smallest possible number is $s=3$.

Solution: We solve the problem for $n$-tuples for any $n \geqslant 3$ : we will show that the answer is $s=3$, regardless of the value of $n$.  First, let us briefly introduce some notation. For an $n$-tuple $\mathbf{v}$, we will write $\mathbf{v}_{i}$ for its $i$-th coordinate (where $1 \leqslant i \leqslant n$ ). For a positive integer $n$ and a tuple $\mathbf{v}$ we will denote by $n \cdot \mathbf{v}$ the tuple obtained by applying addition on $\mathbf{v}$ with itself $n$ times. Furthermore, we denote by $\mathbf{e}(i)$ the tuple which has $i$-th coordinate equal to one and all the other coordinates equal to zero. We say that a tuple is positive if all its coordinates are positive, and negative if all its coordinates are negative.  We will show that three tuples suffice, and then that two tuples do not suffice.  Three tuples suffice. Write $\mathbf{c}$ for the constant-valued tuple $\mathbf{c}=(-1, \ldots,-1)$. We note that it is enough for Lucy to be able to make the tuples $\mathbf{e}(1), \ldots, \mathbf{e}(n), \mathbf{c}$; from those any other tuple $\mathbf{v}$ can be made as follows. First we choose some positive integer $k$ such that $k+\mathbf{v}_{i}>0$ for all $i$. Then, by adding a positive number of copies of $\mathbf{c}, \mathbf{e}(1), \ldots, \mathbf{e}(n)$, she can make  $$ k \mathbf{c}+\left(k+\mathbf{v}_{1}\right) \cdot \mathbf{e}(1)+\cdots+\left(k+\mathbf{v}_{n}\right) \cdot \mathbf{e}(n) $$  which we claim is equal to $\mathbf{v}$. Indeed, this can be checked by comparing coordinates: the $i$-th coordinate of the right-hand side is $-k+\left(k+\mathbf{v}_{i}\right)=\mathbf{v}_{i}$ as needed.  Lucy can take her three starting tuples to be $\mathbf{a}, \mathbf{b}$ and $\mathbf{c}$, such that $\mathbf{a}_{i}=-i^{2}, \mathbf{b}_{i}=i$ and $\mathbf{c}=-1$ (as above).  For any $1 \leqslant j \leqslant n$, write $\mathbf{d}(j)$ for the tuple $2 \cdot \mathbf{a}+4 j \cdot \mathbf{b}+\left(2 j^{2}-1\right) \cdot \mathbf{c}$, which Lucy can make by adding together $\mathbf{a}, \mathbf{b}$ and $\mathbf{c}$ repeatedly. This has $i$ th term  $$ \begin{aligned} \mathbf{d}(j)_{i} & =2 \mathbf{a}_{i}+4 j \mathbf{b}_{i}+\left(2 j^{2}-1\right) \mathbf{c}_{i} \\ & =-2 i^{2}+4 i j-\left(2 j^{2}-1\right) \\ & =1-2(i-j)^{2} \end{aligned} $$  This is 1 if $j=i$, and at most -1 otherwise. Hence Lucy can produce the tuple $\mathbf{1}=(1, \ldots, 1)$ as $\mathbf{d}(1) \vee \cdots \vee \mathbf{d}(n)$.  She can then produce the constant tuple $\mathbf{0}=(0, \ldots, 0)$ as $\mathbf{1}+\mathbf{c}$, and for any $1 \leqslant j \leqslant n$ she can then produce the tuple $\mathbf{e}(j)$ as $\mathbf{d}(j) \vee \mathbf{0}$. Since she can now produce $\mathbf{e}(1), \ldots, \mathbf{e}(n)$ and already had c, she can (as we argued earlier) produce any integer-valued tuple.  Two tuples do not suffice. We start with an observation: Let $a$ be a non-negative real number and suppose that two tuples $\mathbf{v}$ and $\mathbf{w}$ satisfy $\mathbf{v}_{j} \geqslant a \mathbf{v}_{k}$ and $\mathbf{w}_{j} \geqslant a \mathbf{w}_{k}$ for some $1 \leqslant j, k \leqslant n$. Then we claim that the same inequality holds for $\mathbf{v}+\mathbf{w}$ and $\mathbf{v} \vee \mathbf{w}$ : Indeed, the property for the sum is verified by an easy computation:  $$ (\mathbf{v}+\mathbf{w})_{j}=\mathbf{v}_{j}+\mathbf{w}_{j} \geqslant a \mathbf{v}_{k}+a \mathbf{w}_{k}=a(\mathbf{v}+\mathbf{w})_{k} $$  For the second operation, we denote by $\mathbf{m}$ the tuple $\mathbf{v} \vee \mathbf{w}$. Then $\mathbf{m}_{j} \geqslant \mathbf{v}_{j} \geqslant a \mathbf{v}_{k}$ and $\mathbf{m}_{j} \geqslant \mathbf{w}_{j} \geqslant a \mathbf{w}_{k}$. Since $\mathbf{m}_{k}=\mathbf{v}_{k}$ or $\mathbf{m}_{k}=\mathbf{w}_{k}$, the observation follows.  As a consequence of this observation we have that if all starting tuples satisfy such an inequality, then all generated tuples will also satisfy it, and so we would not be able to obtain every integer-valued tuple.  Let us now prove that Lucy needs at least three starting tuples. For contradiction, let us suppose that Lucy started with only two tuples $\mathbf{v}$ and $\mathbf{w}$. We are going to distinguish two cases. In the first case, suppose we can find a coordinate $i$ such that $\mathbf{v}_{i}, \mathbf{w}_{i} \geqslant 0$. Both operations preserve the sign, thus we can not generate any tuple that has negative $i$-th coordinate. Similarly for $\mathbf{v}_{i}, \mathbf{w}_{i} \leqslant 0$.  Suppose the opposite, i.e., for every $i$ we have either $\mathbf{v}_{i}>0>\mathbf{w}_{i}$, or $\mathbf{v}_{i}<0<\mathbf{w}_{i}$. Since we assumed that our tuples have at least three coordinates, by pigeonhole principle there exist two coordinates $j \neq k$ such that $\mathbf{v}_{j}$ has the same sign as $\mathbf{v}_{k}$ and $\mathbf{w}_{j}$ has the same sign as $\mathbf{w}_{k}$ (because there are only two possible combinations of signs).  Without loss of generality assume that $\mathbf{v}_{j}, \mathbf{v}_{k}>0$ and $\mathbf{w}_{j}, \mathbf{w}_{k}<0$. Let us denote the positive real number $\mathbf{v}_{j} / \mathbf{v}_{k}$ by $a$. If $\mathbf{w}_{j} / \mathbf{w}_{k} \leqslant a$, then both inequalities $\mathbf{v}_{j} \geqslant a \mathbf{v}_{k}$ and $\mathbf{w}_{j} \geqslant a \mathbf{w}_{k}$ are satisfied. On the other hand, if $\mathbf{w}_{j} / \mathbf{w}_{k} \leqslant a$, then both $\mathbf{v}_{k} \geqslant(1 / a) \mathbf{v}_{j}$ and $\mathbf{w}_{k} \geqslant(1 / a) \mathbf{w}_{j}$ are satisfied. In either case, we have found the desired inequality satisfied by both starting tuples, a contradiction with the observation above.


Alice fills the fields of an $n \times n$ board with numbers from 1 to $n^{2}$, each number being used exactly once. She then counts the total number of good paths on the board. A good path is a sequence of fields of arbitrary length (including 1) such that: (i) The first field in the sequence is one that is only adjacent to fields with larger numbers, (ii) Each subsequent field in the sequence is adjacent to the previous field, (iii) The numbers written on the fields in the sequence are in increasing order.  Two fields are considered adjacent if they share a common side. Find the smallest possible number of good paths Alice can obtain, as a function of $n$. (Serbia) Answer: $2 n^{2}-2 n+1$.

Solution: We will call any field that is only adjacent to fields with larger numbers a well. Other fields will be called non-wells. Let us make a second $n \times n$ board $B$ where in each field we will write the number of good sequences which end on the corresponding field in the original board $A$. We will thus look for the minimal possible value of the sum of all entries in $B$.  We note that any well has just one good path ending in it, consisting of just the well, and that any other field has the number of good paths ending in it equal to the sum of this quantity for all the adjacent fields with smaller values, since a good path can only come into the field from a field of lower value. Therefore, if we fill in the fields in $B$ in increasing order with respect to their values in $A$, it follows that each field not adjacent to any already filled field will receive a 1, while each field adjacent to already filled fields will receive the sum of the numbers already written on these adjacent fields.  We note that there is at least one well in $A$, that corresponding with the field with the entry 1 in $A$. Hence, the sum of values of fields in $B$ corresponding to wells in $A$ is at least 1 . We will now try to minimize the sum of the non-well entries, i.e. of the entries in $B$ corresponding to the non-wells in $A$. We note that we can ascribe to each pair of adjacent fields the value of the lower assigned number and that the sum of non-well entries will then equal to the sum of the ascribed numbers. Since the lower number is still at least 1, the sum of non-well entries will at least equal the number of pairs of adjacent fields, which is $2 n(n-1)$. Hence, the total minimum sum of entries in $B$ is at least $2 n(n-1)+1=2 n^{2}-2 n+1$. The necessary conditions for the minimum to be achieved is for there to be only one well and for no two entries in $B$ larger than 1 to be adjacent to each other.  We will now prove that the lower limit of $2 n^{2}-2 n+1$ entries can be achieved. This amounts to finding a way of marking a certain set of squares, those that have a value of 1 in $B$, such that no two unmarked squares are adjacent and that the marked squares form a connected tree with respect to adjacency.  For $n=1$ and $n=2$ the markings are respectively the lone field and the L-trimino. Now, for $n>2$, let $s=2$ for $n \equiv 0,2 \bmod 3$ and $s=1$ for $n \equiv 1 \bmod 3$. We will take indices $k$ and $l$ to be arbitrary non-negative integers. For $n \geqslant 3$ we will construct a path of marked squares in the first two columns consisting of all squares of the form $(1, i)$ where $i$ is not of the form $6 k+s$ and $(2, j)$ where $j$ is of the form $6 k+s-1,6 k+s$ or $6+s+1$. Obviously, this path is connected. Now, let us consider the fields $(2,6 k+s)$ and $(1,6 k+s+3)$. For each considered field $(i, j)$ we will mark all squares of the form $(l, j)$ for $l>i$ and $(i+2 k, j \pm 1)$. One can easily see that no set of marked fields will produce a cycle, that the only fields of the unmarked form $(1,6 k+s),(2+2 l+1,6 k+s \pm 1)$ and $(2+2 l, 6 k+s+3 \pm 1)$ and that no two are adjacent, since the consecutive considered fields are in columns of opposite parity. Examples of markings are given for $n=3,4,5,6,7$, and the corresponding constructions for $A$ and $B$ are given for $n=5$. ![](https://cdn.mathpix.com/cropped/2024_11_18_86efb4389f14b52b08e1g-41.jpg?height=352&width=1648&top_left_y=384&top_left_x=204)


Let $\mathbb{Z}_{\geqslant 0}$ be the set of non-negative integers, and let $f: \mathbb{Z}_{\geqslant 0} \times \mathbb{Z}_{\geqslant 0} \rightarrow \mathbb{Z}_{\geqslant 0}$ be a bijection such that whenever $f\left(x_{1}, y_{1}\right)>f\left(x_{2}, y_{2}\right)$, we have $f\left(x_{1}+1, y_{1}\right)>f\left(x_{2}+1, y_{2}\right)$ and $f\left(x_{1}, y_{1}+1\right)>f\left(x_{2}, y_{2}+1\right)$.  Let $N$ be the number of pairs of integers $(x, y)$, with $0 \leqslant x, y<100$, such that $f(x, y)$ is odd. Find the smallest and largest possible value of $N$.  Answer: The optimal bounds are $2500 \leqslant N \leqslant 7500$.

Solution: We defer the constructions to the end of the solution. Instead, we begin by characterizing all such functions $f$, prove a formula and key property for such functions, and then solve the problem, providing constructions.  Characterization Suppose $f$ satisfies the given relation. The condition can be written more strongly as  $$ \begin{aligned} f\left(x_{1}, y_{1}\right)>f\left(x_{2}, y_{2}\right) & \Longleftrightarrow f\left(x_{1}+1, y_{1}\right)>f\left(x_{2}+1, y_{2}\right) \\ & \Longleftrightarrow f\left(x_{1}, y_{1}+1\right)>f\left(x_{2}, y_{2}+1\right) . \end{aligned} $$  In particular, this means for any $(k, l) \in \mathbb{Z}^{2}, f(x+k, y+l)-f(x, y)$ has the same sign for all $x$ and $y$.  Call a non-zero vector $(k, l) \in \mathbb{Z}_{\geqslant 0} \times \mathbb{Z}_{\geqslant 0}$ a needle if $f(x+k, y)-f(x, y+l)>0$ for all $x$ and $y$. It is not hard to see that needles and non-needles are both closed under addition, and thus under scalar division (whenever the quotient lives in $\mathbb{Z}^{2}$ ).  In addition, call a positive rational number $\frac{k}{l}$ a grade if the vector $(k, l)$ is a needle. (Since needles are closed under scalar multiples and quotients, this is well-defined.) Claim. Grades are closed upwards. Proof. Consider positive rationals $k_{1} / l_{1}<k_{2} / l_{2}$ with $k_{1} / l_{1}$ a grade. Then:  - $\left(k_{1}, l_{1}\right)$ is a needle - so $\left(k_{1} l_{2}, l_{1} l_{2}\right)$ is a needle, - so $\left(k_{2} l_{1}, l_{1} l_{2}\right)$ is a needle (as $k_{2} l_{1}-k_{1} l_{2}>0$ and $(1,0)$ is a needle).  Thus $\left(k_{2}, l_{2}\right)$ is a needle, as wanted. Claim. A grade exists. Proof. If no positive integer $n$ is a grade, then $f(1,0)>f(0, n)$ for all $n$ which is impossible. Similarly, there is an $n$ such that $f(0,1)<f(n, 0)$, thus $1 / n$ is not a grade for some large $n$. That means that small positive rational values are not grades, then there is a switch, and after that all values are grades. Call the place of that switch $\alpha$. Here $\alpha$ is the infimum of the grades. Claim (Key property). If $x_{1}+y_{1} \alpha>x_{2}+y_{2} \alpha$ then $f\left(x_{1}, y_{1}\right)>f\left(x_{2}, y_{2}\right)$. Proof. If both $x_{1} \geqslant x_{2}$ and $y_{1} \geqslant y_{2}$ this is clear. Suppose $x_{1} \geqslant x_{2}$ and $y_{1}<y_{2}$. Then $\frac{x_{1}-x_{2}}{y_{2}-y_{1}}>\alpha$ is a grade. This gives $f\left(x_{1}, y_{1}\right)>f\left(x_{2}, y_{2}\right)$. Suppose $x_{1}<x_{2}$ and $y_{1} \geqslant y_{2}$. Then $\frac{x_{2}-x_{1}}{u_{1}-u_{2}}<\alpha$ is not a grade. This gives $f\left(x_{2}, y_{2}\right)<f\left(x_{1}, y_{1}\right)$.  From those observations we get the following claim. Claim. The function $f$ orders pairs $(x, y)$ based on the value of $x+y \alpha$. If $\alpha$ is rational, tiebreaking is done by larger $x$ - or $y$-coordinate (depending on whether $\alpha$ is a grade).  We can imagine this the following way: take a line with slope $-\frac{1}{\alpha}$ under the first quadrant of the plane. And we start to move this line upward (but it stays parallel to the original line). First it hits $(0,0)$, so $f(0,0)=0$. And each time the line hits a point $p, f(p)$ is the number of points hit before. If $\alpha \in \mathbb{Q}$, it is possible that the line hits multiple points. Then those points are ordered the same way as their $x$ or $y$ coordinates, depending on whether $\alpha$ is a grade.  We understood the behaviour of $f$, now we need to focus on the region of $A=\{(x, y) \in$ $\left.\mathbb{Z}_{\geqslant 0} \times \mathbb{Z}_{\geqslant 0} \mid x<100, y<100\right\}$. First, we can assume that $\alpha$ is irrational. If we change it a little bit in the right direction, the behaviour and values of the $f$ function does not change in $A$. Claim.  $$ f(x, y)+f(x+1, y+1)=f(x+1, y)+f(x, y+1)+1 $$  Proof.  $$ \begin{gathered} f(x+1, y+1)-f(x, y+1)= \\ \#\left\{(a, b) \in \mathbb{Z}_{\geqslant 0} \times \mathbb{Z}_{\geqslant 0} \mid x+(y+1) \alpha \leqslant a+b \alpha<(x+1)+(y+1) \alpha\right\}= \\ \#\left\{(a, b) \in \mathbb{Z}_{\geqslant 0} \times \mathbb{Z}_{>0} \mid x+(y+1) \alpha \leqslant a+b \alpha<(x+1)+(y+1) \alpha\right\}+ \\ \#\left\{(a, 0) \in \mathbb{Z}_{\geqslant 0} \times \mathbb{Z}_{\geqslant 0} \mid(x+1)+y \alpha \leqslant a<(x+1)+(y+1) \alpha\right\}= \\ \#\left\{(a, b) \in \mathbb{Z}_{\geqslant 0} \times \mathbb{Z}_{\geqslant 0} \mid x+y \alpha \leqslant a+b \alpha<(x+1)+y \alpha\right\}+1=f(x+1, y)-f(x, y) . \end{gathered} $$  From this claim we immediately get that $2500 \leqslant N \leqslant 7500$; now we show that those bounds are indeed sharp.  Remember that if $\alpha$ is irrational then  $$ f(a, b)=\#\left\{(x, y) \in \mathbb{Z}_{\geqslant 0} \times \mathbb{Z}_{\geqslant 0} \mid x+y \alpha<a+b \alpha\right\} $$  Construction for 7500 Select $\alpha \approx 199.999$. Claim.  1. $f(n, 0)=n$ for $0 \leqslant n \leqslant 100$. 2. $f(0, k) \equiv k \quad \bmod 2$ for $0 \leqslant k \leqslant 100$.  Proof.  1. $f(n, 0)=\#\{(x, y) \mid x+y \alpha<n\}=\#\{(x, y) \mid x+199 y<n\}=n$. 2.   $$ \begin{aligned} & f(0, k)=\#\{(x, y) \mid x+y \alpha<k \alpha\}=\sum_{l=0}^{k-1} \#\{(x, l) \mid x+l \alpha<k \alpha\} \\ & =\sum_{l=0}^{k-1} \#\{x \mid x<(k-l) \alpha\}=\sum_{l=0}^{k-1} 200(k-l)-1=200 A-k \end{aligned} $$  for some integer $A$. From this claim, using the equality $f(x, y)+f(x+1, y+1)=f(x+1, y)+f(x, y+1)+1$, we can prove that mod 2 the region $A$ looks like the following: in the rows $(-, 2 y)$ the remainders modulo 2 alternate, while the rows $(-, 2 y+1)$ contain only odd numbers. ![](https://cdn.mathpix.com/cropped/2024_11_18_86efb4389f14b52b08e1g-44.jpg?height=364&width=506&top_left_y=229&top_left_x=775)  The numbers mod 2 in the construction for 7500 .  Construction for 2500 Select $\alpha \approx 200.001$.


Let $A A^{\prime} B C C^{\prime} B^{\prime}$ be a convex cyclic hexagon such that $A C$ is tangent to the incircle of the triangle $A^{\prime} B^{\prime} C^{\prime}$, and $A^{\prime} C^{\prime}$ is tangent to the incircle of the triangle $A B C$. Let the lines $A B$ and $A^{\prime} B^{\prime}$ meet at $X$ and let the lines $B C$ and $B^{\prime} C^{\prime}$ meet at $Y$.  Prove that if $X B Y B^{\prime}$ is a convex quadrilateral, then it has an incircle. (Australia)

Solution: Denote by $\omega$ and $\omega^{\prime}$ the incircles of $\triangle A B C$ and $\triangle A^{\prime} B^{\prime} C^{\prime}$ and let $I$ and $I^{\prime}$ be the centres of these circles. Let $N$ and $N^{\prime}$ be the second intersections of $B I$ and $B^{\prime} I^{\prime}$ with $\Omega$, the circumcircle of $A^{\prime} B C C^{\prime} B^{\prime} A$, and let $O$ be the centre of $\Omega$. Note that $O N \perp A C, O N^{\prime} \perp A^{\prime} C^{\prime}$ and $O N=O N^{\prime}$ so $N N^{\prime}$ is parallel to the angle bisector $I I^{\prime}$ of $A C$ and $A^{\prime} C^{\prime}$. Thus $I I^{\prime} \| N N^{\prime}$ which is antiparallel to $B B^{\prime}$ with respect to $B I$ and $B^{\prime} I^{\prime}$. Therefore $B, I, I^{\prime}, B^{\prime}$ are concyclic. ![](https://cdn.mathpix.com/cropped/2024_11_18_86efb4389f14b52b08e1g-60.jpg?height=958&width=1072&top_left_y=926&top_left_x=498)  Further define $P$ as the intersection of $A C$ and $A^{\prime} C^{\prime}$ and $M$ as the antipode of $N^{\prime}$ in $\Omega$. Consider the circle $\Gamma_{1}$ with centre $N$ and radius $N A=N C$ and the circle $\Gamma_{2}$ with centre $M$ and radius $M A^{\prime}=M C^{\prime}$. Their radical axis passes through $P$ and is perpendicular to $M N \perp N N^{\prime} \| I P$, so $I$ lies on their radical axis. Therefore, since $I$ lies on $\Gamma_{1}$, it must also lie on $\Gamma_{2}$. Thus, if we define $Z$ as the second intersection of $M I$ with $\Omega$, we have that $I$ is the incentre of triangle $Z A^{\prime} C^{\prime}$. (Note that the point $Z$ can also be constructed directly via Poncelet's porism.)  Consider the incircle $\omega_{c}$ with centre $I_{c}$ of triangle $C^{\prime} B^{\prime} Z$. Note that $\angle Z I C^{\prime}=90^{\circ}+$ $\frac{1}{2} \angle Z A^{\prime} C^{\prime}=90^{\circ}+\frac{1}{2} \angle Z B^{\prime} C^{\prime}=\angle Z I_{c} C^{\prime}$, so $Z, I, I_{c}, C^{\prime}$ are concyclic. Similarly $B^{\prime}, I^{\prime}, I_{c}, C^{\prime}$ are concyclic.  The external centre of dilation from $\omega$ to $\omega_{c}$ is the intersection of $I I_{c}$ and $C^{\prime} Z$ ( $D$ in the picture), that is the radical centre of circles $\Omega, C^{\prime} I_{c} I Z$ and $I I^{\prime} I_{c}$. Similarly, the external centre of dilation from $\omega^{\prime}$ to $\omega_{c}$ is the intersection of $I^{\prime} I_{c}$ and $B^{\prime} C^{\prime}$ ( $D^{\prime}$ in the picture), that is the radical centre of circles $\Omega, B^{\prime} I^{\prime} I_{c} C^{\prime}$ and $I I^{\prime} I_{c}$. Therefore the Monge line of $\omega, \omega^{\prime}$ and $\omega_{c}$ is line $D D^{\prime}$, and the radical axis of $\Omega$ and circle $I I^{\prime} I_{c}$ coincide. Hence the external centre $T$ of dilation from $\omega$ to $\omega^{\prime}$ is also on the radical axis of $\Omega$ and circle $I I^{\prime} I_{c}$. ![](https://cdn.mathpix.com/cropped/2024_11_18_86efb4389f14b52b08e1g-61.jpg?height=1029&width=964&top_left_y=228&top_left_x=546)  Now since $B, I, I^{\prime}, B^{\prime}$ are concyclic, the intersection $T^{\prime}$ of $B B^{\prime}$ and $I I^{\prime}$ is on the radical axis of $\Omega$ and circle $I I^{\prime} I_{c}$. Thus $T^{\prime}=T$ and $T$ lies on line $B B^{\prime}$. Finally, construct a circle $\Omega_{0}$ tangent to $A^{\prime} B^{\prime}, B^{\prime} C^{\prime}, A B$ on the same side of these lines as $\omega^{\prime}$. The centre of dilation from $\omega^{\prime}$ to $\Omega_{0}$ is $B^{\prime}$, so by Monge's theorem the external centre of dilation from $\Omega_{0}$ to $\omega$ must be on the line $T B B^{\prime}$. However, it is on line $A B$, so it must be $B$ and $B C$ must be tangent to $\Omega_{0}$ as desired. ![](https://cdn.mathpix.com/cropped/2024_11_18_86efb4389f14b52b08e1g-61.jpg?height=918&width=1357&top_left_y=1637&top_left_x=361)


A number is called Norwegian if it has three distinct positive divisors whose sum is equal to 2022. Determine the smallest Norwegian number. (Note: The total number of positive divisors of a Norwegian number is allowed to be larger than 3.) (Cyprus) Answer: 1344

Solution: Observe that 1344 is a Norwegian number as 6, 672 and 1344 are three distinct divisors of 1344 and $6+672+1344=2022$. It remains to show that this is the smallest such number.  Assume for contradiction that $N<1344$ is Norwegian and let $N / a, N / b$ and $N / c$ be the three distinct divisors of $N$, with $a<b<c$. Then  $$ 2022=N\left(\frac{1}{a}+\frac{1}{b}+\frac{1}{c}\right)<1344\left(\frac{1}{a}+\frac{1}{b}+\frac{1}{c}\right) $$  and so  $$ \left(\frac{1}{a}+\frac{1}{b}+\frac{1}{c}\right)>\frac{2022}{1344}=\frac{337}{224}=\frac{3}{2}+\frac{1}{224} $$  If $a>1$ then  $$ \frac{1}{a}+\frac{1}{b}+\frac{1}{c} \leqslant \frac{1}{2}+\frac{1}{3}+\frac{1}{4}=\frac{13}{12}<\frac{3}{2} $$  so it must be the case that $a=1$. Similarly, it must hold that $b<4$ since otherwise  $$ 1+\frac{1}{b}+\frac{1}{c} \leqslant 1+\frac{1}{4}+\frac{1}{5}<\frac{3}{2} . $$  This leaves two cases to check, $b=2$ and $b=3$. Case $b=3$. Then  $$ \frac{1}{c}>\frac{3}{2}+\frac{1}{224}-1-\frac{1}{3}>\frac{1}{6}, $$  so $c=4$ or $c=5$. If $c=4$ then  $$ 2022=N\left(1+\frac{1}{3}+\frac{1}{4}\right)=\frac{19}{12} N $$  but this is impossible as $19 \nmid 2022$. If $c=5$ then  $$ 2022=N\left(1+\frac{1}{3}+\frac{1}{5}\right)=\frac{23}{15} N $$  which again is impossible, as $23 \nmid 2022$. Case $b=2$. Note that $c<224$ since  $$ \frac{1}{c}>\frac{3}{2}+\frac{1}{224}-1-\frac{1}{2}=\frac{1}{224} $$  It holds that  $$ 2022=N\left(1+\frac{1}{2}+\frac{1}{c}\right)=\frac{3 c+2}{2 c} N \Rightarrow(3 c+2) N=4044 c $$  Since $(c, 3 c-2)=(c, 2) \in\{1,2\}$, then $3 c+2 \mid 8088=2^{3} \cdot 3 \cdot 337$ which implies that $3 c+2 \mid 2^{3} \cdot 337$. But since $3 c+2 \geqslant 3 \cdot 3+2>8=2^{3}$ and $3 c+2 \neq 337$, then it must hold that $3 c+2 \geqslant 2 \cdot 337$, contradicting $c<224$.


Find all positive integers $n>2$ such that  $$ n!\mid \prod_{\substack{p<q \leqslant n, p, q \text { primes }}}(p+q) . $$  (Nigeria) Answer: This only holds for $n=7$.

Solution: Assume that $n$ satisfies $n!\mid \prod_{p<q \leqslant n}(p+q)$ and let $2=p_{1}<p_{2}<\cdots<p_{m} \leqslant n$ be the primes in $\{1,2, \ldots, n\}$. Each such prime divides $n$ !. In particular, $p_{m} \mid p_{i}+p_{j}$ for some $p_{i}<p_{j} \leqslant n$. But  $$ 0<\frac{p_{i}+p_{j}}{p_{m}}<\frac{p_{m}+p_{m}}{p_{m}}=2 $$  so $p_{m}=p_{i}+p_{j}$ which implies $m \geqslant 3, p_{i}=2$ and $p_{m}=2+p_{j}=2+p_{m-1}$. Similarly, $p_{m-1} \mid p_{k}+p_{l}$ for some $p_{k}<p_{l} \leqslant n$. But  $$ 0<\frac{p_{l}+p_{k}}{p_{m-1}} \leqslant \frac{p_{m}+p_{m-1}}{p_{m-1}}=\frac{2 p_{m-1}+2}{p_{m-1}}<3 $$  so either $p_{m-1}=p_{l}+p_{k}$ or $2 p_{m-1}=p_{l}+p_{k}$. As above, the former case gives $p_{m-1}=2+p_{m-2}$. If $2 p_{m-1}=p_{l}+p_{k}$, then $p_{m-1}<p_{k}$, so $k=m$ and  $$ 2 p_{m-1}=p_{l}+p_{m-1}+2 \Rightarrow p_{m-1}=p_{l}+2=p_{m-2}+2 $$  Either way, $p_{m-2}>2$ and 3 divides one of $p_{m-2}, p_{m-1}=p_{m-2}+2$ and $p_{m}=p_{m-2}+4$. This implies $p_{m-2}=3$ and thus $p_{m}=7$, giving $7 \leqslant n<11$.  Finally, a quick computation shows that $7!\mid \prod_{p<q \leqslant 7}(p+q)$ but $8!\nmid \prod_{p<q \leqslant 7}(p+q)$, so neither does 9 ! and 10 !.


Let $a>1$ be a positive integer, and let $d>1$ be a positive integer coprime to $a$. Let $x_{1}=1$ and, for $k \geqslant 1$, define  $$ x_{k+1}= \begin{cases}x_{k}+d & \text { if } a \text { doesn't divide } x_{k} \\ x_{k} / a & \text { if } a \text { divides } x_{k}\end{cases} $$  Find the greatest positive integer $n$ for which there exists an index $k$ such that $x_{k}$ is divisible by $a^{n}$. (Croatia)  Answer: $n$ is the exponent with $d<a^{n}<a d$.

Solution: By trivial induction, $x_{k}$ is coprime to $d$. By induction and the fact that there can be at most $a-1$ consecutive increasing terms in the sequence, it also holds that $x_{k}<d a$ if $x_{k}=x_{k-1}+d$ and that $x_{k}<d$ if $x_{k}=\frac{x_{k-1}}{a}$ or $k=1$. This gives the upper bound on the exponent.  This implies that the sequence is (eventually) periodic, and that both increasing and decreasing steps happen infinitely many times. Let $a^{-k}$ be the multiplicative inverse of $a^{k}$ modulo $d$. The sequence contains elements congruent to $1, a^{-1}, a^{-2}, \ldots$ modulo $d$.  Let $x_{k_{0}}$ the first element such that $x_{k_{0}} \equiv a^{-n}(\bmod d)$. We have either $k_{0}=1$ or $x_{k_{0}}=$ $x_{k_{0}-1} / a$; in both cases $x_{k_{0}}<d<a^{n}<d a$ and therefore  $$ x_{k_{0}} \in\left\{a^{n}-d, a^{n}-2 d, \ldots, a^{n}-(a-1) d\right\} $$  In this set no element is divisible by $a$, so therefore the sequence will visit the value $a^{n}$ in the next $a-1$ steps.


Solution: Like in the first solution, $x_{k}$ is relatively prime to $d$ and $x_{k}<a d$ for all $k$. Let  $$ S=\left\{x \in \mathbb{Z}_{>0}: 0<x<a d, \operatorname{gcd}(x, d)=1\right\} \quad \text { and } \quad f: S \rightarrow S, f(x)= \begin{cases}x+d & \text { if } a \nmid x \\ x / a & \text { if } a \mid x\end{cases} $$  So, we have $x_{1}=1$ and $x_{k+1}=f\left(x_{k}\right)$. Notice that the recurrence formula is invertible. Suppose that $f(x)=y$ for some $x, y \in S$. If $y>d$ then $y-d \in S$ but $a \cdot y \notin S$; otherwise, if $y<d$ then $a \cdot y \in S$ but $y-d \notin S$. So, the function $f$ is a permutation on $S$, and its inverse is  $$ f^{-1}(y)=\left\{\begin{array}{ll} y-d & \text { if } y>d, \\ a \cdot y & \text { if } y<d \end{array} \quad \text { for all } y \in S\right. $$  It follows that the sequence is periodic, and therefore attains the initial value 1 infinitely many times. Let $k_{1}>1$ be an index such that $x_{k_{1}}=1$. Then  $$ x_{k_{1}}=1, \quad x_{k_{1}-1}=f^{-1}(1)=a, x_{k_{1}-2}=f^{-1}(a)=a^{2}, \ldots, \quad x_{k_{1}-n}=a^{n} $$


Solution: Like in the first solution, $x_{k}$ is relatively prime to $d$ and $x_{k}<a d$ for all $k$. We wish to prove that there are $n$ consecutive decreasing indices. Let $m_{0}=0$ and $m_{k}$ be the $k$-th smallest decreasing index (an index $k$ is decreasing if $x_{k}=x_{k-1} / a$ ) and define a sequence $\left(y_{k}\right)_{k}=\left(x_{m_{k}}\right)_{k}$, i.e. the subsequence consisting only of elements with decreasing indices. For each $k \geqslant 1$ we can write  $$ y_{k+1}=\frac{y_{k}+z_{k} d}{a} $$  for some $z_{k} \in\{0,1, \ldots, a-1\}$, where $z_{k}=0$ if and only if $y_{k}$ and $y_{k+1}$ are consecutive elements in the original sequence. Then  $$ y_{k}=\frac{1+\left(z_{0}+z_{1} a+\cdots+z_{k-1} a^{k-1}\right) d}{a^{k}} $$  because $y_{k}$ is bounded the sequence is (eventually) periodic. Consider some $y_{u}=y_{u+v}$ where $v \geqslant 1$. We can write  $$ y_{u}=\frac{1+\left(z_{0}+z_{1} a+\cdots+z_{u-1} a^{u-1}\right) d}{a^{u}} $$  and  $$ y_{u+v}=\frac{1+\left(z_{0}+z_{1} a+\cdots+z_{u+v-1} a^{u+v-1}\right) d}{a^{u+v}} $$  and so  $$ \frac{1+\left(z_{0}+z_{1} a+\cdots+z_{u+v-1} a^{u+v-1}\right) d}{a^{u+v}}=\frac{1+\left(z_{0}+z_{1} a+\cdots+z_{u-1} a^{u-1}\right) d}{a^{u}} . $$  Rearranging gives  $$ \frac{a^{v}-1}{d}=z_{0}+z_{1} a+\cdots+z_{v-1} a^{v-1}+\left(z_{v}-z_{0}\right) a^{v}+\cdots+\left(z_{u+v-1}-z_{u-1}\right) a^{u+v-1} . $$  Since $d>a^{n} / a=a^{n-1}$ the LHS is strictly less than $a^{v-n}$. This implies that on the RHS, the coefficients of $a^{v-n}, a^{v-n+1}, \ldots$ must all be zero, i.e. $z_{v-n}=z_{v-n+1}=\cdots=z_{v-1}=0$. This implies that there are $n$ consecutive decreasing indices in the original sequence.


Find all triples of positive integers $(a, b, p)$ with $p$ prime and  $$ a^{p}=b!+p $$  (Belgium) Answer: $(2,2,2)$ and $(3,4,3)$.

Solution: Clearly, $a>1$. We consider three cases. Case 1: We have $a<p$. Then we either have $a \leqslant b$ which implies $a \mid a^{p}-b!=p$ leading to a contradiction, or $a>b$ which is also impossible since in this case we have $b!\leqslant a!<a^{p}-p$, where the last inequality is true for any $p>a>1$. Case 2: We have $a>p$. In this case $b!=a^{p}-p>p^{p}-p \geqslant p!$ so $b>p$ which means that $a^{p}=b!+p$ is divisible by $p$. Hence, $a$ is divisible by $p$ and $b!=a^{p}-p$ is not divisible by $p^{2}$. This means that $b<2 p$. If $a<p^{2}$ then $a / p<p$ divides both $a^{p}$ and $b$ ! and hence it also divides $p=a^{p}-b$ ! which is impossible. On the other hand, the case $a \geqslant p^{2}$ is also impossible since then $a^{p} \geqslant\left(p^{2}\right)^{p}>(2 p-1)!+p \geqslant b!+p$.  Comment. The inequality $p^{2 p}>(2 p-1)!+p$ can be shown e.g. by using  $$ (2 p-1)!=[1 \cdot(2 p-1)] \cdot[2 \cdot(2 p-2)] \cdots \cdots[(p-1)(p+1)] \cdot p<\left(\left(\frac{2 p}{2}\right)^{2}\right)^{p-1} \cdot p=p^{2 p-1} $$  where the inequality comes from applying AM-GM to each of the terms in square brackets. Case 3: We have $a=p$. In this case $b!=p^{p}-p$. One can check that the values $p=2,3$ lead to the claimed solutions and $p=5$ does not lead to a solution. So we now assume that $p \geqslant 7$. We have $b!=p^{p}-p>p$ ! and so $b \geqslant p+1$ which implies that $v_{2}((p+1)!) \leqslant v_{2}(b!)=v_{2}\left(p^{p-1}-1\right) \stackrel{L T E}{=} 2 v_{2}(p-1)+v_{2}(p+1)-1=v_{2}\left(\frac{p-1}{2} \cdot(p-1) \cdot(p+1)\right)$, where in the middle we used lifting-the-exponent lemma. On the RHS we have three factors of $(p+1)!$. But, due to $p+1 \geqslant 8$, there are at least 4 even numbers among $1,2, \ldots, p+1$, so this case is not possible.


Solution: The cases $a \neq p$ are covered as in solution 1 , as are $p=2,3$. For $p \geqslant 5$ we have $b!=p\left(p^{p-1}-1\right)$. By Zsigmondy's Theorem there exists some prime $q$ that divides $p^{p-1}-1$ but does not divide $p^{k}-1$ for $k<p-1$. It follows that $\operatorname{ord}_{q}(p)=p-1$, and hence $q \equiv 1$ $\bmod (p-1)$. Note that $p \neq q$. But then we must have $q \geqslant 2 p-1$, giving $b!\geqslant(2 p-1)!=[1 \cdot(2 p-1)] \cdot[2 \cdot(2 p-2)] \cdots \cdots[(p-1) \cdot(p+1)] \cdot p>(2 p-1)^{p-1} p>p^{p}>p^{p}-p$, a contradiction.


Solution: The cases $a \neq p$ are covered as in solution 1 , as are $p=2,3$. Also $b>p$, as $p^{p}>p!+p$ for $p>2$. The cases $p=5,7,11$ are also checked manually, so assume $p \geqslant 13$. Let $q \mid p+1$ be an odd prime. By LTE  $$ v_{q}\left(p^{p}-p\right)=v_{q}\left(\left(p^{2}\right)^{\frac{p-1}{2}}-1\right)=v_{q}\left(p^{2}-1\right)+v_{q}\left(\frac{p-1}{2}\right)=v_{q}(p+1) $$  But $b \geqslant p+1$, so then $v_{q}(b!)>v_{q}(p+1)$, since $q<p+1$, a contradiction. This means that $p+1$ has no odd prime divisor, i.e. $p+1=2^{k}$ for some $k$.  Now let $q \mid p-1$ be an odd prime. By LTE  $$ v_{q}\left(p^{p}-p\right)=2 v_{q}(p-1) $$  Let $d=v_{q}(p-1)$. Then $p \geqslant 1+q^{d}$, so  $$ v_{q}(b!) \geqslant v_{q}(p!) \geqslant v_{q}\left(q^{d}!\right)>q^{d-1} \geqslant 2 d $$  provided $d \geqslant 2$ and $q>3$, or $d \geqslant 3$. If $q=3, d=2$ and $p \geqslant 13$ then $v_{q}(b!) \geqslant v_{q}(p!) \geqslant v_{q}(13!)=5>2 d$. Either way, $d \leqslant 1$. If $p>2 q+1$ (so $p>3 q$, as $q \mid p-1$ ) then  $$ v_{q}(b!) \geqslant v_{q}((3 q)!)=3, $$  so we must have $q \geqslant \frac{p}{2}$, in other words, $p-1=2 q$. This implies that $p=2^{k}-1$ and $q=2^{k-1}-1$ are both prime, but it is not possible to have two consecutive Mersenne primes.


Solution: Let $a=p, b>p$ and $p \geqslant 5$ (the remaining cases are dealt with as in solution 3). Modulo $(p+1)^{2}$ it holds that $p^{p}-p=(p+1-1)^{p}-p \equiv\binom{p}{1}(p+1)(-1)^{p-1}+(-1)^{p}-p=p(p+1)-1-p=p^{2}-1 \not \equiv 0 \quad \bmod \left((p+1)^{2}\right)$. Since $p \geqslant 5$, the numbers 2 and $\frac{p+1}{2}$ are distinct and less than or equal to $p$. Therefore, $p+1 \mid p$, and so $(p+1)^{2} \mid(p+1)$ !. But $b \geqslant p+1$, so $b!\equiv 0 \not \equiv p^{p}-p \bmod (p+1)^{2}$, a contradiction.


Let $Q$ be a set of prime numbers, not necessarily finite. For a positive integer $n$ consider its prime factorisation; define $p(n)$ to be the sum of all the exponents and $q(n)$ to be the sum of the exponents corresponding only to primes in $Q$. A positive integer $n$ is called special if $p(n)+p(n+1)$ and $q(n)+q(n+1)$ are both even integers. Prove that there is a constant $c>0$ independent of the set $Q$ such that for any positive integer $N>100$, the number of special integers in $[1, N]$ is at least $c N$. (For example, if $Q=\{3,7\}$, then $p(42)=3, q(42)=2, p(63)=3, q(63)=3, p(2022)=3$, $q(2022)=1$.) (Costa Rica)

Solution: Let us call two positive integers $m, n$ friends if $p(m)+p(n)$ and $q(m)+q(n)$ are both even integers. We start by noting that the pairs $(p(k), q(k))$ modulo 2 can take at most 4 different values; thus, among any five different positive integers there are two which are friends.  In addition, both functions $p$ and $q$ satisfy $f(a b)=f(a)+f(b)$ for any $a, b$. Therefore, if $m$ and $n$ are divisible by $d$, then both $p$ and $q$ satisfy the equality $f(m)+f(n)=f(m / d)+$ $f(n / d)+2 f(d)$. This implies that $m, n$ are friends if and only if $m / d, n / d$ are friends.  Let us call a set of integers $\left\{n_{1}, n_{2}, \ldots, n_{5}\right\}$ an interesting set if for any indexes $i, j$, the difference $d_{i j}=\left|n_{i}-n_{j}\right|$ divides both $n_{i}$ and $n_{j}$. We claim that if elements of an interesting set are all positive, then we can obtain a special integer. Indeed, if we were able to construct such a set, then there would be a pair of integers $\left\{n_{i}, n_{j}\right\}$ which are friends, according to the first observation. Additionally, the second observation yields that the quotients $n_{i} / d_{i j}, n_{j} / d_{i j}$ form a pair of friends, which happen to be consecutive integers, thus giving a special integer as desired.  In order to construct a family of interesting sets, we can start by observing that the set $\{0,6,8,9,12\}$ is an interesting set. Using that $72=2^{3} \cdot 3^{2}$ is the least common multiple of all pairwise differences in this set, we obtain a family of interesting sets by considering  $$ \{72 k, 72 k+6,72 k+8,72 k+9,72 k+12\} $$  for any $k \geqslant 1$. If we consider the quotients (of these numbers by the appropriate differences), then we obtain that the set  $$ S_{k}=\{6 k, 8 k, 9 k, 12 k, 12 k+1,18 k+2,24 k+2,24 k+3,36 k+3,72 k+8\}, $$  has at least one special integer. In particular, the interval $[1,100 k]$ contains the sets $S_{1}, S_{2}, \ldots, S_{k}$, each of which has a special number. Any special number can be contained in at most ten sets $S_{k}$, from where we conclude that the number of special integers in $[1,100 k]$ is at least $k / 10$.  Finally, let $N=100 k+r$, with $k \geqslant 1$ and $0 \leqslant r<100$, so that we have $N<100(k+1) \leqslant$ $200 k$. Then the number of special integers in $[1, N]$ is at least $k / 10>N / 2000$, as we wanted to prove.  Comment 1. The statement is also true for $N \geqslant 15$ as at least one of the numbers $7,14,15$ is special. Comment 2. Another approach would be to note that if $p(2 n), p(2 n+1), p(2 n+2)$ all have the same parity then one of the numbers $n, 2 n, 2 n+1$ is special. Indeed, if $q(n)+q(n+1)$ is even then $n$ is special since $p(n)+p(n+1) \equiv p(2 n)+p(2 n+2) \equiv 0(\bmod 2)$. Otherwise, if $q(n)+q(n+1)$ is odd, so is $q(2 n)+q(2 n+2)$ which implies that exactly one of the numbers $2 n, 2 n+1$ is special.  Unfortunately, it seems hard to show that the set of such $n$ has positive density: see a recent paper https://arxiv.org/abs/1509.01545 for the proof that all eight patterns of the parities of $p(n), p(n+1), p(n+2)$ appear for a positive proportion of positive integers.  This page is intentionally left blank


Let $k$ be a positive integer and let $S$ be a finite set of odd prime numbers. Prove that there is at most one way (modulo rotation and reflection) to place the elements of $S$ around a circle such that the product of any two neighbors is of the form $x^{2}+x+k$ for some positive integer $x$.

Solution: Let us allow the value $x=0$ as well; we prove the same statement under this more general constraint. Obviously that implies the statement with the original conditions.  Call a pair $\{p, q\}$ of primes with $p \neq q$ special if $p q=x^{2}+x+k$ for some nonnegative integer $x$. The following claim is the key mechanism of the problem: Claim. (a) For every prime $r$, there are at most two primes less than $r$ forming a special pair with $r$. (b) If such $p$ and $q$ exist, then $\{p, q\}$ is itself special.  We present two proofs of the claim. Proof 1. We are interested in integers $1 \leqslant x<r$ satsfying  $$ x^{2}+x+k \equiv 0 \quad(\bmod r) $$  Since there are at most two residues modulo $r$ that can satisfy that quadratic congruence, there are at most two possible values of $x$. That proves (a).  Now suppose there are primes $p, q$ with $p<q<r$ and nonnegative integers $x, y$ such that  $$ \begin{aligned} & x^{2}+x+k=p r \\ & y^{2}+y+k=q r . \end{aligned} $$  From $p<q<r$ we can see that $0 \leqslant x<y \leqslant r-1$. The numbers $x, y$ are the two solutions of (1); by Vieta's formulas, we should have $x+y \equiv-1(\bmod r)$, so $x+y=r-1$.  Letting $K=4 k-1, X=2 x+1$, and $Y=2 y+1$, we obtain  $$ \begin{gathered} 4 p r=X^{2}+K \\ 4 q r=Y^{2}+K \end{gathered} $$  with $X+Y=2 r$. Multiplying the two above equations,  $$ \begin{aligned} 16 p q r^{2} & =\left(X^{2}+K\right)\left(Y^{2}+K\right) \\ & =(X Y-K)^{2}+K(X+Y)^{2} \\ & =(X Y-K)^{2}+4 K r^{2}, \\ 4 p q & =\left(\frac{X Y-K}{2 r}\right)^{2}+K . \end{aligned} $$  In particular, the number $Z=\frac{X Y-K}{2 r}$ should be an integer, and so $4 p q=Z^{2}+K$. By parity, $Z$ is odd, and thus  $$ p q=z^{2}+z+k \quad \text { where } z=\frac{Z-1}{2} $$  so $\{p, q\}$ is special.  Proof 2. As before, we suppose that  $$ \begin{aligned} & x^{2}+x+k=p r \\ & y^{2}+y+k=q r . \end{aligned} $$  Subtracting, we have  $$ (x+y+1)(x-y)=r(p-q) . $$  As before, we have $x+y=r-1$, so $x-y=p-q$, and  $$ \begin{aligned} & x=\frac{1}{2}(r+p-q-1) \\ & y=\frac{1}{2}(r+q-p-1) \end{aligned} $$  Then,  $$ \begin{aligned} k=p r-x^{2}-x & =\frac{1}{4}\left(4 p r-(r+p-q-1)^{2}-2(r+p-q-1)\right) \\ & =\frac{1}{4}\left(4 p r-(r+p-q)^{2}+1\right) \\ & =\frac{1}{4}\left(2 p q+2 p r+2 q r-p^{2}-q^{2}-r^{2}+1\right), \end{aligned} $$  which is symmetric in $p, q, r$, so  $$ p q=z^{2}+z+k \quad \text { where } z=\frac{1}{2}(p+q-r-1) $$  and $\{p, q\}$ is special. Now we settle the problem by induction on $|S|$, with $|S| \leqslant 3$ clear. Suppose we have proven it for $|S|=n$ and consider $|S|=n+1$. Let $r$ be the largest prime in $S$; the claim tells us that in any valid cycle of primes:  - the neighbors of $r$ are uniquely determined, and - removing $r$ from the cycle results in a smaller valid cycle.  It follows that there is at most one valid cycle, completing the inductive step. Comment. The statement is not as inapplicable as it might seem. For example, for $k=41$, the following 385 primes form a valid cycle of primes:  53, 4357, 104173, 65921, 36383, 99527, 193789, 2089123, 1010357, 2465263, 319169, 15559, 3449, 2647, 1951, 152297, 542189, 119773, 91151, 66431, 222137, 1336799, 469069, 45613, 1047941, 656291, 355867, 146669, 874879, 2213327, 305119, 3336209, 1623467, 520963, 794201, 1124833, 28697, 15683, 42557, 6571, 39607, 1238833, 835421, 2653681, 5494387, 9357539, 511223, 1515317, 8868173, 114079681, 59334071, 22324807, 3051889, 5120939, 7722467, 266239, 693809, 3931783, 1322317, 100469, 13913, 74419, 23977, 1361, 62983, 935021, 512657, 1394849, 216259, 45827, 31393, 100787, 1193989, 600979, 209543, 357661, 545141, 19681, 10691, 28867, 165089, 2118023, 6271891, 12626693, 21182429, 1100467, 413089, 772867, 1244423, 1827757, 55889, 1558873, 5110711, 1024427, 601759, 290869, 91757, 951109 , 452033, 136471, 190031, 4423, 9239, 15809, 24133, 115811, 275911, 34211, 877, 6653, 88001, 46261, 317741, $121523,232439,379009,17827,2699,15937,497729,335539,205223,106781,1394413,4140947,8346383,43984757$, 14010721, 21133961, 729451, 4997297, 1908223, 278051, 529747, 40213, 768107, 456821, 1325351, 225961, 1501921, 562763, 75527, 5519, 9337, 14153, 499, 1399, 2753, 14401, 94583, 245107, 35171, 397093, 195907, 2505623, 34680911, 18542791, 7415917, 144797293, 455529251, 86675291, 252704911, 43385123, 109207907, 204884269, 330414209, 14926789, 1300289, 486769, 2723989, 907757, 1458871, 65063, 4561, 124427, 81343, 252887, 2980139, 1496779, 3779057, 519193, 47381, 135283, 268267, 446333, 669481, 22541, 54167, 99439, 158357, 6823, 32497, 1390709, 998029, 670343, 5180017, 13936673, 2123491, 4391941, 407651, 209953, 77249, 867653, 427117, 141079, 9539, 227, 1439 , 18679, 9749, 25453, 3697, 42139, 122327, 712303, 244261, 20873, 52051, 589997, 4310569, 1711069, 291563, 3731527 , 11045429, 129098443, 64620427, 162661963, 22233269, 37295047, 1936969, 5033449, 725537, 1353973, 6964457, 2176871, 97231, 7001, 11351, 55673, 16747, 169003, 1218571, 479957, 2779783, 949609, 4975787, 1577959, 2365007, 3310753, 79349, 23189, 107209, 688907, 252583, 30677, 523, 941, 25981, 205103, 85087, 1011233, 509659, 178259, 950479, 6262847, 2333693, 305497, 3199319, 9148267, 1527563, 466801, 17033, 9967, 323003, 4724099, 14278309, 2576557, 1075021, 6462593, 2266021, 63922471, 209814503, 42117791, 131659867, 270892249, 24845153, 12104557, 3896003, 219491, 135913, 406397, 72269, 191689, 2197697, 1091273, 2727311, 368227, 1911661, 601883, 892657, 28559, 4783, 60497, 31259, 80909, 457697, 153733, 11587, 1481, 26161, 15193, 7187, 2143, 21517, 10079, 207643, 1604381, 657661, 126227, 372313, 2176331, 748337, 64969, 844867, 2507291, 29317943, 14677801, 36952793, 69332267, 111816223, 5052241, 8479717, 441263, 3020431, 1152751, 13179611, 38280013, 6536771, 16319657, 91442699 , 30501409, 49082027, 72061511, 2199433, 167597, 317963, 23869, 2927, 3833, 17327, 110879, 285517, 40543, 4861, 21683, 50527, 565319, 277829, 687917, 3846023, 25542677, 174261149, 66370753, 9565711, 1280791, 91393, 6011, 7283, 31859, 8677, 10193, 43987, 11831, 13591, 127843, 358229, 58067, 15473, 65839, 17477, 74099, 19603, 82847, 21851, 61.


Prove that $5^{n}-3^{n}$ is not divisible by $2^{n}+65$ for any positive integer $n$.  (Belgium)

Solution: Let $n$ be a positive integer, and let $m=2^{n}+65$. For the sake of contradiction, suppose that $m \mid 5^{n}-3^{n}$, so $5^{n} \equiv 3^{n}(\bmod m)$.  Notice that if $n$ is even, then $3 \mid m$, but $3 \nmid 5^{n}-3^{n}$, contradiction. So, from now on we assume that $n$ is odd, $n=2 k+1$. Obviously $n=1$ is not possible, so $n \geqslant 3$. Notice that $m$ is coprime to 2,3 and 5 .  Let $m_{1}$ be the smallest positive multiple of $m$ that can be written in the form of either $\left|5 a^{2}-3 b^{2}\right|$ or $\left|a^{2}-15 b^{2}\right|$ with some integers $a$ and $b$. Note that $5^{n}-3^{n}=5\left(5^{k}\right)^{2}-3\left(3^{k}\right)^{2}$ is a multiple of $m$, so the set of such multiples is non-empty, and therefore $m_{1}$ is well-defined. I. First we show that $m_{1} \leqslant 5 m$. Consider the numbers  $$ 5^{k+1} x+3^{k+1} y, \quad 0 \leqslant x, y \leqslant \sqrt{m} $$  There are $|\sqrt{m}|+1>\sqrt{m}$ choices for $x$ and $y$, so there are more than $m$ possible pairs $(x, y)$. Hence, two of these sums are congruent modulo $m$ : $5^{k+1} x_{1}+3^{k+1} y_{1} \equiv 5^{k+1} x_{2}+3^{k+1} y_{2}(\bmod m)$.  Now choose $a=x_{1}-x_{2}$ and $b=y_{1}-y_{2}$; at least one of $a, b$ is nonzero, and  $$ 5^{k+1} a+3^{k+1} b \equiv 0 \quad(\bmod m), \quad|a|,|b| \leqslant \sqrt{m} $$  From  $$ 0 \equiv\left(5^{k+1} a\right)^{2}-\left(3^{k+1} b\right)^{2}=5^{n+1} a^{2}-3^{n+1} b^{2} \equiv 5 \cdot 3^{n} a^{2}-3^{n+1} b^{2}=3^{n}\left(5 a^{2}-3 b^{2}\right) \quad(\bmod m) $$  we can see that $\left|5 a^{2}-3 b^{2}\right|$ is a multiple of $m$. Since at least one of $a$ and $b$ is nonzero, $5 a^{2} \neq 3 b^{2}$. Hence, by the choice of $a, b$, we have $0<\left|5 a^{2}-3 b^{2}\right| \leqslant \max \left(5 a^{2}, 3 b^{2}\right) \leqslant 5 m$. That shows that $m_{1} \leqslant 5 m$. II. Next, we show that $m_{1}$ cannot be divisible by 2,3 and 5 . Since $m_{1}$ equals either $\left|5 a^{2}-3 b^{2}\right|$ or $\left|a^{2}-15 b^{2}\right|$ with some integers $a, b$, we have six cases to check. In all six cases, we will get a contradiction by presenting another multiple of $m$, smaller than $m_{1}$.  - If $5 \mid m_{1}$ and $m_{1}=\left|5 a^{2}-3 b^{2}\right|$, then $5 \mid b$ and $\left|a^{2}-15\left(\frac{b}{5}\right)^{2}\right|=\frac{m_{1}}{5}<m_{1}$. - If $5 \mid m_{1}$ and $m_{1}=\left|a^{2}-15 b^{2}\right|$, then $5 \mid a$ and $\left|5\left(\frac{a}{5}\right)^{2}-3 b^{2}\right|=\frac{m_{1}}{5}<m_{1}$. - If $3 \mid m_{1}$ and $m_{1}=\left|5 a^{2}-3 b^{2}\right|$, then $3 \mid a$ and $\left|b^{2}-15\left(\frac{a}{3}\right)^{2}\right|=\frac{m_{1}}{3}<m_{1}$. - If $3 \mid m_{1}$ and $m_{1}=\left|a^{2}-15 b^{2}\right|$, then $3 \mid a$ and $\left|5 b^{2}-3\left(\frac{a}{3}\right)^{2}\right|=\frac{m_{1}}{3}<m_{1}$. - If $2 \mid m_{1}$ and $m_{1}=\left|5 a^{2}-3 b^{2}\right|$, then $\left|\left(\frac{5 a-3 b}{2}\right)^{2}-15\left(\frac{a-b}{2}\right)^{2}\right|=\frac{m_{1}}{2}<m_{1}$. - If $2 \mid m_{1}$ and $m_{1}=\left|a^{2}-15 b^{2}\right|$, then $\left|5\left(\frac{a-3 b}{2}\right)^{2}-3\left(\frac{a-5 b}{2}\right)^{2}\right|=\frac{m_{1}}{2}<m_{1}$. (The last two expressions can be obtained from $(\sqrt{5} a+\sqrt{3} b)(\sqrt{5}-\sqrt{3})=(5 a-3 b)+\sqrt{15}(b-a)$ and $(a+\sqrt{15} b)(\sqrt{5}-\sqrt{3})=\sqrt{5}(a-3 b)+\sqrt{3}(5 b-a)$.  In all six cases, we found that either $\frac{m_{1}}{2}, \frac{m_{1}}{3}$ or $\frac{m_{1}}{5}$ is of the form $\left|5 x^{2}-3 y^{2}\right|$ or $\left|x^{2}-15 y^{2}\right|$. Since $m$ is coprime to 2,3 and 5 , the presented number is a multiple of $m$, but this contradicts the minimality of $m_{1}$. III. The last remaining case is $m_{1}=m$, so either $m=\left|5 a^{2}-3 b^{2}\right|$ or $m=\left|a^{2}-15 b^{2}\right|$. We will get a contradiction by considering the two sides modulo 3,4 and 5 .  - $2^{n}+65=5 a^{2}-3 b^{2}$ is not possible, because $2^{n}+65 \equiv 1(\bmod 3)$, but $5 a^{2}-3 b^{2} \not \equiv 1$ $(\bmod 3)$. - $2^{n}+65=3 b^{2}-5 a^{2}$ is not possible, because $2^{n}+65 \equiv 1(\bmod 4)$, but $3 b^{2}-5 a^{2} \not \equiv 1$ $(\bmod 4)$. - $2^{n}+65=a^{2}-15 b^{2}$ is not possible, because $2^{n}+65 \equiv \pm 2(\bmod 5)$, but $a^{2}-15 b^{2} \not \equiv \pm 2$ $(\bmod 5)$. - $2^{n}+65=15 b^{2}-a^{2}$ is not possible, because $2^{n}+65 \equiv 1(\bmod 4)$, but $15 b^{2}-a^{2} \not \equiv 1$ $(\bmod 4)$.  We found a contradiction in all cases, that completes the solution. Comment 1. Part I is a standard application of Thue's lemma: Lemma (Thue). Suppose that $m>1$ and $c$ are integers, and $X, Y$ are positive integers such that $X \leqslant m<X Y$. Then there exist some integers $x, y$ with $|x|<X$ and $0<y<Y$, such that $x \equiv c y(\bmod m)$.  It is a well-known corollary that if $c, d$ are coprime to $m$, the congruence $c x^{2} \equiv d y^{2}(\bmod m)$ has a solution such that $x, y$ are coprime to $m$, and $X, Y$ are positive integers such that $X Y>m$, then $c x^{2} \equiv d y^{2}(\bmod m)$ has a solution such that at least one of $x, y$ is nonzero, $|x|<X$ and $|y|<Y$.  In the solution we applied this corollary with $c=5, d=3, X=Y=\lfloor\sqrt{m}\rfloor+1$. Comment 2. In fact, we proved that a positive integer $m$ with $m \equiv 13$ or $37(\bmod 60)$ cannot divide any nonzero integer of the form $5 a^{2}-3 b^{2}$ or $a^{2}-15 b^{2}$ with coprime integers $a, b$. In other words, if $m \equiv 13$ or $37(\bmod 60)$, then 15 is not a quadratic residue modulo $m$. Using the tools of quadratic reciprocity, the solution can be significantly shortened.  Suppose that $a$ and $b$ are coprime. For every prime divisor $p>5$ of $5 a^{2}-3 b^{2}$ or $a^{2}-15 b^{2}$, we have  $$ 1=\left(\frac{15}{p}\right)=\left(\frac{3}{p}\right)\left(\frac{5}{p}\right)=(-1)^{\frac{p-1}{2}}\left(\frac{p}{3}\right)\left(\frac{p}{5}\right) $$  where $\left(\frac{a}{p}\right)$ stands for the Legendre symbol. Considering the remainders of $p$ when divided by 4,3 and 5, (1) leads to  $$ p \equiv \pm 1, \pm 7, \pm 11 \text { or } \pm 17 \bmod 60 $$  These remainders form a subgroup of the reduced remainders modulo 60. Since 13 and 37 are not elements in this subgroup, the number $m=2^{n}+65$ cannot be a product of such primes.  Instead of handling the prime divisors of $m$ separately, we can use Jacobi symbols for further simplification, as shown in the next solution.


Solution: Suppose again that $5^{n} \equiv 3^{n}\left(\bmod m=2^{n}+65\right)$. Like in the first solution, we conclude that $n$ must be odd, and $n \geqslant 3$, so $8 \mid 2^{n}$.  Using Jacobi symbols,  $$ -1=\left(\frac{2^{n}+65}{5}\right)=\left(\frac{5}{2^{n}+65}\right)=\left(\frac{5^{n}}{2^{n}+65}\right)=\left(\frac{3^{n}}{2^{n}+65}\right)=\left(\frac{3}{2^{n}+65}\right)=\left(\frac{2^{n}+65}{3}\right)=1 $$  contradiction.  ## -  ![](https://cdn.mathpix.com/cropped/2024_11_18_86efb4389f14b52b08e1g-75.jpg?height=98&width=726&top_left_y=279&top_left_x=114)  +     -   \$4=4 \times 1.20\$1 ![](https://cdn.mathpix.com/cropped/2024_11_18_86efb4389f14b52b08e1g-75.jpg?height=84&width=889&top_left_y=1990&top_left_x=379) Cly D - 1 vaiv ![](https://cdn.mathpix.com/cropped/2024_11_18_86efb4389f14b52b08e1g-75.jpg?height=58&width=116&top_left_y=2247&top_left_x=536) +1N ![](https://cdn.mathpix.com/cropped/2024_11_18_86efb4389f14b52b08e1g-75.jpg?height=135&width=646&top_left_y=2301&top_left_x=348)![](https://cdn.mathpix.com/cropped/2024_11_18_86efb4389f14b52b08e1g-75.jpg?height=1874&width=164&top_left_y=419&top_left_x=1607) ![](https://cdn.mathpix.com/cropped/2024_11_18_86efb4389f14b52b08e1g-75.jpg?height=130&width=432&top_left_y=1647&top_left_x=0) r / A M - 18 ![](https://cdn.mathpix.com/cropped/2024_11_18_86efb4389f14b52b08e1g-75.jpg?height=73&width=652&top_left_y=2395&top_left_x=139) ![](https://cdn.mathpix.com/cropped/2024_11_18_86efb4389f14b52b08e1g-75.jpg?height=58&width=637&top_left_y=2447&top_left_x=154) A ..... ![](https://cdn.mathpix.com/cropped/2024_11_18_86efb4389f14b52b08e1g-75.jpg?height=75&width=415&top_left_y=2501&top_left_x=148) ![](https://cdn.mathpix.com/cropped/2024_11_18_86efb4389f14b52b08e1g-75.jpg?height=61&width=452&top_left_y=2539&top_left_x=605) ![](https://cdn.mathpix.com/cropped/2024_11_18_86efb4389f14b52b08e1g-75.jpg?height=75&width=532&top_left_y=2587&top_left_x=599)