# Baltic Way Problem 1. Let $n$ be a positive integer. Find all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ that satisfy the equation $$ (f(x))^{n} f(x+y)=(f(x))^{n+1}+x^{n} f(y) $$ for all $x, y \in \mathbb{R}$. Solution. The functions we are looking for are $f: \mathbb{R} \rightarrow \mathbb{R}, f(x)=0$ and $f: \mathbb{R} \rightarrow \mathbb{R}, f(x)=x$. For $n$ even $f: \mathbb{R} \rightarrow \mathbb{R}, f(x)=-x$ is also a solution. Throughout the solution, $P\left(x_{0}, y_{0}\right)$ will denote the substitution of $x_{0}$ and $y_{0}$ for $x$ and $y$, respectively, in the given equation. $P(x, 0)$ for $x \neq 0$ gives $$ f(x)^{n+1}=f(x)^{n+1}+x^{n} f(0) $$ and therefore $$ f(0)=\frac{f(x)^{n+1}-f(x)^{n+1}}{x^{n}}=0 . $$ $P(x,-x)$ for $x \neq 0$ gives $$ 0=f(x)^{n} f(0)=f(x)^{n+1}+x^{n} f(-x) $$ and therefore $$ f(-x)=-\frac{f(x)^{n+1}}{x^{n}} $$ Applying this identity twice, we get $$ f(x)=f(-(-x))=-\frac{f(-x)^{n+1}}{(-x)^{n}}=-\frac{\left(-\frac{f(x)^{n+1}}{x^{n}}\right)^{n+1}}{(-x)^{n}}=\frac{f(x)^{n^{2}+2 n+1}}{x^{n^{2}+2 n}} $$ which after rearranging yields $$ f(x)\left(x^{n^{2}+2 n}-f(x)^{n^{2}+2 n}\right)=0 . $$ If there exists an $a \neq 0$ for which $f(a)=0$, then $P(a, y)$ yields $$ 0=a^{n} f(y) $$ which means that $f(y)=0$ for all $y \in \mathbb{R}$. This is a solution to the equation for all $n$. If instead $f(x) \neq 0$ for all $x \neq 0$, then we have $$ x^{n^{2}+2 n}=f(x)^{n^{2}+2 n} . $$ If $n$ is odd, then so is $n(n+2)=\left(n^{2}+2 n\right)$, meaning $f(x)=x$ for all $x \in \mathbb{R}$. This is a solution to the equation. ## Baltic Way If $n$ is even, then so is $n(n+2)=\left(n^{2}+2 n\right)$, meaning $f(x)= \pm x$ for all $x \in \mathbb{R}$. Both $f(x)=x$ and $f(x)=-x$ are solutions to the equation. In all other cases there must exist $x, y \neq 0$ such that $f(x)=x$ and $f(y)=-y$. Then $P(x, y)$ yields $$ x^{n} f(x+y)=x^{n+1}-x^{n} y $$ which after dividing by $x^{n} \neq 0$ yields $$ f(x+y)=x-y . $$ Since $(f(x))^{2}=x^{2}$ for all $x \in \mathbb{R}$, we have $(x+y)^{2}=(x-y)^{2}$. That is $4 x y=0$ which is impossible as $x, y \neq 0$. There are therefore no more solutions to the equation. Problem 2. Let $a, b, c$ be the side lengths of a triangle. Prove that $$ \sqrt[3]{\left(a^{2}+b c\right)\left(b^{2}+c a\right)\left(c^{2}+a b\right)}>\frac{a^{2}+b^{2}+c^{2}}{2} . $$ Solution. We claim that $$ a^{2}+b c>\frac{a^{2}+b^{2}+c^{2}}{2} $$ which will finish the proof. Note that the claimed inequality is equivalent to $$ \begin{aligned} a^{2}+b c>\frac{a^{2}+b^{2}+c^{2}}{2} & \Longleftrightarrow 2 a^{2}+2 b c>a^{2}+b^{2}+c^{2} \\ & \Longleftrightarrow a^{2}>(b-c)^{2} \Longleftrightarrow a>|b-c|, \end{aligned} $$ which holds due to the assumption of $a, b, c$ being side lengths of a triangle. Problem 3. Determine all infinite sequences $\left(a_{1}, a_{2}, \ldots\right)$ of positive integers satisfying $$ a_{n+1}^{2}=1+(n+2021) a_{n} $$ for all $n \geq 1$. ![](https://cdn.mathpix.com/cropped/2024_04_17_e27e300a283338a2e031g-03.jpg?height=183&width=365&top_left_y=134&top_left_x=180) BALTIC WAY REYKJAVÍK$\cdot$ 2021 ## Baltic Way Reykjavík, November 11th - 15th Solutions Solution. Clearly $\left(a_{n}\right)_{n=1}^{\infty}=(n+2019)_{n=1}^{\infty}$ is a solution. We claim that it is the only one. Assume $\left(a_{n}\right)_{n=1}^{\infty}$ is a solution. Let $\left(b_{n}\right)_{n=1}^{\infty}=\left(a_{n}-n\right)_{n=1}^{\infty}$. We claim: 1) If $b_{n}<2019$, then $2019>b_{n+1}>b_{n}$. 2) If $b_{n}>2019$, then $2019x$ if $x>4$, so the pair $(x, f(x))$ cannot be a solution in this case either. Suppose that $(x, y) \in \mathbb{R}^{2}$ is a solution. According to the previous remark $x \in[0,4]$, and similarly, $y \in[0,4]$. Hence we may write $x=2+2 r$ and $y=2+2 s$ with $r, s \in[-1,1]$. After substitution and simplification, the equation $x=y(3-y)^{2}$ transforms into the equation $r=4 s^{3}-3 s$. Recall the trigonometric identities for threefold angles. If $s=\cos (\alpha)$ for some $\alpha \in \mathbb{R}$, then $r=4 \cos ^{3}(\alpha)-$ $3 \cos (\alpha)=\cos (3 \alpha)$. In the same way $s=4 r^{3}-3 r=\cos (9 \alpha)$. We can deduce that $9 \alpha=2 \pi m+\alpha$ or $9 \alpha=2 \pi l-\alpha$ for some integers $m$ and $l$. In the former case we have $8 \alpha=2 \pi m$, so that $m \in\{0,1,2,3,4\}$, and the corresponding possible pairs of solutions can be found in Figure 1. In the former case we have $10 \alpha=2 \pi l$, so that $l \in\{0,1,2,3,4,5\}$, where $l=0$ and $l=5$ result in angles that we have already considered in the first case. We consider the other options in Figure 2 taking into account the well-known identities $\cos (\pi / 5)=(1+\sqrt{5}) / 4$ and $\cos (3 \pi / 5)=(1-\sqrt{5}) / 4$. ## Baltic Way Reykjavík, November 11th - 15th Solutions | $m$ | $8 \alpha$ | $\alpha$ | $r$ | $s$ | $x$ | $y$ | $x+y$ | | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | | 0 | 0 | 0 | 1 | 1 | 4 | 4 | 8 | | 1 | $2 \pi$ | $\pi / 4$ | $\sqrt{2} / 2$ | $-\sqrt{2} / 2$ | $2+\sqrt{2}$ | $2-\sqrt{2}$ | 4 | | 2 | $4 \pi$ | $\pi / 2$ | 0 | 0 | 2 | 2 | 4 | | 3 | $6 \pi$ | $3 \pi / 4$ | $-\sqrt{2} / 2$ | $\sqrt{2} / 2$ | $2-\sqrt{2}$ | $2+\sqrt{2}$ | 4 | | 4 | $8 \pi$ | $\pi$ | -1 | -1 | 0 | 0 | 0 | Figure 1: Pairs of solutions and their sums | $l$ | $10 \alpha$ | $\alpha$ | $r$ | $s$ | $x$ | $y$ | $x+y$ | | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | | 1 | $2 \pi$ | $\pi / 5$ | $(1+\sqrt{5}) / 4$ | $(1-\sqrt{5}) / 4$ | $(5+\sqrt{5}) / 2$ | $(5-\sqrt{5}) / 2$ | 5 | | 2 | $4 \pi$ | $2 \pi / 5$ | $(-1+\sqrt{5}) / 4$ | $(-1-\sqrt{5}) / 4$ | $(3+\sqrt{5}) / 2$ | $(3-\sqrt{5}) / 2$ | 3 | | 3 | $6 \pi$ | $3 \pi / 5$ | $(1-\sqrt{5}) / 4$ | $(1+\sqrt{5}) / 4$ | $(5-\sqrt{5}) / 2$ | $(5+\sqrt{5}) / 2$ | 5 | | 4 | $8 \pi$ | $4 \pi / 5$ | $(-1-\sqrt{5}) / 4$ | $(-1+\sqrt{5}) / 4$ | $(3-\sqrt{5}) / 2$ | $(3+\sqrt{5}) / 2$ | 3 | Figure 2: Pairs of solutions and their sums Problem 6. Let $n$ be a positive integer and $t$ be a non-zero real number. Let $a_{1}, a_{2}, \ldots, a_{2 n-1}$ be real numbers (not necessarily distinct). Prove that there exist distinct indices $i_{1}, i_{2}, \ldots, i_{n}$ such that, for all $1 \leq k, l \leq n$, we have $a_{i_{k}}-a_{i_{l}} \neq t$. Solution. Let $G=(V, E)$ be a graph with vertex set $V=\{1,2, \ldots, 2 n-1\}$ and edge set $E=$ $\left\{\{i, j\}:\left|a_{i}-a_{j}\right|=t\right\}$. Note that $G$ has no odd cycles. Indeed, if $j_{1}, \ldots, j_{2 k+1}$ is a cycle, then for all $\ell=1,3,5, \ldots, 2 k-1$ the number $a_{j_{\ell}}$ differs from $a_{j_{\ell+2}}$ by $2 t$ or 0 . Hence $a_{j_{1}}$ differs from $a_{j_{2 k+1}}$ by an even multiple of $t$. Therefore there is no edge between $j_{1}$ and $j_{2 k+1}$ contradicting the assumption that $j_{1}, \ldots, j_{2 k+1}$ is a cycle. Since $G$ has no odd cycles, it is bipartite. Therefore $V$ can be split into two disjoint sets $V_{1}, V_{2}$ such that there is no edge between any two vertices of $V_{1}$ and there are no edges between any two vertices in $V_{2}$. Since $V$ has $2 n-1$ elements, one of the sets $V_{1}, V_{2}$ has at least $n$ elements. Without loss of generality assume that $V_{1}$ has at least $n$ elements. Then for $k=1,2, \ldots, n$ simply define $i_{k}$ to be the $k$-th least element of $V_{1}$. Problem 7. Let $n>2$ be an integer. Anna, Edda and Magni play a game on a hexagonal board tiled with regular hexagons, with $n$ tiles on each side. The figure shows a board with 5 tiles on each side. The central tile is marked. ## Baltic Way Reykjavík, November 11th - 15th Solutions The game begins with a stone on a tile in one corner of the board. Edda and Magni are on the same team, playing against Anna, and they win if the stone is on the central tile at the end of any player's turn. Anna, Edda and Magni take turns moving the stone: Anna begins, then Edda and then Magni, and so on. The rules for each player's turn are: - Anna has to move the stone to an adjacent tile, in any direction. ![](https://cdn.mathpix.com/cropped/2024_04_17_e27e300a283338a2e031g-08.jpg?height=386&width=425&top_left_y=495&top_left_x=1438) - Edda has to move the stone straight by two tiles in any of the 6 possible directions. - Magni has a choice of passing his turn, or moving the stone straight by three tiles in any of the 6 possible directions. Find all $n$ for which Edda and Magni have a winning strategy. Solution. We colour the board in three colours in such a way that no neighbouring tiles are of the same colour. We can give each hexagon a coordinate using $\overrightarrow{e_{1}}=(1,0)$ and $\overrightarrow{e_{2}}=\left(\cos \left(120^{\circ}, \sin \left(120^{\circ}\right)\right)=\right.$ $\left(\frac{-1}{2}, \frac{\sqrt{3}}{2}\right)$ as basis. Let the central tile be the origin. Then each hexagon has center at $a \cdot \overrightarrow{e_{1}}+b \cdot \overrightarrow{e_{2}},(a, b) \in$ $\mathbb{Z}^{2}$. The tuple $(a, b)$ is the coordinate for a given hexagon its neighbours are $(a+1, b),(a+1, b+1)$, $(a, b+1),(a-1, b),(a-1, b-1)$ and $(a, b-1)$. We colour the hexagon with coordinates $(a, b)$ with colour number $(a+b)(\bmod 3)$. It is clear that neighbouring hexagons do not share a colour. (In fact this is the only three colouring of a hexagonal tiling). See figure 3 . ![](https://cdn.mathpix.com/cropped/2024_04_17_e27e300a283338a2e031g-08.jpg?height=437&width=502&top_left_y=1712&top_left_x=777) Figure 3: Three colouring of the hexagonal tiling for 5 hexagons on each side We see that if $n \equiv 1(\bmod 3)$, the stone begins in a tile in the same colour as the central tile, let that colour be grey. By regarding a few cases, we see that whatever Anna does, Edda and Magni can end ![](https://cdn.mathpix.com/cropped/2024_04_17_e27e300a283338a2e031g-09.jpg?height=180&width=363&top_left_y=133&top_left_x=181) BALTIC WAY REYKJAVÍK$\cdot$ 2021 ## Baltic Way Reykjavík, November 11th - 15th Solutions their turns by getting the stone to a prescribed grey tile of the closest grey tiles. Therefore they can get the stone to the central tile. If $n \not \equiv 1(\bmod 3)$, the stone does not begin on the same grey colour as the central tile. Say the stone begins on a white tile, and say the third colour is black. Anna can always move the stone to a grey tile that is not on the same horizontal/diagonal line as the central tile. Then Anna moves the stone to a white or black tile. After Magni moves the stone is still again on a white/black tile. Anna can continue this indefinitely, with the stone never reaching the central tile. Problem 8. We are given a collection of $2^{2^{k}}$ coins, where $k$ is a non-negative integer. Exactly one coin is fake. We have an unlimited number of service dogs. One dog is sick but we do not know which one. A test consists of three steps: select some coins from the collection of all coins; choose a service dog; the dog smells all of the selected coins at once. A healthy dog will bark if and only if the fake coin is amongst them. Whether the sick dog will bark or not is random. Devise a strategy to find the fake coin, using at most $2^{k}+k+2$ tests, and prove that it works. Solution. Number the coins by $2^{k}$-digit binary numbers from $\overbrace{00 \ldots 0}^{\text {length } 2^{k}}$ to $\overbrace{11 \ldots 1}^{\text {length } 2^{k}}$. Let $A_{i}$ be the set of coins which have 0 in $i$-th position of the binary number. The first $2^{k}$ tests we perform with the help of $2^{k}$ different dogs. In the $i$-th test we determine whether the set $A_{i}$ contains the fake coin. With out loss of generality we may assume that the dogs determined that all the digits in the number of the fake coin are 0 's. Due to the possible presence of the sick dog in these tests, it means in fact that the binary number of the fake coin contains at most one 1 . $$ \text { length } 2^{k} $$ In the next test we let a new dog determine whether the coin $00 \ldots 0$ is genuine. If the new dog barks then the coin is really fake, for otherwise two dogs had given us a false answer. If the new dog does not bark we find a dog we have not used before to test the suspected coin. (i) If the last two dogs disagree one of them must be sick and hence the first $k$ dogs must be healthy. length $2^{k}$ In this case the coin $\overbrace{00 \ldots 0}$ is the fake one. (ii) If the last two dogs agree (by not barking) it follows that both of them are healthy. The reason is that if one of the last two dogs was sick and did not bark, it would mean that the first $k$ dogs were length $2^{k}$ healthy, implying that the coin $00 \ldots 0$ is fake, but then the other of the last two dogs is healthy and did not bark at the fake coin, a contradiction. ![](https://cdn.mathpix.com/cropped/2024_04_17_e27e300a283338a2e031g-10.jpg?height=180&width=365&top_left_y=133&top_left_x=180) ## Baltic Way Reykjavík, November 11th - 15th Solutions Therefore one of the first $2^{k}$ dogs gave a wrong verdict. In this case we have $2^{k}$ possible candidates for the fake coin. We can find the fake coin using the last dog and $k$ tests using binary search. It follows that no more than $2^{k}+k+2$ tests are needed. Problem 9. We are given 2021 points on a plane, no three of which are collinear. Among any 5 of these points, at least 4 lie on the same circle. Is it necessarily true that at least 2020 of the points lie on the same circle? Solution. The answer is positive. Let us first prove a lemma that if 4 points $A, B, C, D$ all lie on circle $\Gamma$ and some two points $X, Y$ do not lie on $\Gamma$, then these 6 points are pairs of intersections of three circles, circle $\Gamma$ and two other circles. Indeed, according to the problem statement there are 4 points among $A, B, C, X, Y$ which are concyclic. These 4 points must include points $X$ and $Y$ because if one of them is not, then the other one must lie on $\Gamma$. Without loss of generality, take $A, B, X, Y$ to lie on the same circle. Similarly for points $A, C, D, X, Y$ there must be 4 points which are concyclic. Analogously, they must include points $X$ and $Y$. Point $A$ cannot be one of them because two circles cannot have more than two common points. Therefore, points $C, D, X, Y$ are concyclic which proves the lemma. Let us first solve the problem for the case for which there exist 5 points which lie on one circle $\Gamma$. Label these points $A, B, C, D, E$. Let us assume that there exists two points which do not lie on $\Gamma$, label them $X$ and $Y$. According to the previously proven lemma, points $A, B, C, D, X, Y$ must be the pairwise intersections of 3 circles. Without loss of generality, let the intersections of $\Gamma$ with one of the other circles be $A$ and $B$ and with the other circle $C$ and $D$. Similarly, $A, B, C, E, X, Y$ must be the pairwise intersections of three circles one of which is $\Gamma$. This is not possible as none of the points $A, B, C$ lies on the circumcircle of triangle $E X Y$. This contradiction shows that at most 1 point can lie outside circle $\Gamma$, i.e. at least 2020 points lie on circle $\Gamma$. It remains to look at the case for which no 5 points lie on the same circle. Let $A, B, C, D, E$ be arbitrary 5 points. Without loss of generality, let $A, B, C, D$ be concyclic and $E$ a point not on this circle. According to the lemma, for every other point $F$ and points $A, B, C, D, E$, the 6 points are the intersections of circle $\Gamma$ and some two other circles. But in total, there are 3 such points because one of the two circles must go through $E$ and some 2 points out of $A, B, C, D$, while the other circle must go through point $E$ and the other two points out of $A, B, C, D$. There are only three partitions of $A, B, C, D$ into two sets. There is a contradiction, as there are $2021>5+3$ points in total. Problem 10. John has a string of paper where $n$ real numbers $a_{i} \in[0,1]$, for all $i \in\{1, \ldots, n\}$, are written in a row. Show that for any given $k\min \left(S_{1}, \ldots, S_{k}\right)+1$, let $S_{q}$ be the pieces with minimum sum of elements nearest to $S_{p}$ (ties broken arbitrarily) and let $S_{h}$ be the next pieces to $S_{q}$ between $S_{p}$ and $S_{q}$ (it is non empty by the choice of $S_{q}$ ). Then either $p$ $\min \left(S_{1}, \ldots, S_{k}\right)+1$. It is clear also that $\max \left(S_{1}, \ldots, S_{k}\right)$ does not increase during the algorithm. Note also that in step (3) the pieces $S_{h}$ may become empty. Then, in the next iteration of the algorithm, $q=h$ will be chosen since $\min \left(S_{1}, \ldots, S_{k}\right)=S_{h}=0$ and in step (3) $S_{h}^{\star}$ will become non empty (but one of its neighbours may become empty, etc.). Claim: In the algorithm above, Step (3) is repeated at most $k n$ times with $S_{p}$ being the same maximal pieces in $S^{\star}$ and in $S$. Proof. Let $s_{i}$ be the number of elements in $i$-th pieces. Then the number $$ \sum_{i=1}^{k}|i-p| s_{i} $$ takes positive integral values and is always less than $k n$. It is clear that this number decreases during the algorithm. ## Baltic Way Thus after at most $k n$ iteration of (3), the algorithm decreases the value of $S_{p}$ and so goes to (1). Consequently it decreases either the number of pieces with maximal sums or $\max \left(S_{1}, \ldots, S_{k}\right)$. As there are only finitely many ways to split the sum onto pieces, the algorithm eventually terminates at (2). When the algorithm teminates, we are left with a sequence $S=\left(S_{1}, S_{2}, \ldots, S_{k}\right)$ where the piece $S_{p}$ with maximum sum is such that $S_{p} \leq \min \left(S_{1}, \ldots, S_{k}\right)+1$. If there is an empty piece $S_{h}$ in the sequence, then the sum of any piece is in $[0,1]$. We can for any empty piece create a cut in any place between numbers where there was not previously a cut, and discard the empty pieces. This is possible since the cuts are $k \leq n-1$, and $n-1$ is the number of places in between numbers. This operation will only possibly decrease the maximum sum, and still all sums will be in $[0,1]$, so all conditions are satisfied. Solution 2. This problem can be solved by finding a certain graph having a directed path of length $k$. For real $x$ let $\left(V_{x}, E_{x}\right)$ be a directed graph having vertices $V_{x}=\{0,1, \ldots, n\}$. If $i, j \in V_{x}$ we have a directed edge $(i, j) \in V_{x}$ iff $i \leq j$ and $\sum_{l=i+1}^{j} \in[x, x+1]$. Suppose that for some $x \in \mathbb{R}$ there exist such a graph $\left(V_{x}, E_{x}\right)$ such that there exist a path of length $k$ from vertex 0 to vertex $n$. Let $0=v_{0}, v_{1}, \ldots, v_{k}=n$ be an path of length $k$. If we cut the paper string between numbers $v_{i}$ and $v_{i}+1$ for $i \in\{1, \ldots, k-1\}$ we have that the sum of the $i$-th part is $a_{v_{i-1}+1}+\ldots+a_{v_{i}} \in[x, x+1]$. In particular the sum of the number of each piece does not differ from the sum of any other piece by more than 1 . It is therefore evident that the statement of the problem is equivalent to the existence of a real $x$ such that there exists a path of length $k$ form vertex 0 to vertex $n$ in graph $\left(E_{x}, V_{x}\right)$. For a real $x$ let $s_{x}$ be the least vertex in $\left(V_{x}, E_{x}\right)$ such that there exists a path of length $k$ from 0 to $s_{x}$ and let $t_{x}$ be the greatest, provided that such a path exists. It is not difficult to prove (by induction on $k$ ) that for each vertex $v \in E_{x}$ such that $s_{x} \leq v \leq t_{x}$ there exists a path of length $k$ for 0 to $v$. Start with $x=0$. As $x$ increases both $s_{x}$ and $t_{x}$ increase. As there are only finitely many different sums formed by taking a subset of the $a_{i}$-s it follows that the graph $\left(V_{x}, E_{x}\right)$ changes at discrete values of $x$. It is not hard to see that if the graph makes one change between reals $x_{1}1$. ![](https://cdn.mathpix.com/cropped/2024_04_17_e27e300a283338a2e031g-21.jpg?height=183&width=363&top_left_y=134&top_left_x=184) ## Baltic Way Reykjavík, November 11th - 15th Solutions Remark. Note that $(a+b i)(x+y i)=(a x-b y)+(a y+b x) i$. Finding a solution to the system of equations is therefore equivalent to finding a factorization of $s+t i$ in Gaussian integers $\mathbb{Z}[i]$ with non-negative real and imaginary component. It is known that the Gaussian integers form a Euclidean domain and hence a unique factorization domain. The form for primes in $\mathbb{Z}[i]$ has been thoroughly studied. Problem 17. Distinct positive integers $a, b, c, d$ satisfy $$ \left\{\begin{array}{l} a \mid b^{2}+c^{2}+d^{2}, \\ b \mid a^{2}+c^{2}+d^{2}, \\ c \mid a^{2}+b^{2}+d^{2}, \\ d \mid a^{2}+b^{2}+c^{2}, \end{array}\right. $$ and none of them is larger than the product of the three others. What is the largest possible number of primes among them? Solution. At first we note that the given condition is equivalent to $a, b, c, d \mid a^{2}+b^{2}+c^{2}+d^{2}$. It is possible that three of the given numbers are primes, for example for $a=2, b=3, c=13$ and $d=26$. In this case $2^{2}+3^{2}+13^{2}+26^{2}=13 \cdot 66$ which is divisible by all four given numbers. Furthermore we will show that it is impossible that all four of them are primes. Let us assume that $a, b, c$ and $d$ are primes. As the sum $a^{2}+b^{2}+c^{2}+d^{2}$ is divisible by each of them then it is divisible also by their product $a b c d$. If one of the primes is equal to 2 , then we obtain a contradiction: the sum of four squares is odd, but its divisor $a b c d$ is even. Therefore all four primes are odd, and $a^{2}+b^{2}+c^{2}+d^{2}=0(\bmod 4)$. Hence $a^{2}+b^{2}+c^{2}+d^{2}$ is divisible by $4 a b c d$ which leads to a contradiction as it is easy to see that $a^{2}+b^{2}+c^{2}+d^{2}<4 a b c d$. Indeed, this is equivalent to $$ \frac{a}{b c d}+\frac{b}{a c d}+\frac{c}{a b d}+\frac{d}{a b c}<4 $$ which is true as none of the numbers exceed the product of three three other and equality can hold only for the largest of the four. Problem 18. Find all integer triples $(a, b, c)$ satisfying the equation $$ 5 a^{2}+9 b^{2}=13 c^{2} $$ ## Baltic Way Solutions Solution. Observe that $(a, b, c)=(0,0,0)$ is a solution. Assume that the equation has a solution $\left(a_{0}, b_{0}, c_{0}\right) \neq(0,0,0)$. Let $d=\operatorname{gcd}\left(a_{0}, b_{0}, c_{0}\right)>0$. Let $(a, b, c)=\left(a_{0} / d, b_{0} / d, c_{0} / d\right)$. Then $\operatorname{gcd}(a, b, c)$ $=1$. From $5 a_{0}{ }^{2}+9 b_{0}{ }^{2}=13 c_{0}{ }^{2}$ it follows that: $$ 5 a^{2}+9 b^{2}=5\left(\frac{a_{0}}{d}\right)^{2}+9\left(\frac{b_{0}}{d}\right)^{2}=\frac{5 a_{0}{ }^{2}+9 b_{0}{ }^{2}}{d^{2}}=\frac{13 c_{0}{ }^{2}}{d^{2}}=13\left(\frac{c_{0}}{d}\right)^{2}=13 c^{2} $$ hence $(a, b, c)$ is also a solution. As $\left(a_{0}, b_{0}, c_{0}\right) \neq(0,0,0)$ it follows that $(a, b, c) \neq(0,0,0)$. Consider the equation modulo 5. It follows that $4 b^{2} \equiv 5 a^{2}+9 b^{2}=13 c^{2} \equiv 3 c^{2}(\bmod 5)$, that is $4 b^{2} \equiv 3 c^{2}(\bmod 5)$. Multiplying by 4 gives: $$ b^{2} \equiv 16 b^{2}=4 \cdot 4 b^{2} \equiv 4 \cdot 3 c^{2}=12 c^{2} \equiv 2 \cdot c^{2} \quad(\bmod 5) $$ If $5 \mid c$ then $2 c^{2} \equiv 2 \cdot 0^{2}=0(\bmod 5)$ and therefore $a^{2} \equiv 0(\bmod 5)$, that is $5 \mid b^{2}$. As 5 is prime it follows that $5 \mid b$. Hence 5 divides $b$ and $c$. It follows that $5^{2} \mid 13 c^{2}-9 b^{2}=5 a^{2}$. Consequently 5 divides $a^{2}$. As 5 is prime, $5 \mid a$. This means that 5 divides $a, b$ and $c$ contradicting the fact that $\operatorname{gcd}(a, b, c)=1$. We conclude that $5 \mid c$ does not hold. As $5 \mid c$ does not hold and 5 is a prime it follows that $c$ and 5 are relative prime. Therefore there exists $x \in \mathbb{Z}$ such that $c \cdot x \equiv 1(\bmod 5)$. Multiplying by $x^{2}$ gives: $$ (b \cdot x)^{2}=b^{2} \cdot x^{2} \equiv 2 \cdot c^{2} \cdot x^{2}=2 \cdot(c \cdot x)^{2} \equiv 2 \cdot 1^{2}=2 $$ That is $y^{2} \equiv 2(\bmod 5)$ where $y=b \cdot x$. As $y^{2} \equiv 2(\bmod 5)$ it follows that $y$ and 5 are relative prime. By Fermat's little theorem it follows that $y^{4} \equiv 1(\bmod 5)$. Hence: $$ 1 \equiv y^{4}=\left(y^{2}\right)^{2} \equiv 2^{2}=4 \quad(\bmod 5) $$ but $1 \not \equiv 4(\bmod 5)$ so we have a contradiction. We conclude that the equation $5 a^{2}+9 b^{2}=13 c^{2}$ has no solution besides the solution $(a, b, c)=(0,0,0)$. Problem 19. Find all polynomials $p$ with integer coefficients such that the number $p(a)-p(b)$ is divisible by $a+b$ for all integers $a, b$, provided that $a+b \neq 0$. Solution. The polynomials we are looking for are those whose every odd-degree term has zero coefficient. Let $P(x)=P_{0}(x)+P_{1}(x)$, where $P_{0}$ and $P_{1}$ are polynomials whose all non-zero terms have either even or odd degree, respectively. Then we can write $P_{0}(x)=Q\left(x^{2}\right)$, where polynomial $Q$ is obtained from polynomial $P_{0}$ by dividing degrees of all non-zero terms by 2 . Now, for any integers $a, b$ the number $P_{0}(a)-P_{0}(b)=Q\left(a^{2}\right)-Q\left(b^{2}\right)$ ![](https://cdn.mathpix.com/cropped/2024_04_17_e27e300a283338a2e031g-23.jpg?height=180&width=363&top_left_y=133&top_left_x=181) BALTIC WAY REYKJAVÍK$\cdot$ 2021 ## Baltic Way Reykjavík, November 11th - 15th Solutions is divisible by $a^{2}-b^{2}$, and hence also by $a+b$. Thus, if every odd-degree term of $P$ has zero coefficient, then the condition of the problem is satisfied. On the other hand, if polynomial $P$ satisfies the condition of the problem, then also $P-P_{0}=P_{1}$ must satisfy it. Note that for every real $x, P_{1}(-x)=-P_{1}(x)$, i.e. $P_{1}$ is an odd function. By substituting $b$ by $-b$ in the condition of the problem we obtain that $a-b \mid P_{1}(a)+P_{1}(b)$ holds for any distinct integers $a$ and $b$. Since also $a-b \mid P_{1}(a)-P_{1}(b)$, then for any integers $a$, $b$ we have $a-b \mid 2 P_{1}(a)$. But for any $a$ there exists such $b$ that $|a-b|>2 P_{1}(a)$. From this we conclude that $P_{1}(a)=0$ for any integer $a$. Altogether we have $P=P_{0}$, i.e. coefficients of all odd-degree terms are zero. Problem 20. Let $n \geq 2$ be an integer. Given numbers $a_{1}, a_{2}, \ldots, a_{n} \in\{1,2,3, \ldots, 2 n\}$ such that $\operatorname{lcm}\left(a_{i}, a_{j}\right)>2 n$ for all $1 \leq i2 n$. In particular $b_{i} \neq b_{j}$. It follows that the map $\{1,2, \ldots, n\} \rightarrow\{n+1, n+2, \ldots, 2 n\}, i \mapsto b_{i}$ is injective. As both sets $\{1,2, \ldots, n\}$ and $\{n+1, n+2, \ldots, 2 n\}$ have the same finite cardinality it follows that the map is also a surjection and hence a bijection. In particular $b_{1} b_{2} \cdots b_{n}=(n+1)(n+2) \cdots(2 n)$ by associativity and commutativity. As each $a_{i} \mid b_{i}$ it follows that $$ a_{1} a_{2} \cdots a_{n} \mid b_{1} b_{2} \cdots b_{n}=(n+1)(n+2) \cdots(2 n) $$ as desired.