# Baltic Way 1998 ## Warsaw, November 8, 1998 ## Problems 1. Let $\mathbb{Z}^{+}$be the set of all positive integers. Find all functions $f: \mathbb{Z}^{+} \rightarrow \mathbb{Z}^{+}$ satisfying the following conditions for all $x, y \in \mathbb{Z}^{+}$: $$ \begin{aligned} f(x, x) & =x, \\ f(x, y) & =f(y, x), \\ (x+y) f(x, y) & =y f(x, x+y) . \end{aligned} $$ 2. A triple of positive integers $(a, b, c)$ is called quasi-Pythagorean if there exists a triangle with lengths of the sides $a, b, c$ and the angle opposite to the side $c$ equal to $120^{\circ}$. Prove that if $(a, b, c)$ is a quasi-Pythagorean triple then $c$ has a prime divisor greater than 5 . 3. Find all pairs of positive integers $x, y$ which satisfy the equation $$ 2 x^{2}+5 y^{2}=11(x y-11) \text {. } $$ 4. Let $P$ be a polynomial with integer coefficients. Suppose that for $n=1,2,3, \ldots, 1998$ the number $P(n)$ is a three-digit positive integer. Prove that the polynomial $P$ has no integer roots. 5. Let $a$ be an odd digit and $b$ an even digit. Prove that for every positive integer $n$ there exists a positive integer, divisible by $2^{n}$, whose decimal representation contains no digits other than $a$ and $b$. 6. Let $P$ be a polynomial of degree 6 and let $a, b$ be real numbers such that $01$ satisfies (1), then so does the reduced triple $\left(\frac{a}{d}, \frac{b}{d}, \frac{c}{d}\right)$. Hence it suffices to prove that in every irreducible quasi-Pythagorean triple the greatest term $c$ has a prime divisor greater than 5. Actually, we will show that in that case every prime divisor of $c$ is greater than 5 . Let $(a, b, c)$ be an irreducible triple satisfying (1). Note that then $a, b$ and $c$ are pairwise coprime. We have to show that $c$ is not divisible by 2,3 or 5 . If $c$ were even, then $a$ and $b$ (coprime to $c$ ) should be odd, and (1) would not hold. Suppose now that $c$ is divisible by 3 , and rewrite (1) as $$ 4 c^{2}=(a+2 b)^{2}+3 a^{2} $$ Then $a+2 b$ must be divisible by 3 . Since $a$ is coprime to $c$, the number $3 a^{2}$ is not divisible by 9 . This yields a contradiction since the remaining terms in (2) are divisible by 9 . Finally, suppose $c$ is divisible by 5 (and hence $a$ is not). Again we get a contradiction with (2) since the square of every integer is congruent to 0 , 1 or -1 modulo 5 ; so $4 c^{2}-3 a^{2} \equiv \pm 2(\bmod 5)$ and it cannot be equal to $(a+2 b)^{2}$. This completes the proof. Remark. A yet stronger claim is true: If $a$ and $b$ are coprime, then every prime divisor $p>3$ of $a^{2}+a b+b^{2}$ is of the form $p=6 k+1$. (Hence every prime divisor of $c$ in an irreducible quasi-Pythagorean triple $(a, b, c)$ has such a form.) This stronger claim can be proved by observing that $p$ does not divide $a$ and the number $g=(a+2 b) a^{(p-3) / 2}$ is an integer whose square satisfies $$ \begin{aligned} g^{2} & =(a+2 b)^{2} a^{p-3}=\left(4\left(a^{2}+a b+b^{2}\right)-3 a^{2}\right) a^{p-3} \equiv-3 a^{p-1} \equiv \\ & \equiv-3(\bmod p) \end{aligned} $$ Hence -3 is a quadratic residue modulo $p$. This is known to be true only for primes of the form $6 k+1$; proofs can be found in many books on number theory, e.g. [1]. Reference. [1] K. Ireland, M. Rosen, A Classical Introduction to Modern Number Theory, Second Edition, Springer-Verlag, New York 1990. 3. Answer: $x=14, y=27$. Rewriting the equation as $2 x^{2}-x y+5 y^{2}-10 x y=-121$ and factoring we get: $$ (2 x-y) \cdot(5 y-x)=121 . $$ Both factors must be of the same sign. If they were both negative, we would have $2 x0$, the function $f(t)$ is strictly convex on $(0, \infty)$. Consequently, $$ \begin{aligned} \frac{1}{\cos \gamma} & =\sqrt{1+\tan ^{2} \gamma}=f(\tan \gamma)=f\left(\frac{\tan \alpha+\tan \beta}{2}\right)< \\ & <\frac{f(\tan \alpha)+f(\tan \beta)}{2}=\frac{1}{2}\left(\frac{1}{\cos \alpha}+\frac{1}{\cos \beta}\right)=\frac{1}{\cos \delta}, \end{aligned} $$ and hence $\gamma<\delta$. Remark. The use of calculus can be avoided. We only need the midpointconvexity of $f$, i.e., the inequality $$ \sqrt{1+\frac{1}{4}(u+v)^{2}}<\frac{1}{2} \sqrt{1+u^{2}}+\frac{1}{2} \sqrt{1+v^{2}} $$ for $u, v>0$ and $u \neq v$, which is equivalent (via squaring) to $$ 1+u v<\sqrt{\left(1+u^{2}\right)\left(1+v^{2}\right)} . $$ The latter inequality reduces (again by squaring) to $2 u v|P Q|=2 \cdot|P C|=\frac{2}{\cos \gamma}, $$ and hence $\delta>\gamma$. Another solution. Set $x=\frac{\alpha+\beta}{2}$ and $y=\frac{\alpha-\beta}{2}$, then $\alpha=x+y, \beta=x-y$ and $$ \begin{aligned} \cos \alpha \cos \beta & =\frac{1}{2}(\cos 2 x+\cos 2 y)= \\ & =\frac{1}{2}\left(1-2 \sin ^{2} x\right)+\frac{1}{2}\left(2 \cos ^{2} y-1\right)=\cos ^{2} y-\sin ^{2} x . \end{aligned} $$ By the conditions of the problem, $$ \tan \gamma=\frac{1}{2}\left(\frac{\sin \alpha}{\cos \alpha}+\frac{\sin \beta}{\cos \beta}\right)=\frac{1}{2} \cdot \frac{\sin (\alpha+\beta)}{\cos \alpha \cos \beta}=\frac{\sin x \cos x}{\cos \alpha \cos \beta} $$ and $$ \frac{1}{\cos \delta}=\frac{1}{2}\left(\frac{1}{\cos \alpha}+\frac{1}{\cos \beta}\right)=\frac{1}{2} \cdot \frac{\cos \alpha+\cos \beta}{\cos \alpha \cos \beta}=\frac{\cos x \cos y}{\cos \alpha \cos \beta} . $$ Using (3) we hence obtain $$ \begin{aligned} \tan ^{2} \delta-\tan ^{2} \gamma & =\frac{1}{\cos ^{2} \delta}-1-\tan ^{2} \gamma=\frac{\cos ^{2} x \cos ^{2} y-\sin ^{2} x \cos ^{2} x}{\cos ^{2} \alpha \cos ^{2} \beta}-1= \\ & =\frac{\cos ^{2} x\left(\cos ^{2} y-\sin ^{2} x\right)}{\left(\cos ^{2} y-\sin ^{2} x\right)^{2}}-1=\frac{\cos ^{2} x}{\cos ^{2} y-\sin ^{2} x}-1= \\ & =\frac{\cos ^{2} x-\cos ^{2} y+\sin ^{2} x}{\cos ^{2} y-\sin ^{2} x}=\frac{\sin ^{2} y}{\cos \alpha \cos \beta}>0, \end{aligned} $$ showing that $\delta>\gamma$. 10. For simplicity, take the length of the circle to be $2 n(n-1)$ rather than $2 \pi$. The vertices of the $(n-1)$-gon $A_{0} A_{1} \ldots A_{n-2}$ divide it into $n-1$ arcs of length $2 n$. By the pigeonhole principle, some two of the vertices of the $n$-gon $B_{0} B_{1} \ldots B_{n-1}$ lie in the same arc. Assume w.l.o.g. that $B_{0}$ and $B_{1}$ lie in the arc $A_{0} A_{1}$, with $B_{0}$ closer to $A_{0}$ and $B_{1}$ closer to $A_{1}$, and that $\left|A_{0} B_{0}\right| \leqslant\left|B_{1} A_{1}\right|$. Consider the circle as the segment $[0,2 n(n-1)]$ of the real line, with both of its endpoints identified with the vertex $A_{0}$ and the numbers $2 n, 4 n, 6 n, \ldots$ identified accordingly with the vertices $A_{1}, A_{2}, A_{3}, \ldots$ For $k=0,1, \ldots, n-1$, let $x_{k}$ be the "coordinate" of the vertex $B_{k}$ of the $n$-gon. Each arc $B_{k} B_{k+1}$ has length $2(n-1)$. By the choice of labelling, we have $$ 0 \leqslant x_{0}10$, as no tile is allowed to extend beyond the edge of the board. But then $b_{13}=a_{10}$ must be both even and odd, a contradiction. Alternative solution. Colour the squares of the board black and white in the following pattern. In the first (top) row, let the two leftmost squares be black, the next two be white, the next two black, the next two white, and so on (at the right end there remains a single black square). In the second row, let the colouring be reciprocal to that of the first row (two white squares, two black squares, and so on). If the rows are labelled by 1 through 13 , let all the odd-indexed rows be coloured as the first row, and all the even-indexed ones as the second row (see Figure 7). Note that there are more black squares than white squares in the board. Each $4 \times 1$ tile, no matter how placed, covers two black squares and two white squares. Thus if a tiling leaves a single square uncovered, this square must be black. But the central square of the board is white. Hence such a tiling is impossible. Another solution. Colour the squares in four colours as follows: colour all squares in the 1-st column green, all squares in the 2-nd column black, all squares in the 3 -rd column white, all squares in the 4 -th column red, all squares in the 5 -th column green, all squares in the 6 -th column black etc., leaving only the central square uncoloured (see Figure 8). Altogether we have $3 \cdot 13=39$ black squares and $3 \cdot 13-1=38$ white squares. Since each $4 \times 1$ tile covers either one square of each colour or all four squares of the same colour, then the difference of the numbers of black and white squares must be divisible by 4 . Since $39-38=1$ is not divisible by 4 , the required tiling does not exist. ![](https://cdn.mathpix.com/cropped/2024_04_17_265f402a46c0191f8856g-16.jpg?height=510&width=520&top_left_y=423&top_left_x=174) Figure 7 G BWR G B WR G BWR G ![](https://cdn.mathpix.com/cropped/2024_04_17_265f402a46c0191f8856g-16.jpg?height=500&width=504&top_left_y=432&top_left_x=785) Figure 8 17. If $k=1$, it is obvious how to do the packing. Now assume $k>1$. There are not more than $n$ objects of a certain colour - say, pink - and also not fewer than $n$ objects of some other colour - say, grey. Pack all pink objects into one box; if there is space left, fill the box up with grey objects. Then remove that box together with its contents; the problem gets reduced to an analogous one with $k-1$ boxes and $k-1$ colours. Assuming inductively that the task can be done in that case, we see that it can also be done for $k$ boxes and colours. The general result follows by induction. 18. Answer: all integers $n \geqslant 4$. Direct search shows that there is no such set $S$ for $n=1,2,3$. For $n=4$ we can take $S=\{3,5,6,7\}$. If, for a certain $n \geqslant 4$ we have a set $S=\left\{a_{1}, a_{2}, \ldots, a_{n}\right\}$ as needed, then the set $S^{*}=\left\{1,2 a_{1}, 2 a_{2}, \ldots, 2 a_{n}\right\}$ satisfies the requirements for $n+1$. Hence a set with the required properties exists if and only if $n \geqslant 4$. 19. We start with the following observation: In a match between two teams (not necessarily of equal sizes), there exists in one of the teams a player who won his games with at least half of the members of the other team. Indeed: suppose there is no such player. If the teams consist of $m$ and $n$ members then the players of the first team jointly won less than $m \cdot \frac{n}{2}$ games, and the players of the second team jointly won less than $m \cdot \frac{n}{2}$ games - this is a contradiction since the total number of games played is $m n$, and in each game there must have been a winner. Returning to the original problem (with two equal teams of size 1000), choose a player who won his games with at least half of the members of the other team - such a player exists, according to the observation above, and we shall call his team "first" and the other team "second" in the sequel. Mark this player with a white hat and remove from further consideration all those players of the second team who lost their games to him. Applying the same observation to the first team (complete) and the second team truncated as explained above, we again find a player (in the first or in the second team) who won with at least half of the other team members. Mark him with a white hat, too, and remove the players who lost to him from further consideration. We repeat this procedure until there are no players left in one of the teams; say, in team $Y$. This means that the white-hatted players of team $X$ constitute a group with the required property (every member of team $Y$ has lost his game to at least one player from that group). Each time when a player of team $X$ was receiving a white hat, the size of team $Y$ was reduced at least by half; and since initially the size was a number less than $2^{10}$, this could not happen more than ten times. Hence the white-hatted group from team $X$ consists of not more than ten players. If there are fewer than ten, round the group up to ten with any players. 20. Answer: 1. Let $1 \leqslant g