diff --git "a/Balkan_Shortlist/md/en-2021_bmo_shortlist.md" "b/Balkan_Shortlist/md/en-2021_bmo_shortlist.md" new file mode 100644--- /dev/null +++ "b/Balkan_Shortlist/md/en-2021_bmo_shortlist.md" @@ -0,0 +1,1677 @@ +# 38th Balkan Mathematical Olympiad + +![](https://cdn.mathpix.com/cropped/2024_12_07_557efa8b80873b479030g-01.jpg?height=253&width=933&top_left_y=550&top_left_x=576) + +38th Balkan Mathematical Olympiad + +## Shortlisted Problems with Solutions + +September 6 - 10 2021, Cyprus + +## The shortlisted problems should be kept strictly confidential until BMO 2022 + +## Contributing countries + +The Organising Committee and the Problem Selection Committee of the BMO 2021 wish to thank the following countries for contributing problem proposals: + +- Azerbaijan +- Bulgaria +- Greece +- North Macedonia +- Romania +- Serbia +- United Kingdom +- Uzbekistan + + +## Problem Selection Committee + +Chairman: Demetres Christofides +Members: Demetris Karantanos +Stelios Kouzaris +Theoklitos Parayiou +Stelios Stylianou +Marios Voskou + +## Contents + +PROBLEMS ..... 3 +Algebra ..... 3 +Combinatorics ..... 4 +Geometry ..... 6 +Number Theory ..... 8 +SOLUTIONS ..... 9 +Algebra ..... 9 +A1 ..... 9 +A2 ..... 10 +A3 ..... 11 +A4 ..... 13 +A5 ..... 15 +A6 ..... 17 +Combinatorics ..... 20 +C1 ..... 20 +C2 ..... 22 +C3 ..... 23 +C4 ..... 25 +C5 ..... 27 +C6 ..... 29 +Geometry ..... 31 +G1 ..... 31 +G2 ..... 33 +G3 ..... 34 +G4 ..... 36 +G5 ..... 38 +G6 ..... 40 +G7 ..... 42 +G8 ..... 44 +Number Theory ..... 46 +N1 ..... 46 +N2 ..... 47 +N3 ..... 48 +N4 ..... 49 +N5 ..... 50 +N6 ..... 53 +N7 ..... 54 + +## PROBLEMS + +## ALGEBRA + +A1. Find all functions $f: \mathbb{R}^{+} \rightarrow \mathbb{R}$ and $g: \mathbb{R}^{+} \rightarrow \mathbb{R}$ such that + +$$ +f\left(x^{2}+y^{2}\right)=g(x y) +$$ + +holds for all $x, y \in \mathbb{R}^{+}$. + +A2. Find all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ such that + +$$ +f\left(x^{2}+y\right) \geqslant\left(\frac{1}{x}+1\right) f(y) +$$ + +holds for all $x \in \mathbb{R} \backslash\{0\}$ and all $y \in \mathbb{R}$. + +A3. Find all functions $f: \mathbb{R}^{+} \rightarrow \mathbb{R}^{+}$such that + +$$ +f(x+f(x)+f(y))=2 f(x)+y +$$ + +holds for all $x, y \in \mathbb{R}^{+}$. + +A4. Let $f, g$ be functions from the positive integers to the integers. Vlad the impala is jumping around the integer grid. His initial position is $\mathbf{x}_{0}=(0,0)$, and for every $n \geqslant 1$, his jump is + +$$ +\mathbf{x}_{n}-\mathbf{x}_{n-1}=( \pm f(n), \pm g(n)) \text { or }( \pm g(n), \pm f(n)) +$$ + +with eight possibilities in total. Is it always possible that Vlad can choose his jumps to return to his initial location $(0,0)$ infinitely many times when +(a) $f, g$ are polynomials with integer coefficients? +(b) $f, g$ are any pair of functions from the positive integers to the integers? + +A5. Find all functions $f: \mathbb{R}^{+} \longrightarrow \mathbb{R}^{+}$such that + +$$ +f(x f(x+y))=y f(x)+1 +$$ + +holds for all $x, y \in \mathbb{R}^{+}$. + +A6. Find all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ such that + +$$ +f(x y)=f(x) f(y)+f(f(x+y)) +$$ + +holds for all $x, y \in \mathbb{R}$. + +## COMBINATORICS + +C1. Let $\mathcal{A}_{n}$ be the set of $n$-tuples $x=\left(x_{1}, \ldots, x_{n}\right)$ with $x_{i} \in\{0,1,2\}$. A triple $x, y, z$ of distinct elements of $\mathcal{A}_{n}$ is called good if there is some $i$ such that $\left\{x_{i}, y_{i}, z_{i}\right\}=\{0,1,2\}$. A subset $A$ of $\mathcal{A}_{n}$ is called good if every three distinct elements of $A$ form a good triple. +Prove that every good subset of $\mathcal{A}_{n}$ has at most $2\left(\frac{3}{2}\right)^{n}$ elements. + +C2. Let $K$ and $N>K$ be fixed positive integers. Let $n$ be a positive integer and let $a_{1}, a_{2}, \ldots, a_{n}$ be distinct integers. Suppose that whenever $m_{1}, m_{2}, \ldots, m_{n}$ are integers, not all equal to 0 , such that $\left|m_{i}\right| \leqslant K$ for each $i$, then the sum + +$$ +\sum_{i=1}^{n} m_{i} a_{i} +$$ + +is not divisible by $N$. What is the largest possible value of $n$ ? + +C3. In an exotic country, the National Bank issues coins that can take any value in the interval $[0,1]$. Find the smallest constant $c>0$ such that the following holds, no matter the situation in that country: + +Any citizen of the exotic country that has a finite number of coins, with a total value of no more than 1000, can split those coins into 100 boxes, such that the total value inside each box is at most $c$. + +C4. A sequence of $2 n+1$ non-negative integers $a_{1}, a_{2}, \ldots, a_{2 n+1}$ is given. There's also a sequence of $2 n+1$ consecutive cells enumerated from 1 to $2 n+1$ from left to right, such that initially the number $a_{i}$ is written on the $i$-th cell, for $i=1,2, \ldots 2 n+1$. Starting from this initial position, we repeat the following sequence of steps, as long as it's possible: + +Step 1: Add up the numbers written on all the cells, denote the sum as $s$. +Step 2: If $s$ is equal to 0 or if it is larger than the current number of cells, the process terminates. Otherwise, remove the $s$-th cell, and shift all cells that are to the right of it one position to the left. Then go to Step 1. + +Example: $(1,0,1, \underline{2}, 0) \rightarrow(1, \underline{0}, 1,0) \rightarrow(1, \underline{1}, 0) \rightarrow(\underline{1}, 0) \rightarrow(0)$. +A sequence $a_{1}, a_{2}, \ldots, a_{2 n+1}$ of non-negative integers is called balanced, if at the end of this process there's exactly one cell left, and it's the cell that was initially enumerated by $(n+1)$, i.e. the cell that was initially in the middle. + +Find the total number of balanced sequences as a function of $n$. + +C5. Angel has a warehouse, which initially contains 100 piles of 100 pieces of rubbish each. Each morning, Angel either clears every piece of rubbish from a single pile, or one piece of rubbish from each pile. However, every evening, a demon sneaks into the warehouse and adds one piece of rubbish to each non-empty pile, or creates a new pile with one piece. What is the first morning when Angel can guarantee to have cleared all the rubbish from the warehouse? + +C6. There is a population $P$ of 10000 bacteria, some of which are friends (friendship is mutual), so that each bacterion has at least one friend and if we wish to assign to each bacterion a coloured membrane so that no two friends have the same colour, then there is a way to do it with 2021 colours, but not with 2020 or less. + +Two friends $A$ and $B$ can decide to merge in which case they become a single bacterion whose friends are precisely the union of friends of $A$ and $B$. (Merging is not allowed if $A$ and $B$ are not friends.) It turns out that no matter how we perform one merge or two consecutive merges, in the resulting population it would be possible to assign 2020 colours or less so that no two friends have the same colour. Is it true that in any such population $P$ every bacterium has at least 2021 friends? + +## GEOMETRY + +G1. Let $A B C$ be a triangle with $A BA B$ and circumcircle $\Gamma$. The tangent from $A$ to $\Gamma$ intersects $B C$ at $T$. Let $M$ be the midpoint of $B C$ and let $R$ be the reflection of $A$ in $B$. Let $S$ be a point so that $S A B T$ is a parallelogram and finally let $P$ be a point on line $S B$ such that $M P$ is parallel to $A B$. + +Given that $P$ lies on $\Gamma$, prove that the circumcircle of $\triangle S T R$ is tangent to line $A C$. + +G6. Let $A B C$ be an acute triangle such that $A B0$, then letting $n$ tend to infinity we obtain a contradiction. (E.g. taking $n>$ $f(y+1) / f(y)$ we get $f(y+1) \geqslant(n+1)^{n^{2}} f(y) \geqslant(n+1) f(y)>f(y+1)$, a contradiction.) +So $f(x)=0$ for every $x \in \mathbb{R}$. + +A3. Find all functions $f: \mathbb{R}^{+} \rightarrow \mathbb{R}^{+}$such that + +$$ +f(x+f(x)+f(y))=2 f(x)+y +$$ + +holds for all $x, y \in \mathbb{R}^{+}$. + +## Proposed by Greece + +Solution 1. We will show that $f(x)=x$ for every $x \in \mathbb{R}^{+}$. It is easy to check that this function satisfies the equation. + +We write $P(x, y)$ for the assertion that $f(x+f(x)+f(y))=2 f(x)+y$. +We first show that $f$ is injective. So assume $f(a)=f(b)$. Now $P(1, a)$ and $P(1, b)$ show that + +$$ +2 f(1)+a=f(1+f(1)+f(a))=f(1+f(1)+f(b))=2 f(1)+b +$$ + +and therefore $a=b$. +Let $A=\left\{x \in \mathbb{R}^{+}: f(x)=x\right\}$. It is enough to show that $A=\mathbb{R}^{+}$. +$P(x, x)$ shows that $x+2 f(x) \in A$ for every $x \in \mathbb{R}^{+}$. Now $P(x, x+2 f(x))$ gives that + +$$ +f(2 x+3 f(x))=x+4 f(x) +$$ + +for every $x \in \mathbb{R}^{+}$. Therefore $P(x, 2 x+3 f(x))$ gives that $2 x+5 f(x) \in A$ for every $x \in \mathbb{R}^{+}$. +Suppose $x, y \in \mathbb{R}^{+}$such that $x, 2 x+y \in A$. Then $P(x, y)$ gives that + +$$ +f(2 x+f(y))=f(x+f(x)+f(y))=2 f(x)+y=2 x+y=f(2 x+y) +$$ + +and by the injectivity of $f$ we have that $2 x+f(y)=2 x+y$. We conlude that $y \in A$ as well. +Now since $x+2 f(x) \in A$ and $2 x+5 f(x)=2(x+2 f(x))+f(x) \in A$ we deduce that $f(x) \in A$ for every $x \in \mathbb{R}^{+}$. I.e. $f(f(x))=f(x)$ for every $x \in \mathbb{R}^{+}$. + +By injectivity of $f$ we now conclude that $f(x)=x$ for every $x \in \mathbb{R}^{+}$. + +Solution 2. As in Solution $1, f$ is injective. Furthermore, letting $m=2 f(1)$ we have that the image of $f$ contains $(m, \infty)$. Indeed, if $t>m$, say $t=m+y$ for some $y>0$, then $P(1, y)$ shows that $f(1+f(1)+f(y))=t$. + +Let $a, b \in \mathbb{R}$. We will show that $f(a)-a=f(b)-b$. Define $c=2 f(a)-2 f(b)$ and $d=$ $a+f(a)-b-f(b)$. It is enough to show that $c=d$. By interchanging the roles of $a$ and $b$ in necessary, we may assume that $d \geqslant 0$. + +From $P(a, y)$ and $P(b, y)$, after subtraction, we get + +$$ +f(a+f(a)+f(y))-f(b+f(b)+f(y))=2 f(a)-2 f(b)=c . +$$ + +so for any $t>m$ (picking $y$ such that $f(y)=t$ in (1)) we get + +$$ +f(a+f(a)+t)-f(b+f(b)+t)=2 f(a)-2 f(b)=c . +$$ + +Now for any $z>m+b+f(b)$, taking $t=z-b-f(b)$ in (2) we get + +$$ +f(z+d)-f(z)=c +$$ + +Now for any $x>m+b+f(b)$ from (3) we get that + +$$ +2 f(x+d)+y=2 f(x)+y+2 c . +$$ + +Also, for any $x$ large enough, $(x>\max \{m+b+f(b), m+b+f(b)+c-d\}$ will do), by repeated application of (3), we have + +$$ +\begin{aligned} +f(x+d+f(x+d)+f(y)) & =f(x+f(x+d)+y)+c \\ +& =f(x+f(x)+y+c)+c \\ +& =f(x+f(x)+y+c-d)+2 c . +\end{aligned} +$$ + +(In the first equality we applied (3) with $z=x+f(x+d)+y>x>m+b+f(b)$, in the second with $z=x>m+b+f(b)$ and in the third with $z=x+f(x)+y-c+d>x+c-d>m+b+f(b)$. +In particular, now $P(x+d, y)$ implies that + +$$ +f(x+f(x)+y+c-d)=2 f(x)+y=f(x+f(x)+y) +$$ + +for every large enough $x$. By injectivity of $f$ we deduce that $x+f(x)+y+c-d=x+f(x)+y$ and therefore $c=d$ as required. + +It now follows that $f(x)=x+k$ for every $x \in \mathbb{R}^{+}$and some fixed constant $k$. Substituting in the initial equation we get $k=0$. + +A4. Let $f, g$ be functions from the positive integers to the integers. Vlad the impala is jumping around the integer grid. His initial position is $\mathbf{x}_{0}=(0,0)$, and for every $n \geqslant 1$, his jump is + +$$ +\mathbf{x}_{n}-\mathbf{x}_{n-1}=( \pm f(n), \pm g(n)) \text { or }( \pm g(n), \pm f(n)) +$$ + +with eight possibilities in total. Is it always possible that Vlad can choose his jumps to return to his initial location $(0,0)$ infinitely many times when +(a) $f, g$ are polynomials with integer coefficients? +(b) $f, g$ are any pair of functions from the positive integers to the integers? + +## Proposed by United Kingdom + +## Solution 1. + +(a) Yes it is always possible. The key idea is the following: Let $b(n)$ be the number of 1 's in the binary expansion of $n=0,1,2, \ldots$. + +Lemma: Given a polynomial $f$ with integer coefficients and degree at most $d$, then + +$$ +\sum_{k=0}^{2^{d+1}-1}(-1)^{b(k)} f(n+k)=f(n)-f(n+1)-f(n+2)+\cdots \pm f\left(n+\left(2^{d+1}-1\right)\right)=0 +$$ + +Proof of Lemma: The result is clear for $d=0$. For $d \geqslant 1$, we have + +$$ +\sum_{k=0}^{2^{d+1}-1}(-1)^{b(k)} f(n+k)=\sum_{k=0}^{2^{d}-1}(-1)^{b(k)}\left[f(n+k)-f\left(n+k+2^{d}\right)\right] . +$$ + +So set $\tilde{f}(n)=f(n)-f\left(n+2^{d}\right)$, which is a polynomial of degree at most $d-1$. Then + +$$ +\sum_{k=0}^{2^{d+1}-1}(-1)^{b(k)} f(n+k)=\sum_{k=0}^{2^{d}-1} \tilde{f}(n+k)=0 +$$ + +by induction, completing the proof of the lemma. +In particular, if we take + +$$ +\mathbf{x}_{n}-\mathbf{x}_{n-1}=\left((-1)^{b(n)} f(n),(-1)^{b(n)} g(n)\right), +$$ + +then $\mathbf{x}_{D}=\mathbf{0}$ whenever $D$ is a multiple of $2^{1+\max (\operatorname{deg}(f), \operatorname{deg}(g))}$. +(b) No, it is not always possible. Let $g$ be any suitable function. Then, we construct $f$ inductively. There are at most $8^{n-1}$ possibilities for $\mathbf{x}_{n-1}$, so choose $f(n)$ to be greater than the magnitude of all of them. Consequently $\mathbf{x}_{n}$ cannot be $\mathbf{0}$. + +## Solution 2. + +(a) Given a polynomial $f$ of degree at most $d$ and integers $n, r$, we claim that + +$$ +\sum_{k=0}^{2^{d+1}-1} \varepsilon_{k} f\left(2^{d} n+r+k\right)=0 +$$ + +for some choice of $\varepsilon_{0}, \varepsilon_{1}, \ldots, \varepsilon_{2^{d+1}-1} \in\{-1,1\}$. (Which are allowed to depend on $d$ and f.) + +We proceed by induction on $d$, the case $d=0$ being immediate. For the inductive step we define the polynomial $g(n)=f(2 n+r+1)-f(2 n+r)$ which is a polynomial of degree at most $d-1$. Then + +$$ +\sum_{k=0}^{2^{d}-1} \varepsilon_{k} g\left(2^{d-1} n+k\right)=0 +$$ + +for some choice of the $\varepsilon_{k}$ 's giving + +$$ +\sum_{k=0}^{2^{d+1}-1} \varepsilon_{k}^{\prime} f\left(2^{d} n+r+k\right)=0 +$$ + +where $\varepsilon_{2 k}^{\prime}=-\varepsilon_{k}$ and $\varepsilon_{2 k+1}^{\prime}=\varepsilon_{k}$. This completes the proof of the claim. +Now the proof can be completed as in Solution 1. +(b) Apart from magnitude arguments, one could also use modulo arguments. For example, taking $f(0), g(0)$ to be odd and $f(n), g(n)$ to be even for every $n \geqslant 1$ works. + +## Comments. + +(1) We propose to omit part (b) as it is easy and furthermore it suggests that the answer to (a) is most likely affirmative. +(2) Giving a precise self-contained characterisation of $b(n)$ in Solution 1 is not necessary for the lemma. It could instead be phrased as: +There exists a sequence $\beta(k) \in\{-1,+1\}^{\mathbb{N}}$ such that $\sum \beta(k) f(n+k)=0$. +Then, one constructs $\beta(\cdot)$ inductively as part of the proof via $\beta\left(k+2^{d}\right)=-\beta(k)$ for $k<2^{d}$, which coincides with the original definition, ie $\beta(\cdot)=(-1)^{b(\cdot)}$. +(3) The sequence of signs in both solutions are essentially the same. (Either all signs exactly the same or all signs different.) + +A5. Find all functions $f: \mathbb{R}^{+} \longrightarrow \mathbb{R}^{+}$such that + +$$ +f(x f(x+y))=y f(x)+1 +$$ + +holds for all $x, y \in \mathbb{R}^{+}$. + +## Proposed by North Macedonia + +Solution 1. We will show that that $f(x)=\frac{1}{x}$ for every $x \in \mathbb{R}^{+}$. It is easy to check that this function satisfies the equation. + +We write $P(x, y)$ for the assertion that $f(x f(x+y))=y f(x)+1$. +We first show that $f$ is injective. So assume $f\left(x_{1}\right)=f\left(x_{2}\right)$ and take any $x1$ there is an $x$ such that $f(x)=z$. Indeed $P\left(x, \frac{z-1}{f(x)}\right)$ gives that + +$$ +f\left(x f\left(x+\frac{z-1}{f(x)}\right)\right)=z . +$$ + +Now given $z>1$, take $x$ such that $f(x)=z$. Then $P\left(x, \frac{z-1}{z}\right)$ gives + +$$ +f\left(x f\left(x+\frac{z-1}{z}\right)\right)=\frac{z-1}{z} f(x)+1=z=f(x) . +$$ + +Since $f$ is injective, we deduce that $f\left(x+\frac{z-1}{z}\right)=1$. +So there is a $k \in \mathbb{R}^{+}$such that $f(k)=1$. Since $f$ is injective this $k$ is unique. Therefore $x=k+\frac{1}{z}-1$. I.e. for every $z>1$ we have + +$$ +f\left(k+\frac{1}{z}-1\right)=z +$$ + +We must have $k+\frac{1}{z}-1 \in \mathbb{R}^{+}$for each $z>1$ and taking the limit as $z$ tends to infinity we deduce that $k \geqslant 1$. (Without mentioning limits, assuming for contradiction that $k<1$, taking $z=\frac{2}{1-k}$ leads to a contradiction.) Set $r=k-1$. + +Now $P\left(r+\frac{1}{6}, \frac{1}{3}\right)$ gives + +$$ +f\left(\left(r+\frac{1}{6}\right) f\left(r+\frac{1}{6}+\frac{1}{3}\right)\right)=\frac{1}{3} f\left(r+\frac{1}{6}\right)+1=\frac{6}{3}+1=3=f\left(r+\frac{1}{3}\right) . +$$ + +But + +$$ +f\left(\left(r+\frac{1}{6}\right) f\left(r+\frac{1}{6}+\frac{1}{3}\right)\right)=f\left(\left(r+\frac{1}{6}\right) f\left(r+\frac{1}{2}\right)\right)=f\left(2 r+\frac{1}{3}\right) . +$$ + +The injectivity of $f$ now shows that $r=0$, i.e. that $f(1)=k=1$. +This shows that $f\left(\frac{1}{z}\right)=z$ for every $z>1$, i.e. $f(x)=\frac{1}{x}$ for every $x<1$. Now for $x>1$ consider $P(1, x-1)$ to get $f(f(x))=(x-1) f(1)+1=x=f\left(\frac{1}{x}\right)$. Injectivity of $f$ shows that $f(x)=\frac{1}{x}$. +So for all possible values of $x$ we have shown that $f(x)=\frac{1}{x}$. + +Solution 2. $P(1, y)$ shows that $f(f(y+1))=y f(1)+1$. Now $P\left(f(y+1), \frac{y f(1)}{y f(1)+1}\right)$ shows that + +$$ +f\left(f(y+1) f\left(f(y+1)+\frac{y f(1)}{y f(1)+1}\right)\right)=\frac{y f(1)}{y f(1)+1} f(f(y+1))+1=y f(1)+1 +$$ + +Since $f$ is injective (as in Solution 1) we get that + +$$ +f(y+1) f\left(f(y+1)+\frac{y f(1)}{y f(1)+1}\right)=f(y+1) +$$ + +and therefore there is a unique $k$ such that $f(k)=1$. Furtermore, for every $y>0$ we have + +$$ +f(y+1)=k-\frac{y f(1)}{y f(1)+1} +$$ + +The right hand side of (1) is always positive. But letting $y$ tend to infinity, the right hand side tends to $k-1$ so we must have $k \geqslant 1$. + +If $k>1$, then $P(k-1,1)$ gives + +$$ +f(k-1)=f((k-1) f(k))=f(k-1)+1 +$$ + +a contradiction. So $f(1)=k=1$. +For $x<1, P(x, 1-x)$ gives + +$$ +f(x)=f(x f(x+(1-x)))=(1-x) f(x)+1 +$$ + +from which we deduce that $f(x)=\frac{1}{x}$. To show that $f(x)=\frac{1}{x}$ for $x>1$ we can either work as in Solution 1 or take $y=x-1$ in (1) to get that + +$$ +f(x)=1-\frac{x-1}{(x-1)+1}=\frac{1}{x} +$$ + +A6. Find all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ such that + +$$ +f(x y)=f(x) f(y)+f(f(x+y)) +$$ + +holds for all $x, y \in \mathbb{R}$. + +## Proposed by Romania + +Solution 1. We will show that $f(x)=0$ for every $x \in \mathbb{R}$ or $f(x)=x-1$ for every $x \in \mathbb{R}$. It is easy to check that both of these functions work. + +We write $P(x, y)$ for the assertion that $f(x y)=f(x) f(y)+f(f(x+y))$. For later use we write $Q(x, y)$ for the assertion that $f(x y)=f(x) f(y)$ and $R(x, y)$ for the assertion that $f(x y)=$ $f(x) f(y)+f(x+y-1)$. +Assume first that $f(0)=0$. +For each $t \in \mathbb{R}, P(0, t)$ gives $f(f(t))=0$. Therefore we get that $Q(x, y)$ holds for each $x, y \in \mathbb{R}$. Now $Q(x, 1)$ gives $f(x)=f(x) f(1)$ for each $x \in \mathbb{R}$. But $f(1) \neq 1$ as otherwise we would have $f(f(1))=f(1)=1 \neq 0$, a contradiction. Since $f(1) \neq 1$, then $f(x)=f(x) f(1)$ gives $f(x)=0$. This holds for each $x \in \mathbb{R}$ and gives our first solution. + +From now on we assume that $f(0)=a \neq 0$. If $f(1)=1$, then for $t \in \mathbb{R}, P(t-1,1)$ gives $f(f(t))=0$ so we get that $Q(x, y)$ holds for each $x, y \in \mathbb{R}$. Now $Q(x, 0)$ gives $f(0)=f(x) f(0)$ for each $x \in \mathbb{R}$. Since $f(0) \neq 0$, then $f(x)=1$ for each $x \in \mathbb{R}$. This however contradicts the fact that $f(f(t))=0$ for each $t \in \mathbb{R}$. + +So from now on we can further assume that $f(1)=b \neq 1$. +Now $P(x, 0)$ gives + +$$ +f(f(x))=a-a f(x) +$$ + +and $P(x-1,1)$ gives + +$$ +f(f(x))=f(x-1)-b f(x-1) . +$$ + +Therefore, letting $c=\frac{b-1}{a}$, we get + +$$ +f(x)=c f(x-1)+1 +$$ + +for every $x \in \mathbb{R}$. +Claim 1. There is an integer $n$ such that $n^{2} \geqslant 4 f(n)$. +Proof. If $c=1$, then inductively from (1) we get that $f(n)=f(0)+n=a+n$ for each $n \in \mathbb{N}$. So for $n$ large enough we have $n^{2} \geqslant 4 f(n)$. + +If $c \neq 1$, then inductively from (1) we get that + +$$ +f(n)=\left(a-\frac{1}{1-c}\right) c^{n}+\frac{1}{1-c} +$$ + +for every $n \in \mathbb{Z}$. (We apply induction once to prove the result for every $n \geqslant 0$ and once to prove the result for every $n<0$.) +For $|c|<1$ we have $\lim _{n \rightarrow \infty} f(n)=\frac{1}{1-c}$ so we can find $n$ large enough such that $4 f(n) \leqslant n^{2}$. +For $|c|>1$ we have $\lim _{n \rightarrow-\infty} f(n)=\frac{1}{1-c}$ so we can find a negative integer $n$ with $|n|$ large enough such that $4 f(n) \leqslant n^{2}$. + +For $|c|=1$, we must have $c=-1$, so $f(n)= \pm\left(a-\frac{1}{2}\right)+\frac{1}{2}$ and again for $n$ large enough we have $4 f(n) \leqslant n^{2}$. +Claim 2. $f(1)=0$. +Proof. Let $n$ be as given by Claim 1 and pick $x^{\prime}, y^{\prime} \in \mathbb{R}$ such that $x^{\prime}+y^{\prime}=n$ and $x^{\prime} y^{\prime}=f(n)$. This is possible since $n^{2} \geqslant 4 f(n)$. Now $P\left(x^{\prime}, y^{\prime}\right)$ gives $f\left(x^{\prime}\right) f\left(y^{\prime}\right)=0$. +So there is a $d \in \mathbb{R}$ such that $f(d)=0$. +Putting $x=d+1$ in (1) we get $f(d+1)=1$. Now $P(d, 1)$ gives $f(f(d+1))=0$ and therefore $b=f(1)=0$. + +Claim 3. $c \neq-1$. +Proof. If $c=-1$, then $f(x)+f(x-1)=1$ for every $x \in \mathbb{R}$. In particular, for every $x \in \mathbb{R}$, we have + +$$ +f(x)+f(x+1)=1=f(x+1)+f(x+2) +$$ + +giving $f(x)=f(x+2)$. So $P\left(\frac{1}{2}, \frac{1}{2}\right)$ and $P\left(\frac{1}{2}, \frac{5}{2}\right)$ give + +$$ +f\left(\frac{5}{4}\right)=f\left(\frac{1}{2}\right) f\left(\frac{5}{2}\right)+f(f(3))=f\left(\frac{1}{2}\right) f\left(\frac{1}{2}\right)+f(f(1))=f\left(\frac{1}{4}\right) . +$$ + +But $f\left(\frac{1}{4}\right)+f\left(\frac{5}{4}\right)=1$, therefore $f\left(\frac{1}{4}\right)=f\left(\frac{5}{4}\right)=\frac{1}{2}$. Since $f(1)=0$, then $f(0)=1$ and so + +$$ +\frac{1}{2}=f\left(\frac{1}{4}\right)=f\left(\frac{1}{2}\right)^{2}+f(f(1)) \geqslant f(f(1))=f(0)=1 +$$ + +a contradiction. +Claim 4. $c=1$. +Proof. From (1) we get that $f(2)=1, f(3)=c+1$ and $f(4)=c^{2}+c+1$. Now $P(3,1)$ and $P(2,2)$ give that + +$$ +f(f(4))=f(3)-f(3) f(1)=c+1 \quad \text { and } \quad f(f(4))=f(4)-f(2)^{2}=c^{2}+c=c(c+1) . +$$ + +Since by Claim $3 c \neq-1$, then we must have $c=1$. +Since $f(1)=0$, then $P(x+y-1,1)$ gives $f(x+y-1)=f(f(x+y))$. Thus we have that $R(x, y)$ holds for every $x, y \in \mathbb{R}$. + +Now $R(x, y+1)$ gives + +$$ +f(x y+y)=f(x) f(y+1)+f(x+y) +$$ + +and from (1) and the fact that $c=1$ we deduce that + +$$ +\begin{aligned} +f(x y+x) & =f(x) f(y)+f(x)+f(x+y) \\ +& =f(x) f(y)+f(x)+f(x+y-1)+1 \\ +& =f(x y)+f(x)+1 +\end{aligned} +$$ + +This holds for every $x, y \in \mathbb{R}$. In particular, taking $x \neq 0$ and $y=t / x$, we have + +$$ +f(t+x)=f(t)+f(x)+1 +$$ + +for every $t \in \mathbb{R}, x \in \mathbb{R} \backslash\{0\}$. Note that (2) holds for $x=0$ as well, since $c=1$ implies that $f(0)=-1$. + +Defining $g(x)=f(x)+1$ for each $x \in \mathbb{R}$ then (2) gives that + +$$ +g(t+x)=g(t)+g(x) +$$ + +for every $t, x \in \mathbb{R}$. I.e. $g$ is additive. Furthermore $R(x, y)$ implies that + +$$ +\begin{aligned} +g(x y)-1 & =(g(x)-1)(g(y)-1)+g(x+y-1)-1 \\ +& =g(x) g(y)-g(x)-g(y)+g(x+y-1) \\ +& =g(x) g(y)-1 . +\end{aligned} +$$ + +This implies that $g$ is multiplicative. +We know that an additive and multiplicative function is either identically zero or the identity function. [Since $g$ is multiplicative, $g\left(x^{2}\right)=g(x)^{2} \geqslant 0$ giving that $g$ takes non-negative values at non-negative arguments. Since also $g$ is additive we get that $g$ is monotone increasing. Since also $g$ is additive it is know that $g(x)=C x$ for every $x \in \mathbb{R}$ for some contant $C$. The multiplicativity of $g$ now gives that $C=0$ or $C=1$.] + +Since $g$ is not identically 0 we get that $g(x)=x$ for every $x \in \mathbb{R}$ giving that $f(x)=x-1$ for every $x \in \mathbb{R}$. + +Solution 2 (Sketch). One can prove directly Claims 3 and 4 without the use of Claims 1 and 2. To prove Claim 3 we can make use of $P(x+1, y-1)$ which together with $P(x, y)$ and (1) gives + +$$ +f(x y+y-x)-c f(x y)=f(y)-c f(x) . +$$ + +Assuming $c=-1$, then (1) and (3) give that $f(x+2)=f(x)$ for every $x \in \mathbb{R}$. It follows that $f(x+2 n)=f(x)$ for every $x \in \mathbb{R}$ and every $n \in \mathbb{Z}$. Now with similar ideas as in the proof of Claim 1, it can be shown that for every $u, v \in \mathbb{R}$ there is $n \in \mathbb{N}$ large enough such that $u=x y+x-y+2 n$ and $v=x y+y-x$. Then using (3) we can get + +$$ +f(u)=f(x y+x-y+2 n)=f(x y+x-y)=f(x y+y-x)=f(v) . +$$ + +So $f$ is constant and it must be identically equal to $1 / 2$ which leads to a contradiction. +Now using (3) with $x=y$ and assuming $c \neq 1$ we get $f\left(x^{2}\right)=f(x)$. So $f$ is even. This eventually leads to $f(n)=1 /(1-c)=a=b$ for every integer $n$. Now $P(0,0)$ gives $a=a^{2}+f(a)$ and $P(a,-a)$ gives $f\left(-a^{2}\right)=f(a) f(-a)+f(a)$. Since $f$ is even we eventually get $f(a)=0$ which gives $a=0$ or $a=1$ both contraidicting the facts that $a \neq 0$ and $b \neq 1$. + +So $c=1$ and using (1) and (3) one can eventually get $a=-1$. The solution can then finish in the same way as in Solution 1. + +## COMBINATORICS + +C1. Let $\mathcal{A}_{n}$ be the set of $n$-tuples $x=\left(x_{1}, \ldots, x_{n}\right)$ with $x_{i} \in\{0,1,2\}$. A triple $x, y, z$ of distinct elements of $\mathcal{A}_{n}$ is called good if there is some $i$ such that $\left\{x_{i}, y_{i}, z_{i}\right\}=\{0,1,2\}$. A subset $A$ of $\mathcal{A}_{n}$ is called good if every three distinct elements of $A$ form a good triple. +Prove that every good subset of $\mathcal{A}_{n}$ has at most $2\left(\frac{3}{2}\right)^{n}$ elements. + +## Proposed by Greece + +Solution 1. We proceed by induction on $n$, the case $n=1$ being trivial. Let + +$$ +A_{0}=\left\{\left(x_{1}, \ldots, x_{n}\right) \in A: x_{n} \neq 0\right\} +$$ + +and define $A_{1}$ and $A_{2}$ similarly. +Since $A$ is good and $A_{0}$ is a subset of $A$, then $A_{0}$ is also good. Therefore, any three of its elements have a coordinate that differs. This coordinate cannot be the last one since 0 cannot appear as a last coordinate. This means that the set $A_{0}^{\prime}$ obtained from $A_{0}$ by deleting the last coordinate from each of its elements is a good subset of $\mathcal{A}_{n-1}$. + +Moreover, if $\left|A_{0}\right| \geqslant 3$ then $\left|A_{0}^{\prime}\right|=\left|A_{0}\right|$. Indeed, if otherwise, then there is an element $a \in A_{0}^{\prime}$ such that $x, y \in A_{0}$, where $x$ and $y$ are obtained from $a$ by adding to it the digits 1 and 2 respectively as the $n$-th coordinate. But then if $z$ is any other element of $A_{0}$ then $x, y, z$ do not form a good triple, a contradiction. So by the inductive hypothesis + +$$ +\left|A_{0}\right| \leqslant \max \left\{2,\left|A_{0}^{\prime}\right|\right\} \leqslant 2\left(\frac{3}{2}\right)^{n-1} +$$ + +Similarly, + +$$ +\left|A_{2}\right|,\left|A_{3}\right| \leqslant 2\left(\frac{3}{2}\right)^{n-1} +$$ + +On the other hand, each element of $A$ appears in exactly two of $A_{0}, A_{1}, A_{2}$. As a result, + +$$ +|A|=\frac{1}{2}\left(\left|A_{0}\right|+\left|A_{1}\right|+\left|A_{2}\right|\right) \leqslant 2\left(\frac{3}{2}\right)^{n} +$$ + +Solution 2. Let + +$$ +B=\left\{x=\left(x_{1}, \ldots, x_{n}\right) \in \mathcal{A}_{n}: x_{i} \in\{0,1\}\right\} +$$ + +Let $A$ be a good subset of $\mathcal{A}_{n}$ and define $f: A \times B \rightarrow \mathcal{A}_{n}$ by $f(a, b)=a+b=\left(a_{1}+b_{1}, \ldots, a_{n}+b_{n}\right)$ where the addition is done modulo 3 . + +We claim that if $(a, b),\left(a^{\prime}, b^{\prime}\right)$ and $\left(a^{\prime \prime}, b^{\prime \prime}\right)$ are distinct, then $f(a, b), f\left(a^{\prime}, b^{\prime}\right)$ and $f\left(a^{\prime \prime}, b^{\prime \prime}\right)$ cannot all be equal. Indeed assume $f(a, b)=f\left(a^{\prime}, b^{\prime}\right)=f\left(a^{\prime \prime}, b^{\prime \prime}\right)=\left(x_{1}, \ldots, x_{n}\right)$. So for each $i$ we have $a_{i}+b_{i}=a_{i}^{\prime}+b_{i}^{\prime}=a_{i}^{\prime \prime}+b_{i}^{\prime \prime}=x_{i}$. But then $a_{i}=x_{i}-b_{i} \in\left\{x_{i}, x_{i}-1\right\}$ and similarly $a_{i}^{\prime}, a_{i}^{\prime \prime} \in\left\{x_{i}, x_{i}-1\right\}$. So $\left\{a_{i}, a_{i}^{\prime}, a_{i}^{\prime \prime}\right\} \neq\{0,1,2\}$. Since this holds for each $i$ then $A$ cannot be a good set, contradiction. + +Therefore $|A||B| \leqslant 2\left|\mathcal{A}_{n}\right|$ which gives $|A| \leqslant 2\left(\frac{3}{2}\right)^{n}$ as required. + +Remark. Writing $f(n)$ for the maximal possible size of a good set, we proved that $f(n) \leqslant$ $2\left(\frac{3}{2}\right)^{n}$. We do not know the best possible asymptotic for $f(n)$ but we offer a corresponding lower bound which can increase the difficulty of the proposed problem. + +We pick each element of $\mathcal{A}_{n}$ independently with probability $p$ to form a set $A$. For each bad triple $x, y, z$ of elements of $A$ we arbitrarily remove one of the elements to end up with a good set $B$. Note that there are at most $21^{n}$ bad triples $(x, y, z)$ since for coordinate $i$, out of the 27 triples of the form $\left(x_{i}, y_{i}, z_{i}\right)$, only 6 of them will make the triple $(x, y, z)$ a good triple. (Actually there are less than $21^{n}$ triples since this counts also triples where two or more of the $n$-tuples are the same.) So we get that + +$$ +\mathbb{E}|B| \geqslant p \cdot 3^{n}-p^{3} \cdot 21^{n} . +$$ + +Taking $p=\frac{1}{\sqrt{3 \cdot 7^{n}}}$ we get + +$$ +\mathbb{E}|B| \geqslant \frac{1}{\sqrt{3}}\left(\frac{9}{7}\right)^{n / 2}-\frac{1}{3 \sqrt{3}}\left(\frac{9}{7}\right)^{n / 2}=\frac{2}{3 \sqrt{3}}\left(\frac{9}{7}\right)^{n / 2}=C \alpha^{n} +$$ + +where $\alpha=1.13389 \ldots$ and $C=0.3849 \ldots$. It follows that there is a good set of size at least $C \alpha^{n}$. + +C2. Let $K$ and $N>K$ be fixed positive integers. Let $n$ be a positive integer and let $a_{1}, a_{2}, \ldots, a_{n}$ be distinct integers. Suppose that whenever $m_{1}, m_{2}, \ldots, m_{n}$ are integers, not all equal to 0 , such that $\left|m_{i}\right| \leqslant K$ for each $i$, then the sum + +$$ +\sum_{i=1}^{n} m_{i} a_{i} +$$ + +is not divisible by $N$. What is the largest possible value of $n$ ? + +## Proposed by North Macedonia + +Solution. The answer is $n=\left\lfloor\log _{K+1} N\right\rfloor$. +Note first that for $n \leqslant\left\lfloor\log _{K+1} N\right\rfloor$, taking $a_{i}=(K+1)^{i-1}$ works. Indeed let $r$ be maximal such that $m_{r} \neq 0$. Then on the one hand we have + +$$ +\left|\sum_{i=1}^{n} m_{i} a_{i}\right| \leqslant \sum_{i=1}^{n} K(K+1)^{i-1}=(K+1)^{n}-10 +$$ + +So the sum is indeed not divisible by $n$. +Assume now that $n \geqslant\left\lfloor\log _{K+1} N\right\rfloor$ and look at all $n$-tuples of the form $\left(t_{1}, \ldots, t_{n}\right)$ where each $t_{i}$ is a non-negative integer with $t_{i} \leqslant K$. There are $(K+1)^{n}>N$ such tuples so there are two of them, say $\left(t_{1}, \ldots, t_{n}\right)$ and $\left(t_{1}^{\prime}, \ldots, t_{n}^{\prime}\right)$ such that + +$$ +\sum_{i=1}^{n} t_{i} a_{i} \equiv \sum_{i=1}^{n} t_{i}^{\prime} a_{i} \bmod N +$$ + +Now taking $m_{i}=t_{i}-t_{i}^{\prime}$ for each $i$ satisfies the requirements on the $m_{i}$ 's but $N$ divides the sum + +$$ +\sum_{i=1}^{n} m_{i} a_{i} +$$ + +a contradiction. + +C3. In an exotic country, the National Bank issues coins that can take any value in the interval $[0,1]$. Find the smallest constant $c>0$ such that the following holds, no matter the situation in that country: + +Any citizen of the exotic country that has a finite number of coins, with a total value of no more than 1000, can split those coins into 100 boxes, such that the total value inside each box is at most c. + +## Proposed by Romania + +Solution 1. The answer is $c=\frac{1000}{91}=11-\frac{11}{1001}$. Clearly, if $c^{\prime}$ works, so does any $c>c^{\prime}$. First we prove that $c=11-\frac{11}{1001}$ is good. + +We start with 100 empty boxes. First, we consider only the coins that individually value more than $\frac{1000}{1001}$. As their sum cannot overpass 1000, we deduce that there are at most 1000 such coins. Thus we are able to put (at most) 10 such coins in each of the 100 boxes. Everything so far is all right: $10 \cdot \frac{1000}{1001}<1011-\frac{11}{1001} +$$ + +for all $i=1,2, \ldots, 100$. Then + +$$ +x_{1}+x_{2}+\cdots+x_{100}+100 x>100 \cdot\left(11-\frac{11}{1001}\right) . +$$ + +But since $1000 \geqslant x_{1}+x_{2}+\cdots+x_{100}+x$ and $\frac{1000}{1001} \geqslant x$ we obtain the contradiction + +$$ +1000+99 \cdot \frac{1000}{1001}>100 \cdot\left(11-\frac{11}{1001}\right) \Longleftrightarrow 1000 \cdot \frac{1100}{1001}>100 \cdot 11 \cdot \frac{1000}{1001} . +$$ + +Thus the algorithm does not fail and since we have finitely many coins, we will eventually reach to a happy end. + +Now we show that $c=11-11 \alpha$, with $1>\alpha>\frac{1}{1001}$ does not work. +Take $r \in\left[\frac{1}{1001}, \alpha\right)$ and let $n=\left\lfloor\frac{1000}{1-r}\right\rfloor$. Since $r \geqslant \frac{1}{1001}$, then $\frac{1000}{1-r} \geqslant 1001$, therefore $n \geqslant 1001$. +Now take $n$ coins each of value $1-r$. Their sum is $n(1-r) \leqslant \frac{1000}{1-r} \cdot(1-r)=1000$. Now, no matter how we place them in 100 boxes, as $n \geqslant 1001$, there exist 11 coins in the same box. But $11(1-r)=11-11 r>11-11 \alpha$, so the constant $c=11-11 \alpha$ indeed does not work. + +Solution 2 (for the upper bound). Amongst all possible arrangements into boxes, pick one where the maximum value inside a box is as small as possible. If there are several arrangements achieving this smallest maximum value, pick one where the number of boxes achieving this value is as small as possible. + +Say that the boxes have total values equal to $10+x_{1} \geqslant 10+x_{2} \geqslant \cdots \geqslant 10+x_{100}$. respectively. We must have $x_{1}+\cdots+x_{100} \leqslant 0$. In particular, $0 \geqslant x_{1}+99 x_{100}$. + +Assume for contradiction that $x_{1}>\frac{990}{1001}=\frac{90}{91}$. Remove the coin of smallest denomination from the first box and add it into the 100-th box. Since the total value in the first box is greater than 10, the first box has at least 11 coins and therefore it has a coin of value at most $\frac{10+x_{1}}{11}$. The total new value in the last box is at most + +$$ +10+x_{100}+\frac{10+x_{1}}{11} \leqslant 10-\frac{x_{1}}{99}+\frac{10+x_{1}}{11}=10+x_{1}+\frac{90-91 x_{1}}{99}<10+x_{1} +$$ + +Remark. If we replace $[0,1]$ with $[0, v]$, the total sum with $s$, and the number of available boxes with $n$, then the answer to the problem is + +$$ +c=v+\frac{s}{n}-\left(\frac{s}{n}+1\right) \cdot \frac{1}{s+1}=v+\frac{s^{2}-n}{n(s+1)} +$$ + +C4. A sequence of $2 n+1$ non-negative integers $a_{1}, a_{2}, \ldots, a_{2 n+1}$ is given. There's also a sequence of $2 n+1$ consecutive cells enumerated from 1 to $2 n+1$ from left to right, such that initially the number $a_{i}$ is written on the $i$-th cell, for $i=1,2, \ldots 2 n+1$. Starting from this initial position, we repeat the following sequence of steps, as long as it's possible: + +Step 1: Add up the numbers written on all the cells, denote the sum as $s$. +Step 2: If $s$ is equal to 0 or if it is larger than the current number of cells, the process terminates. Otherwise, remove the $s$-th cell, and shift all cells that are to the right of it one position to the left. Then go to Step 1. + +Example: $(1,0,1, \underline{2}, 0) \rightarrow(1, \underline{0}, 1,0) \rightarrow(1, \underline{1}, 0) \rightarrow(\underline{1}, 0) \rightarrow(0)$. +A sequence $a_{1}, a_{2}, \ldots, a_{2 n+1}$ of non-negative integers is called balanced, if at the end of this process there's exactly one cell left, and it's the cell that was initially enumerated by $(n+1)$, i.e. the cell that was initially in the middle. + +Find the total number of balanced sequences as a function of $n$. + +## Proposed by North Macedonia + +Solution. The answer is: $C_{n} \cdot C_{n}$, where $C_{n}=\frac{1}{n+1}\binom{2 n}{n}$ is the $n$-th Catalan number. +We divide the proof into several steps. First, some terminology: the last (rightmost) $n$ cells will be called the back cells and the front (leftmost) $n$ cells will be called the front cells. The central, $(n+1)$-st, cell will be called the middle cell. + +Claim 1. All the back cells must be removed before any front cell is removed. +Proof. Assume for contradiction that this is not the case. Then there must be a point in time where a front cell is deleted and then immediately after a back cell is deleted. Let us say that the deleted front cell was at position $i$. So all back cells have positions greater or equal to $i+2$. After the cell is deleted all back cells have positions greater or equal to $i+1$. But since we deleted cell $i$, then the total sum is $i$ and this does not increase. So at the next step we delete a cell at position at most $i$, a contradiction. + +Claim 2. The middle cell must contain the number 0 , i.e., $a_{n+1}=0$. +Proof. Consider the last step in the process where we have total of 2 cells. One of these is the middle cell, and by Claim 1 the other must be one of the front cells. I.e. we have $\left(x, a_{n+1}\right)$. On the next move, we remove $x$, which means that $x+a_{n+1}=1$. So $a_{n+1}=0$ or $a_{n+1}=1$. But after that we cannot remove $a_{n+1}$, which means that $a_{n+1} \neq 1$. So $a_{n+1}=0$. + +Now, let's define a self-destructing sequence to be one with no surviving cells at the end of the process. For example, $(0,1,2)$ is self-destructing because $(0,1,2) \rightarrow(0,1) \rightarrow(1) \rightarrow()$. +Let $\mathcal{S}_{n}$ be the set of self-destructing sequences of length $n$. For example, $\mathcal{S}_{2}=\{(0,1),(1,1)\}$. It is clear that the front cells form a self-destructing sequence, i.e., $\left(a_{1}, a_{2}, \cdots a_{n}\right) \in \mathcal{S}_{n}$. The back cells also have certain self-destructing quality, which is made more precise in Claim 3 below. + +Claim 3. Fix the front sequence $\varphi=\left(a_{1}, a_{2}, \cdots, a_{n}\right)$. Let $\mathcal{B}_{\phi}$ be the set of all possible back sequences of length $n$ that can be appended to $\varphi$ (with a 0 between them) to get a balanced sequence. Then there is a bijection $f: \mathcal{S}_{n} \mapsto \mathcal{B}_{\phi}$. + +Proof. Let $c=n+1-\sum_{i=1}^{n} a_{i}$ and consider a particular $\sigma=\left(s_{1}, s_{2}, \ldots, s_{n}\right) \in \mathcal{S}_{n}$. Let $\ell$ be the initial index of the last surviving cell in $\sigma$. Then $f(\sigma)=\left(s_{1}, s_{2}, \ldots, s_{\ell}+c, s_{\ell+1}, \ldots, s_{n}\right)$ defines a bijection $\mathcal{S}_{n} \mapsto \mathcal{B}_{\phi}$. + +Indeed we claim that the $k$-th deleted cell in $\sigma$ is the $k$-th deleted cell in $\overline{\varphi 0 f(\sigma)}$ for each $k=1, \ldots, n$. Indeed after some deletions let $S$ be the total sum remaining in $\sigma$. Then the total sum remaining in $\overline{\varphi 0 f(\sigma)}$ is $-\sum_{i=1}^{n} a_{i}+0+S+c=S+n+1$. So we delete next the cell in position $S$ in $\sigma$ if and only if we delete the cell in position $S+n+1$ in $\overline{\varphi 0 f(\sigma)}$. +So $\overline{\phi 0 f(\sigma)}$ is clearly a balanced sequence: we first eliminate all cells in the back, then the front. In the same manner it follows that every balanced sequence in of this form. + +So far we have shown that the total number of balanced sequences is $\left|\mathcal{S}_{n}\right|^{2}$. It remains to calculate the size $\left|\mathcal{S}_{n}\right|$. + +Claim 4. Let $\mathcal{T}_{n}$ be the set of $2 n$-sequences consisting of $n$ zeros and $n$ ones such that in each initial segment the number of 1's does not surpass the number of 0 's. Then $\left|\mathcal{S}_{n}\right|=\left|\mathcal{T}_{n}\right|$. + +Proof. Let $[n]=\{1,2, \ldots, n\}$, and let us also consider the set $\mathcal{F}_{n}$ of non-decreasing mappings $f:[n] \rightarrow[n]$ such that $f(i) \leqslant i$ for each $i \in[n]$. The claim will follow once we show that $\left|\mathcal{S}_{n}\right|=\left|\mathcal{F}_{n}\right|$ and that $\left|\mathcal{F}_{n}\right|=\left|\mathcal{T}_{n}\right|$. + +In order to demonstrate that $\left|\mathcal{S}_{n}\right|=\left|\mathcal{F}_{n}\right|$, observe that there is an obvious bijective correspondence $a \mapsto f$ between the sets $\mathcal{S}_{n}$ and $\mathcal{F}_{n}$. Indeed, reversing the self-destructing process for an $n$-sequence $a=\left(a_{1}, a_{2}, \ldots, a_{n}\right) \in \mathcal{S}_{n}$, simply define $f(i)$ to be the (partial) sum of the existing terms after the $i$-th backward step. + +As for $\left|\mathcal{T}_{n}\right|=\left|\mathcal{F}_{n}\right|$, note the following bijective correspondence $t \mapsto f$ between the sets $\mathcal{T}_{n}$ and $\mathcal{F}_{n}$. Let $f(i)$ equal $1+\#(i)$, where $\#(i)$ is defined to be the total number of $1^{\prime} s$ appearing in $t$ before the $i$-th zero. + +Finally, it is a known fact that $\left|\mathcal{B}_{n}\right|$ is the $n$-th Catalan number $C_{n}=\frac{1}{n+1}\binom{2 n}{n}$. (The essential idea of the textbook proof of this fact uses the so-called reflection principle of A. D. André.) + +C5. Angel has a warehouse, which initially contains 100 piles of 100 pieces of rubbish each. Each morning, Angel either clears every piece of rubbish from a single pile, or one piece of rubbish from each pile. However, every evening, a demon sneaks into the warehouse and adds one piece of rubbish to each non-empty pile, or creates a new pile with one piece. What is the first morning when Angel can guarantee to have cleared all the rubbish from the warehouse? + +## Proposed by United Kingdom + +Solution 1. We will show that he can do so by the morning of day 199 but not earlier. +If we have $n$ piles with at least two pieces of rubbish and $m$ piles with exactly one piece of rubbish, then we define the value of the pile to be + +$$ +V= \begin{cases}n & m=0 \\ n+\frac{1}{2} & m=1 \\ n+1 & m \geqslant 2\end{cases} +$$ + +We also denote this position by $(n, m)$. Implicitly we will also write $k$ for the number of piles with exactly two pieces of rubbish. + +Angel's strategy is the following: +(i) From position $(0, m)$ remove one piece from each pile to go position $(0,0)$. The game ends. +(ii) From position $(n, 0)$, where $n \geqslant 1$, remove one pile to go to position $(n-1,0)$. Either the game ends, or the demon can move to position $(n-1,0)$ or $(n-1,1)$. In any case $V$ reduces by at least $1 / 2$. +(iii) From position $(n, 1)$, where $n \geqslant 1$, remove one pile with at least two pieces to go to position $(n-1,1)$. The demon can move to position $(n, 0)$ or $(n-1,2)$. In any case $V$ reduces by (at least) $1 / 2$. +(iv) From position $(n, m)$, where $n \geqslant 1$ and $m \geqslant 2$, remove one piece from each pile to go to position $(n-k, k)$. The demon can move to position $(n, 0)$ or $(n-k, k+1)$. In any case $V$ reduces by at least $1 / 2$. (The value of position $(n-k, k+1)$ is $n+\frac{1}{2}$ if $k=0$, and $n-k+1 \leqslant n$ if $k \geqslant 1$.) + +So during every day if the game does not end then $V$ is decreased by at least $1 / 2$. So after 198 days if the game did not already end we will have $V \leqslant 1$ and we will be in one of positions $(0, m),(1,0)$. The game can then end on the morning of day 199. + +We will now provide a strategy for demon which guarantees that at the end of each day $V$ has decreased by at most $1 / 2$ and furthermore at the end of the day $m \leqslant 1$. +(i) If Angel moves from $(n, 0)$ to $(n-1,0)$ (by removing a pile) then create a new pile with one piece to move to $(n-1,1)$. Then $V$ decreases by $1 / 2$ and and $m=1 \leqslant 1$ +(ii) If Angel moves from $(n, 0)$ to $(n-k, k)$ (by removing one piece from each pile) then add one piece back to each pile to move to $(n, 0)$. Then $V$ stays the same and $m=0 \leqslant 1$. +(iii) If Angels moves from $(n, 1)$ to $(n-1,1)$ or $(n, 0)$ (by removing a pile) then add one piece to each pile to move to $(n, 0)$. Then $V$ decreases by $1 / 2$ and $m=0 \leqslant 1$. +(iv) If Angel moves from $(n, 1)$ to $(n-k, k)$ (by removing a piece from each pile) then add one piece to each pile to move to $(n, 0)$. Then $V$ decreases by $1 / 2$ and $m=0 \leqslant 1$. + +Since after every move of demon we have $m \leqslant 1$, in order for Angel to finish the game in the next morning we must have $n=1, m=0$ or $n=0, m=1$ and therefore we must have $V \leqslant 1$. + +But now inductively the demon can guarantee that by the end of day $N$, where $N \leqslant 198$ the game has not yet finished and that $V \geqslant 100-N / 2$. + +## Solution 2. + +Define Angel's score $S_{A}$ to be $S_{A}=2 n+m-1$. The Angel can clear the rubbish in at most $\max \left\{S_{A}, 1\right\}$ days. The proof is by induction on $(n, m)$ in lexicographic order. + +Angel's strategy is the same as in Solution 1 and in each of cases (ii)-(iv) one needs to check that $S_{A}$ reduces by at least 1 in each day. (Case (i) is trivial as the game ends in one day.) + +Now define demon's score $S_{D}$ to be $S_{D}=2 n-1$ if $m=0$ and $S_{D}=2 n$ if $m \geqslant 1$. The claim is the if $(n, m) \neq(0,0)$, then the demon can ensure that Angel requires $S_{D}$ days to clear the rubbish. + +Again, demon's strategy is the same as in the Solution by PSC and in each of cases (i)-(iv) one needs to check that $S_{D}$ reduced by at most 1 in each day. + +Comment. If we start from position $(n, m)$, then the number $N$ of days required is + +$$ +N= \begin{cases}2 n-1 & \text { if } m=0 \\ 2 n & \text { if } m=1 \\ 2 n & \text { if } m \geqslant 2, \text { and } k \geqslant 1 \\ 2 n+1 & \text { if } m \geqslant 2, \text { and } k=0\end{cases} +$$ + +C6. There is a population $P$ of 10000 bacteria, some of which are friends (friendship is mutual), so that each bacterion has at least one friend and if we wish to assign to each bacterion a coloured membrane so that no two friends have the same colour, then there is a way to do it with 2021 colours, but not with 2020 or less. + +Two friends $A$ and $B$ can decide to merge in which case they become a single bacterion whose friends are precisely the union of friends of $A$ and $B$. (Merging is not allowed if $A$ and $B$ are not friends.) It turns out that no matter how we perform one merge or two consecutive merges, in the resulting population it would be possible to assign 2020 colours or less so that no two friends have the same colour. Is it true that in any such population $P$ every bacterium has at least 2021 friends? + +## Proposed by Bulgaria + +Solution 1. The answer is affirmative. +We will use the terminology of graph theory. Here the vertices of our main graph $G$ are the bacteria and there is an edge between two precisely when they are friends. The degree $d(v)$ of a vertex $v$ of $G$ is the number of neighbours of $v$. The minimum degree $\delta(G)$ of $G$ is the smallest amongst all $d(v)$ for vertices $v$ of $G$. The chromatic number $\chi(G)$ of $G$ is the number of colours needed in order to colour the vertices such that neighbouring vertices get distinct colours. + +It suffices to establish the following: +Claim. Let $k$ be a positive integer and let $G$ be a graph on $n>k$ vertices with $\delta(G) \geqslant 1$ and $\chi(G)=k$. Suppose that merging one pair or two pairs of vertices results in a graph $G^{\prime}$ with $\chi\left(G^{\prime}\right) \leqslant k-1$. Then $\delta(G) \geqslant k$. + +We establish this in a series of claims. +Claim 1. $\delta(G) \geqslant k-1$. +Proof. Suppose for contradiction that we have a vertex $v$ of degree $r \leqslant k-2$ and denote its neighbours by $v_{1}, \ldots, v_{r}$. (Note that, by assumption, $v$ has at least one neighbour.) + +Suppose we merge $v$ with $v_{i}$. We denote the new vertex by $v_{0}$, and we colour the obtained graph in $k-1$ colours. Note that at most $r \leqslant k-2$ colours can appear in the set $S_{1}=$ $\left\{v_{0}, v_{1}, \ldots, v_{i-1}, v_{i+1}, \ldots, v_{r}\right\}$. Therefore we can get a $(k-1)$-colouring of $G$ by assigning the colour of $v_{0}$ to $v_{i}$ and an unused colour (from the $k-1$ available) to $v$, thus contradicting the assumption that $\chi(G)=k$. + +So from now on we may assume that there is a vertex $v$ of $G$ with $\operatorname{deg}(v)=k-1$, as otherwise the proof is complete. We denote its neighbours by $v_{1}, \ldots, v_{k-1}$. + +Claim 2. The set of neighbours of $v$ induces a complete graph. +Proof of Claim 2. Suppose $v_{i} v_{j} \notin E(G)$. Merge $v$ with $v_{i}$, giving a next vertex $w$, and then merge $w$ with $v_{j}$, denoting the newest vertex by $v_{0}$. Then colour the resulting graph in $k-1$ colours. Note that at most $k-2$ colours can appear in the set $S_{2}=\left\{v_{0}, v_{1}, \ldots, v_{k-1}\right\} \backslash\left\{v_{i}, v_{j}\right\}$. So we can get a $(k-1)$-colouring of $G$ by assigning the colour of $v_{0}$ to $v_{i}$ and $v_{j}$ and an unused colour (from the $k-1$ available) to $v$, thus contradicting the assumption that $\chi(G)=k$. + +Claim 3. For every edge $u w$, both $u$ and $w$ belong in the set $\left\{v, v_{1}, \ldots, v_{k-1}\right\}$. +Proof. Otherwise merge $u$ and $w$ and call the new vertex $z$. If $u, w \notin\left\{v, v_{1}, \ldots, v_{k-1}\right\}$ then by Claim 2 the resulting graph contains a complete graph on $\left\{v, v_{1}, \ldots, v_{k-1}\right\}$ and so its chromatic number is at least $k$, a contradiction. If one of $u, w$ belongs in the set $\left\{v, v_{1}, \ldots, v_{k-1}\right\}$, say +$u=v_{i}$, then the resulting graph contains a complete graph on $\left\{v, v_{1}, \ldots, v_{k-1}, z\right\} \backslash\left\{v_{i}\right\}$. This is again a contradiction. + +From Claim 3 we see that $G$ consists of a complete set on $k$ vertices together with $n-k>0$ isolated vertices. This is a contradiction as $\delta(G) \geqslant 1$. + +Remark. We do not know if the result is best possible or whether it can be improved to show $\delta(G) \geqslant 2022$. + +## GEOMETRY + +G1. Let $A B C$ be a triangle with $A BA B$ and circumcircle $\Gamma$. The tangent from $A$ to $\Gamma$ intersects $B C$ at $T$. Let $M$ be the midpoint of $B C$ and let $R$ be the reflection of $A$ in $B$. Let $S$ be a point so that $S A B T$ is a parallelogram and finally let $P$ be a point on line $S B$ such that $M P$ is parallel to $A B$. + +Given that $P$ lies on $\Gamma$, prove that the circumcircle of $\triangle S T R$ is tangent to line $A C$. + +## Proposed by United Kingdom + +Solution 1. Let $N$ be the midpoint of $B S$ which, as $S A B T$ is a parallelogram, is also the midpoint of $T A$. Using $S T\|A B\| M P$ we get: + +$$ +\frac{N B}{B P}=\frac{1}{2} \cdot \frac{S B}{B P}=\frac{T B}{2 \cdot B M}=\frac{T B}{B C} +$$ + +which shows that $T A \| C P$. +![](https://cdn.mathpix.com/cropped/2024_12_07_557efa8b80873b479030g-40.jpg?height=943&width=1217&top_left_y=979&top_left_x=451) + +Let $\Omega$ be the circle with diameter $O T$. As $\angle O M T=90^{\circ}=\angle T A O$ we have that $A, M$ lie on $\Omega$. We now show that $P$ lies on $\Omega$. As $T A \| C P$ and $T A$ is tangent to $\Gamma$ we have that $A P=A C$, so + +$$ +\angle T A P=\angle A C P=\angle C P A=\angle C B A=\angle T M P +$$ + +where in the last step we used the fact that $M P \| A B$. This shows that $P$ lies on $\Omega$. Furthermore, this shows that $\angle O P T=90^{\circ}$ and so $T P$ is also tangent to $\Gamma$. + +Now we show that $R, S$ lie on $\Omega$ which would show that $\Omega$ is the circumcircle of triangle $S T R$. For $S$, using $S T \| A B$ and that $T A$ tangent to $\Gamma$ we have + +$$ +\angle T S P=\angle A B S=\angle A C P=\angle T A P . +$$ + +For $R$, the homothety with factor 2 centred at $A$ takes $B N$ to $R T$. So $B N \| R T$ and hence + +$$ +\angle A R T=\angle A B S=\angle T A P=\angle A P T, +$$ + +where the last step follows from $T A=T P$ as they are both tangents to $\Gamma$. +Finally, we observe that as $T A$ tangent to $\Gamma$ then + +$$ +\angle T A C=180^{\circ}-\angle C B A=\angle A B T=\angle T S A +$$ + +which, by the alternate segment theorem, means that line $A C$ is tangent to $\Omega$ as required. + +Solution 2. We have + +$$ +\angle A P S=\angle A C B=\angle T A B=\angle A T S, +$$ + +so $S, A, P, T$ are concyclic on a circle $\Omega$. We also have + +$$ +\angle P A C=\angle P B C=\angle S B T=\angle P S A +$$ + +so $A C$ is tangent to $\Omega$. It remains to prove that $R$ belongs on $\Omega$. +![](https://cdn.mathpix.com/cropped/2024_12_07_557efa8b80873b479030g-41.jpg?height=846&width=1224&top_left_y=1025&top_left_x=416) + +As in Solution 1 we have that $T A \| C P$. Then + +$$ +\angle C P M=\angle A T S=\angle A P S . +$$ + +Since also $\angle B A P=\angle B C P$, then the triangles $A P B$ and $C P M$ are similar. But then the triangles $B P C$ and $R A P$ are also similar as $\angle R A P=\angle B C P$ and + +$$ +\frac{R A}{A P}=\frac{2 B A}{A P}=\frac{2 M C}{C P}=\frac{B C}{C P} . +$$ + +It now follows that + +$$ +\angle A R P=\angle P B C=\angle A S P +$$ + +and therefore $R$ belongs to $\Omega$ as required. + +G6. Let $A B C$ be an acute triangle such that $A Bp_{i+1}$. Since also $a_{n+r}=\left(p_{i}+r\right) p_{i+1}$, then $\ell\left(p_{i}+r\right)>p_{i+1}$ and therefore $\ell\left(p_{i}+r\right) \geqslant p_{i+2}$. This is impossible as $p_{i}+rp_{i+2} p_{i+1}$. This is equivalent to showing that $p_{i+2}<4 p_{i+1}$ which follows from Bertrand's postulate. + +N3. Let $n$ be a positive integer. Determine, in terms of $n$, the greatest integer which divides every number of the form $p+1$, where $p \equiv 2 \bmod 3$ is a prime number which does not divide $n$. + +## Proposed by Bulgaria + +Solution. Let $k$ be the greatest such integer. We will show that $k=3$ when $n$ is odd and $k=6$ when $n$ is even. + +We will say that a number $p$ is nice if $p$ is a prime number of the form $2 \bmod 3$ which does not divide $N$. + +Note first that if $3 \mid p+1$ for every nice number $p$ and so $k$ is a multiple of 3 . +If $n$ is odd, then $p=2$ is nice, so we must have $k \mid 3$. From the previous paragraph we get that $k=3$. + +If $n$ is even, then $p=2$ is not nice, therefore every nice $p$ is of the form $5 \bmod 6$. So in this case $6 \mid p+1$ for every nice number $p$. + +It remains to show that (if $n$ is even then) +(i) There is a nice $p$ such that $4 \nmid p+1$. +(ii) There is a nice $p$ such that $9 \nmid p+1$. +(iii) There is a nice $p$ such that for every prime $q \neq 2,3$ we have that $q \nmid p+1$. + +For (i), by Dirichlet's theorem on arithmetic progressions, there are infinitely many primes of the form $p \equiv 5 \bmod 12$. Any one of them which is larger than $n$ will do. + +For (ii), by Dirichlet's theorem on arithmetic progressions, there are infinitely many primes of the form $p \equiv 2 \bmod 9$. Any one of them which is larger than $n$ will do. + +For (iii), by Dirichlet's theorem on arithmetic progressions, there are infinitely many primes of the form $p \equiv 2 \bmod 3 q$. Any one of them which is larger than $n$ will do. + +Remark. In the proposal, the statement of Dirichlet's theorem on Arithmetic Progressions was given as known. Even though this makes the problem fairer we omitted it because we feel that it also makes it easier. + +N4. Can every positive rational number $q$ be written as + +$$ +\frac{a^{2021}+b^{2023}}{c^{2022}+d^{2024}} +$$ + +where $a, b, c, d$ are all positive integers? +Proposed by United Kingdom + +Solution. The answer is yes. Set $a=x^{2023}, b=x^{2021}$ and $c=y^{2024}, d=y^{2022}$ for some integers $x, y$ and let $q=\frac{m}{n}$ in lowest terms. Then we could try to solve + +$$ +\frac{a^{2021}+b^{2023}}{c^{2022}+d^{2024}}=\frac{2 x^{2021 \times 2023}}{2 y^{2022 \times 2024}}=\frac{x^{2021 \times 2023}}{y^{2022 \times 2024}}=\frac{m}{n} . +$$ + +Consider setting $x=m^{x_{1}} n^{x_{2}}$ and $y=m^{y_{1}} n^{y_{2}}$. Then by considering powers of $m$ and powers of $n$ separately, it would be sufficient to solve the pair of equations + +$$ +2021 \times 2023 x_{1}-2022 \times 2024 y_{1}=1, \quad \text { and } \quad 2021 \times 2023 x_{2}-2022 \times 2024 y_{2}=-1 +$$ + +We know that these equations have solutions in positive integers so long as $2021 \times 2023$ and $2022 \times 2024$ are coprime. Amongst integers which differ by at most three, the only possible common prime factors are 2 and 3. Clearly 2 is not a common prime factor of the products, nor is 3 , since only one of the four factors is divisible by 3 . So these two integers are coprime, and the equations have solutions. + +N5. A natural number $n$ is given. Determine all $(n-1)$-tuples of nonnegative integers $a_{1}, a_{2}, \ldots, a_{n-1}$ such that + +$$ +\left[\frac{m}{2^{n}-1}\right]+\left[\frac{2 m+a_{1}}{2^{n}-1}\right]+\left[\frac{2^{2} m+a_{2}}{2^{n}-1}\right]+\left[\frac{2^{3} m+a_{3}}{2^{n}-1}\right]+\cdots+\left[\frac{2^{n-1} m+a_{n-1}}{2^{n}-1}\right]=m +$$ + +holds for all $m \in \mathbb{Z}$. +Proposed by Serbia + +Solution 1. We will show that there is a unique such $n$-tuple: $a_{k}=2^{n-1}+2^{k-1}-1$ for $k=1, \ldots, n-1$. +Write $N=2^{n}-1$ and $f_{k}(x)=\left[\frac{2^{k} x+a_{k}}{N}\right]$ for $k=0,1, \ldots, n-1$, where $a_{0}=0$. Since + +$$ +\sum_{k=0}^{n-1} f_{k}(m)-\sum_{k=0}^{n-1} f_{k}(m-1)=1 +$$ + +for each $m \in \mathbb{Z}$, there is exactly one $k$ for which $f_{k}(m)=f_{k}(m-1)+1$. We work modulo $N$. The last equality holds if and only if $2^{k} m+a_{k} \in\left\{0,1, \ldots, 2^{k}-1\right\}$. I.e. if and only if + +$$ +2^{k} m \in\left\{-a_{k}, 1-a_{k}, \ldots, 2^{k}-1-a_{k}\right\} +$$ + +Multiplying with $2^{n-k}$, and noting that $2^{n} \equiv 1 \bmod N$, we get the following: +For each $m \in \mathbb{Z}$ there is a unique $k \in\{0,1, \ldots, n-1\}$ such that $m \in B_{k}$ (modulo $N$ ) where + +$$ +B_{k}=\left\{b_{k}, b_{k}+2^{n-k}, \ldots, b_{k}+\left(2^{k}-1\right) 2^{n-k}\right\} +$$ + +with $b_{k}=-2^{n-k} a_{k}$. Therefore the problem condition is equivalent to $\bigcup_{k=0}^{n-1} B_{k}$ being a partition of $\{0,1, \ldots, N-1\}$. + +For a number $b$ and set a $A \subseteq \mathbb{Z}$ we write $b+A=\{b+a: a \in A\}$. With this notation, $B_{n-1}=b_{n-1}+\left\{0,2,4, \ldots, 2^{n}-2\right\}$. The set $B_{n-2}=b_{n-2}+\left\{0,4,8, \ldots, 2^{n}-4\right\}$ is contained in $\overline{B_{n-1}}=b_{n-1}+\left\{1,3, \ldots, 2^{n}-3\right\}$, implying $b_{n-2}, b_{n-2}+2^{n}-4 \in \overline{B_{n-1}}$, which holds only if $b_{n-2} \equiv$ $b_{n-1}+1$. Further, the set $B_{n-3}=b_{n-3}+\left\{0,8,16, \ldots, 2^{n}-8\right\}$ is contained in $\overline{B_{n-1} \cup B_{n-2}}=$ $b_{n-1}+\left\{3,7, \ldots, 2^{n}-5\right\}$, so we must have $b_{n-3} \equiv b_{n-1}+3$. Similarly, $b_{n-4} \equiv b_{n-1}+7$ etc. In general, $b_{n-k} \equiv b_{n-1}+2^{k-1}-1$ for $k=1, \ldots, n-1$. It follows that $b_{0} \equiv b_{n-1}+2^{n-1}-1$. On the other hand, we have $b_{0}=0$, which gives $b_{n-1} \equiv 1-2^{n-1}$ and therefore $b_{k} \equiv 2^{n-1-k}-2^{n-1}$. Thus $a_{k} \equiv-2^{k} b_{k} \equiv 2^{n+k-1}-2^{n-1} \equiv 2^{n-1}+2^{k-1}-1$ for $k=1, \ldots, n-1$. +Finally, $\sum_{k} f_{k}(0)=0$ implies $a_{k}1$ then we get a contradiction in exactly the same way as in (2). If $c=1$ then $(2 k+1)^{2}=169$ giving $k=6$. This implies that $a+b=47 \cdot 6+47 \cdot 7=47 \cdot 13 \equiv 1 \bmod 5$. Thus $q=(a+b)^{2}+4 \equiv 0 \bmod 5$, a contradiction. + +N7. A super-integer triangle is defined to be a triangle whose lengths of all sides and at least one height are positive integers. We will deem certain positive integer numbers to be good with the condition that if the lengths of two sides of a super-integer triangle are two (not necessarily different) good numbers, then the length of the remaining side is also a good number. Let 5 be a good number. Prove that all integers larger than 2 are good numbers. + +## Proposed by Serbia + +Solution. Evidently, all right-angle triangles with integer sides are super-integer triangles. We will use the following notation $(a, b, c\{h\})$ to denote a super-integer triangle whose sides are $a$, $b$ and $c$ and the height of integer length is $h$. The height will be written in curly brackets next to the corresponding side and it will be omitted for right-angled triangles. It also follows that if $(a, b, c)$ is an super-integer triangle, then so is $(k a, k b, k c)$, where $k$ is a positive integer. + +Note. In all cases of right-angled triangles one can check directly that they are right-angled by Pythagoras' Theorem or use the standard result that $\left(d\left(m^{2}-n^{2}\right), 2 d m n, d\left(m^{2}+n^{2}\right)\right)$ is a right-angled triangle. For non-right angled triangled we will use Heron's formula that the area of the triangle is $\sqrt{s(s-a)(s-b)(s-c)}$ where $s$ is the semiperimeter. For the triangle to be super-integer we need that $s(s-a)(s-b)(s-c)$ is a perfect square, say $s=m^{2}$, and that $2 m$ is a multiple of $a$ or $b$ or $c$. We will only make implicit use of the above. + +From $(5,5,6\{4\})$ and $(5,5,8\{3\})$ it follows that 6 and 8 are good. From $(6,8,10)$ it then follows that 10 is also good. + +It thus follows if $a$ is good that $2 a$ is also good. Indeed consider a sequence of super-integer triangles showing that if 5 is good then $a$ is good. Then the sequence of super-integer triangles of double the size of their edges show that since 10 is good then $2 a$ is good. + +It easily follows that $12,16,20$ and 24 are good. From $(5,12,13)$ it follows that 13 and therefore also 26 are good. From $(11\{12\}, 13,20)$ and $(21\{12\}, 13,20)$ it follows that 11 and 21 are good. From $(20,21,29)$ it follows that 29 is good. From $(6\{20\}, 25,29)$ it follows that 25 is good. + +We will say that a positive integer is nice if it is either good or equal to 1 or 2 . +Claim 1. If $a$ is good and $b$ is nice then $a b$ is good. +Proof of Claim. The claim is trivial if $b=1$ and we already proved the case $b=2$. So assume that $b$ is good. Pick a sequence of super-integer triangles which shows that if 5 is good then $b$ is good. Then the sequence of super-integer triangles 5 times the size of their edges shows that since 25 is good then $5 b$ is also good. Now pick a sequence of super-integer triangles which shows that if 5 is good then $b$ is good. Then the sequence of super-integer triangles $b$ times the size of their edges shows that since $5 a$ is good then $a b$ is also good. + +Next, from $(15,20,25)$ and $(7,24,25)$ we get that 15,7 and therefore 14 are good. From $(9,12,15)$ and $(8,15,17)$ we get that 9,17 and therefore 18 are good and finally from $(3\{24\}, 25,26)$ and then $(3,4,5)$ we get that 3 and 4 are good. + +We now have that all integers from 3 to 18 are good. To prove that the remaining integers larger than 18 are good, we will proceed by strong induction. Assume that all integers from 3 to $n-1$ are good for $n \geqslant 19$. + +Case 1. If $n=2 m$ is even, then $3 \leqslant m \leqslant n-1$ so $m$ is good. By Claim $1, n=2 m$ is also good. +Case 2. If $n$ is odd and composite, say $n=a b$, with $a, b>1$, then $3 \leqslant a, b \leqslant n-1$ so $a, b$ are good. By Claim 1, $n=a b$ is also good. + +Case 3. If $n$ is an odd prime of the form $4 k+1$, then by Fermat sum of two squares theorem we can write $n=a^{2}+b^{2}$. We may assume $a>b .(a \neq b$ as $n$ is prime.) Consider the triangle $\left(a^{2}-b^{2}, 2 a b, a^{2}+b^{2}\right)$. This is a super-integer triangle since it is a right-angled triangle. We have $3 \leqslant a^{2}-b^{2} \leqslant n-1$ so $a^{2}-b^{2}$ is good. We also have $3 \leqslant 2 a b1$ and $a \neq b$. If $\ell-1,|a-b|, a, b$ are nice, and $\ell, a+b, a^{2} \ell+b^{2}$ are good, then $a^{2} \ell^{2}+b^{2}$ is good. + +Proof of Claim. By Claim 1, the numbers $\left|a^{2}-b^{2}\right|=|a-b|(a+b)$ and $2 a b$ are good. From the right-angled triangle ( $2 a b,\left|a^{2}-b^{2}\right|, a^{2}+b^{2}$ ) it follows that $a^{2}+b^{2}$ is good. So by Claim $1 \ell\left(a^{2}+b^{2}\right)$ is good. By Claim $1(\ell-1)\left(a^{2} \ell+b^{2}\right)$ is also good. Finally, from the triangle $\left((\ell-1)\left(a^{2} \ell+b^{2}\right)\{2 \ell a b\}, \ell\left(a^{2}+b^{2}\right), a^{2} \ell^{2}+b^{2}\right)$, we get that $a^{2} \ell^{2}+b^{2}$ is good. + +From Claim 2 with $a=2, b=1$ and $\ell=k+1$ to obtain that + +$$ +2^{2}(k+1)^{2}+1^{2}=4 k^{2}+8 k+5=4(k+1)+(2 k+1)^{2} +$$ + +is good. From Claim 2 with $a=2, b=2 k+1$ and $\ell=k+1$ we obtain that + +$$ +2^{2}(k+1)^{2}+(2 k+1)^{2}=(2 k+2)^{2}+(2 k+1)^{2} +$$ + +is good. Since from Claim $1,2(2 k+1)(2 k+2)$ is good, then from the right-angled triangle $\left(4 k+3,2(2 k+1)(2 k+2),(2 k+2)^{2}+(2 k+1)^{2}\right)$ we finally deduce that $4 k+3$ is good as required. +