exam: BalticWay

problem:
Solve the system of equations

$$
\left\{\begin{array}{l}
a^{3}+3 a b^{2}+3 a c^{2}-6 a b c=1 \\
b^{3}+3 b a^{2}+3 b c^{2}-6 a b c=1 \\
c^{3}+3 c a^{2}+3 c b^{2}-6 a b c=1
\end{array}\right.
$$

in real numbers.

Answer: $a=1, b=1, c=1$.

solution:
Denoting the left hand sides of the given equations as $A, B$ and $C$, the following equalities can easily be seen to hold:

$$
\begin{aligned}
-A+B+C & =(-a+b+c)^{3} \\
A-B+C & =(a-b+c)^{3} \\
A+B-C & =(a+b-c)^{3} .
\end{aligned}
$$

Hence, the system of equations given in the problem is equivalent to the following one:

$$
\left\{\begin{array}{c}
(-a+b+c)^{3}=1 \\
(a-b+c)^{3}=1 \\
(a+b-c)^{3}=1
\end{array}\right.
$$

which gives

$$
\left\{\begin{array}{c}
-a+b+c=1 \\
a-b+c=1 \\
a+b-c=1
\end{array} .\right.
$$

The unique solution of this system is $(a, b, c)=(1,1,1)$.

solution_match: Solution.


problem:
Let $a, b, c, d$ be real numbers such that

$$
\begin{aligned}
a+b+c+d & =-2 \\
a b+a c+a d+b c+b d+c d & =0
\end{aligned}
$$

Prove that at least one of the numbers $a, b, c, d$ is not greater than -1 .

solution:
We can assume that $a$ is the least among $a, b, c, d$ (or one of the least, if some of them are equal), there are $n>0$ negative numbers among $a, b, c, d$, and the sum of the positive ones is $x$.

Then we obtain

$$
-2=a+b+c+d \geqslant n a+x .
$$

Squaring we get

$$
4=a^{2}+b^{2}+c^{2}+d^{2}
$$

which implies

$$
4 \leqslant n \cdot a^{2}+x^{2}
$$

as the square of the sum of positive numbers is not less than the sum of their squares.

Combining inequalities (1) and (2) we obtain

$$
\begin{aligned}
n a^{2}+(n a+2)^{2} & \geqslant 4, \\
n a^{2}+n^{2} a^{2}+4 n a & \geqslant 0, \\
a^{2}+n a^{2}+4 a & \geqslant 0 .
\end{aligned}
$$

As $n \leqslant 3$ (if all the numbers are negative, the second condition of the problem cannot be satisfied), we obtain from the last inequality that

$$
\begin{aligned}
& 4 a^{2}+4 a \geqslant 0, \\
& a(a+1) \geqslant 0 .
\end{aligned}
$$

As $a<0$ it follows that $a \leqslant-1$.

Alternative solution. Assume that $a, b, c, d>-1$. Denoting $A=a+1, B=b+1, C=c+1, D=d+1$ we have $A, B, C, D>0$. Then the first equation gives

$$
A+B+C+D=2 \text {. }
$$

We also have

$$
a b=(A-1)(B-1)=A B-A-B+1 .
$$

Adding 5 similar terms to the last one we get from the second equation

$$
A B+A C+A D+B C+B D+C D-3(A+B+C+D)+6=0 .
$$

In view of (3) this implies

$$
A B+A C+A D+B C+B D+C D=0,
$$

a contradiction as all the unknowns $A, B, C, D$ were supposed to be positive.

Another solution. Assume that the conditions of the problem hold:

$$
\begin{aligned}
a+b+c+d & =-2 \\
a b+a c+a d+b c+b d+c d & =0 .
\end{aligned}
$$

Suppose that

$$
a, b, c, d>-1 \text {. }
$$

If all of $a, b, c, d$ were negative, then (5) could not be satisfied, so at most three of them are negative. If two or less of them were negative, then (6) would imply that the sum of negative numbers, and hence also the sum $a+b+c+d$, is greater than $2 \cdot(-1)=-2$, which contradicts (4). So exactly three of $a, b, c, d$ are negative and one is nonnegative. Let $d$ be the nonnegative one. Then $d=-2-(a+b+c)<-2-(-1-1-1)=1$. Obviously $|a|,|b|,|c|,|d|<1$. Squaring (4) and subtracting 2 times (5), we get

$$
a^{2}+b^{2}+c^{2}+d^{2}=4,
$$

but

$$
a^{2}+b^{2}+c^{2}+d^{2}=|a|^{2}+|b|^{2}+|c|^{2}+|d|^{2}<4,
$$

a contradiction.


problem:
Find all sequences $a_{0} \leqslant a_{1} \leqslant a_{2} \leqslant \ldots$ of real numbers such that

$$
a_{m^{2}+n^{2}}=a_{m}^{2}+a_{n}^{2}
$$

for all integers $m, n \geqslant 0$.

Answer: $a_{n} \equiv 0, a_{n} \equiv \frac{1}{2}$ and $a_{n}=n$.

solution:
Denoting $f(n)=a_{n}$ we have

$$
f\left(m^{2}+n^{2}\right)=f^{2}(m)+f^{2}(n) .
$$

Substituting $m=n=0$ into (7) we get $f(0)=2 f^{2}(0)$, hence either $f(0)=\frac{1}{2}$ or $f(0)=0$. We consider these cases separately.

(1) If $f(0)=\frac{1}{2}$ then substituting $m=1$ and $n=0$ into (7) we obtain $f(1)=f^{2}(1)+\frac{1}{4}$, whence $\left(f(1)-\frac{1}{2}\right)^{2}=0$ and $f(1)=\frac{1}{2}$. Now,

$$
\begin{aligned}
& f(2)=f\left(1^{2}+1^{2}\right)=2 f^{2}(1)=\frac{1}{2}, \\
& f(8)=f\left(2^{2}+2^{2}\right)=2 f^{2}(2)=\frac{1}{2},
\end{aligned}
$$

etc, implying that $f\left(2^{i}\right)=\frac{1}{2}$ for arbitrarily large natural $i$ and, due to monotonity, $f(n)=\frac{1}{2}$ for every natural $n$.

(2) If $f(0)=0$ then by substituting $m=1, n=0$ into (7) we obtain $f(1)=f^{2}(1)$ and hence, $f(1)=0$ or $f(1)=1$. This gives two subcases.

(2a) If $f(0)=0$ and $f(1)=0$ then by the same technique as above we see that $f\left(2^{i}\right)=0$ for arbitrarily large natural $i$ and, due to monotonity, $f(n)=0$ for every natural $n$.

(2b) If $f(0)=0$ and $f(1)=1$ then we compute

$$
\begin{aligned}
& f(2)=f\left(1^{2}+1^{2}\right)=2 f^{2}(1)=2, \\
& f(4)=f\left(2^{2}+0^{2}\right)=f^{2}(2)=4, \\
& f(5)=f\left(2^{2}+1^{2}\right)=f^{2}(2)+f^{2}(1)=5 .
\end{aligned}
$$

Now,

$$
f^{2}(3)+f^{2}(4)=f(25)=f^{2}(5)+f^{2}(0)=25,
$$

hence $f^{2}(3)=25-16=9$ and $f(3)=3$. Further,

$$
\begin{aligned}
f(8) & =f\left(2^{2}+2^{2}\right)=2 f^{2}(2)=8 \\
f(9) & =f\left(3^{2}+0^{2}\right)=f^{2}(3)=9 \\
f(10) & =f\left(3^{2}+1^{2}\right)=f^{2}(3)+f^{2}(1)=10
\end{aligned}
$$

From the equalities

$$
\begin{aligned}
& f^{2}(6)+f^{2}(8)=f^{2}(10)+f^{2}(0), \\
& f^{2}(7)+f^{2}(1)=f^{2}(5)+f^{2}(5)
\end{aligned}
$$

we also conclude that $f(6)=6$ and $f(7)=7$. It remains to note that

$$
\begin{aligned}
& (2 k+1)^{2}+(k-2)^{2}=(2 k-1)^{2}+(k+2)^{2}, \\
& (2 k+2)^{2}+(k-4)^{2}=(2 k-2)^{2}+(k+4)^{2}
\end{aligned}
$$

and by induction it follows that $f(n)=n$ for every natural $n$.


problem:
Let $n$ be a positive integer. Prove that

$$
\sum_{i=1}^{n} x_{i}\left(1-x_{i}\right)^{2} \leqslant\left(1-\frac{1}{n}\right)^{2}
$$

for all nonnegative real numbers $x_{1}, x_{2}, \ldots, x_{n}$ such that $x_{1}+x_{2}+\cdots+x_{n}=1$.

solution:
Expanding the expressions at both sides we obtain the equivalent inequality

$$
-\sum_{i} x_{i}^{3}+2 \sum_{i} x_{i}^{2}-\frac{2}{n}+\frac{1}{n^{2}} \geqslant 0
$$

It is easy to check that the left hand side is equal to

$$
\sum_{i}\left(2-\frac{2}{n}-x_{i}\right)\left(x_{i}-\frac{1}{n}\right)^{2}
$$

and hence is nonnegative.

Alternative solution. First note that for $n=1$ the required condition holds trivially, and for $n=2$ we have

$$
x(1-x)^{2}+(1-x) x^{2}=x(1-x) \leqslant\left(\frac{x+(1-x)}{2}\right)^{2}=\frac{1}{4}=\left(1-\frac{1}{2}\right)^{2} .
$$

So we may further consider the case $n \geqslant 3$.

Assume first that for each index $i$ the inequality $x_{i}<\frac{2}{3}$ holds. Let $f(x)=x(1-x)^{2}=x-2 x^{2}+x^{3}$, then $f^{\prime \prime}(x)=6 x-4$. Hence, the function $f$ is concave in the interval $\left[0, \frac{2}{3}\right]$. Thus, from Jensen's inequality we have

$$
\begin{aligned}
\sum_{i=1}^{n} x_{i}\left(1-x_{i}\right)^{2} & =\sum_{i=1}^{n} f\left(x_{i}\right) \leqslant n \cdot f\left(\frac{x_{1}+\ldots+x_{n}}{n}\right)=n \cdot f\left(\frac{1}{n}\right)= \\
& =n \cdot \frac{1}{n}\left(1-\frac{1}{n}\right)^{2}=\left(1-\frac{1}{n}\right)^{2} .
\end{aligned}
$$

If some $x_{i} \geqslant \frac{2}{3}$ then we have

$$
x_{i}\left(1-x_{i}\right)^{2} \leqslant 1 \cdot\left(1-\frac{2}{3}\right)^{2}=\frac{1}{9}
$$

For the rest of the terms we have

$$
\sum_{j \neq i} x_{j}\left(1-x_{j}\right)^{2} \leqslant \sum_{j \neq i} x_{j}=1-x_{i} \leqslant \frac{1}{3}
$$

Hence,

$$
\sum_{i=1}^{n} x_{i}\left(1-x_{i}\right)^{2} \leqslant \frac{1}{9}+\frac{1}{3}=\frac{4}{9} \leqslant\left(1-\frac{1}{n}\right)^{2}
$$

as $n \geqslant 3$.


problem:
Find all pairs $(a, b)$ of positive rational numbers such that

$$
\sqrt{a}+\sqrt{b}=\sqrt{2+\sqrt{3}} .
$$

Answer: $(a, b)=\left(\frac{1}{2}, \frac{3}{2}\right)$ or $(a, b)=\left(\frac{3}{2}, \frac{1}{2}\right)$.

solution:
Squaring both sides of the equation gives

$$
a+b+2 \sqrt{a b}=2+\sqrt{3}
$$

so $2 \sqrt{a b}=r+\sqrt{3}$ for some rational number $r$. Squaring both sides of this gives $4 a b=r^{2}+3+2 r \sqrt{3}$, so $2 r \sqrt{3}$ is rational, which implies $r=0$. Hence $a b=3 / 4$ and substituting this into (8) gives $a+b=2$. Solving for $a$ and $b$ gives $(a, b)=\left(\frac{1}{2}, \frac{3}{2}\right)$ or $(a, b)=\left(\frac{3}{2}, \frac{1}{2}\right)$.


problem:
The following solitaire game is played on an $m \times n$ rectangular board, $m, n \geqslant 2$, divided into unit squares. First, a rook is placed on some square. At each move, the rook can be moved an arbitrary number of squares horizontally or vertically, with the extra condition that each move has to be made in the $90^{\circ}$ clockwise direction compared to the previous one (e.g. after a move to the left, the next one has to be done upwards, the next one to the right etc). For which values of $m$ and $n$ is it possible that the rook visits every square of the board exactly once and returns to the first square? (The rook is considered to visit only those squares it stops on, and not the ones it steps over.)

Answer: $m, n \equiv 0 \bmod 2$.

solution:
First, consider any row that is not the row where the rook starts from. The rook has to visit all the squares of that row exactly once, and on its tour around the board, every time it visits this row, exactly two squares get visited. Hence, $m$ must be even; a similar argument for the columns shows that $n$ must also be even.

It remains to prove that for any even $m$ and $n$ such a tour is possible. We will show it by an inductionlike argument. Labelling the squares with pairs of integers $(i, j)$, where $1 \leqslant i \leqslant m$ and $1 \leqslant j \leqslant n$, we start moving from the square $(m / 2+1,1)$ and first cover all the squares of the top and bottom rows in the order shown in the figure below, except for the squares $(m / 2-1, n)$ and $(m / 2+1, n)$; note that we finish on the square $(m / 2-1,1)$.

![](https://cdn.mathpix.com/cropped/2024_04_17_0d7b2527e7110b7d89ceg-05.jpg?height=363&width=479&top_left_y=1600&top_left_x=363)

The next square to visit will be $(m / 2-1, n-1)$ and now we will cover the rows numbered 2 and $n-1$, except for the two middle squares in row 2 . Continuing in this way we can visit all the squares except for the two middle squares in every second row (note that here we need the assumption that $m$ and $n$ are even):

| 3 | 7 |  |  | 8 | 4 |
| :---: | :---: | :---: | :---: | :---: | :---: |
| 15 | 19 | 11 | 20 | 16 | 12 |
| 23 | 27 |  |  | 28 | 24 |
| 35 | 39 | 31 | 40 | 36 | 32 |
| 34 | 38 |  |  | 37 | 33 |
| 22 | 26 | 30 | 21 | 29 | 25 |
| 14 | 18 |  |  | 17 | 13 |
| 2 | 6 | 10 | 1 | 9 | 5 |

The rest of the squares can be visited easily:

| 3 | 7 | 47 | 48 | 8 | 4 |
| :---: | :---: | :---: | :---: | :---: | :---: |
| 15 | 19 | 11 | 20 | 16 | 12 |
| 23 | 27 | 43 | 44 | 28 | 24 |
| 35 | 39 | 31 | 40 | 36 | 32 |
| 34 | 38 | 42 | 41 | 37 | 33 |
| 22 | 26 | 30 | 21 | 29 | 25 |
| 14 | 18 | 46 | 45 | 17 | 13 |
| 2 | 6 | 10 | 1 | 9 | 5 |


problem:
We draw $n$ convex quadrilaterals in the plane. They divide the plane into regions (one of the regions is infinite). Determine the maximal possible number of these regions.

Answer: The maximal number of regions is $4 n^{2}-4 n+2$.

solution:
One quadrilateral produces two regions. Suppose we have drawn $k$ quadrilaterals $Q_{1}, \ldots, Q_{k}$ and produced $a_{k}$ regions. We draw another quadrilateral $Q_{k+1}$ and try to evaluate the number of regions $a_{k+1}$ now produced. Our task is to make $a_{k+1}$ as large as possible. Note that in a maximal configuration, no vertex of any $Q_{i}$ can be located on the edge of another quadrilateral as otherwise we could move this vertex a little bit to produce an extra region.

Because of this fact and the convexity of the $Q_{j}$ 's, any one of the four sides of $Q_{k+1}$ meets at most two sides of any $Q_{j}$. So the sides of $Q_{k+1}$ are divided into at most $2 k+1$ segments, each of which potentially grows the number of regions by one (being part of the common boundary of two parts, one of which is counted in $a_{k}$ ).

But if a side of $Q_{k+1}$ intersects the boundary of each $Q_{j}, 1 \leqslant j \leqslant k$ twice, then its endpoints (vertices of $Q_{k+1}$ ) are in the region outside of all the $Q_{j}$-s, and the the segments meeting at such a vertex are on the boundary of a single new part (recall that it makes no sense to put vertices on edges of another quadrilaterals). This means that $a_{k+1}-a_{k} \leqslant 4(2 k+1)-4=8 k$. By considering squares inscribed in a circle one easily sees that the situation where $a_{k+1}-a_{k}=8 k$ can be reached.

It remains to determine the expression for the maximal $a_{k}$. Since the difference $a_{k+1}-a_{k}$ is linear in $k, a_{k}$ is a quadratic polynomial in $k$, and $a_{0}=2$. So $a_{k}=A k^{2}+B k+2$. We have $8 k=a_{k+1}-a_{k}=A(2 k+1)+B$ for all $k$. This implies $A=4, B=-4$, and $a_{n}=4 n^{2}-4 n+2$.


problem:
Let $P$ be a set of $n \geqslant 3$ points in the plane, no three of which are on a line. How many possibilities are there to choose a set $T$ of $\left(\begin{array}{c}n-1 \\ 2\end{array}\right)$ triangles, whose vertices are all in $P$, such that each triangle in $T$ has a side that is not a side of any other triangle in $T$ ?

Answer: There is one possibility for $n=3$ and $n$ possibilities for $n \geqslant 4$.

solution:
For a fixed point $x \in P$, let $T_{x}$ be the set of all triangles with vertices in $P$ which have $x$ as a vertex. Clearly, $\left|T_{x}\right|=\left(\begin{array}{c}n-1 \\ 2\end{array}\right)$, and each triangle in $T_{x}$ has a side which is not a side of any other triangle in $T_{x}$. For any $x, y \in P$ such that $x \neq y$, we have $T_{x} \neq T_{y}$ if and only if $n \geqslant 4$. We will show that any possible set $T$ is equal to $T_{x}$ for some $x \in P$, i.e. that the answer is 1 for $n=3$ and $n$ for $n \geqslant 4$.

Let

$$
T=\left\{t_{i}: i=1,2, \ldots,\left(\begin{array}{c}
n-1 \\
2
\end{array}\right)\right\}, \quad S=\left\{s_{i}: i=1,2, \ldots,\left(\begin{array}{c}
n-1 \\
2
\end{array}\right)\right\}
$$

such that $T$ is a set of triangles whose vertices are all in $P$, and $s_{i}$ is a side of $t_{i}$ but not of any $t_{j}$, $j \neq i$. Furthermore, let $C$ be the collection of all the $\left(\begin{array}{l}n \\ 3\end{array}\right)$ triangles whose vertices are in $P$. Note that

$$
|C \backslash T|=\left(\begin{array}{c}
n \\
3
\end{array}\right)-\left(\begin{array}{c}
n-1 \\
2
\end{array}\right)=\left(\begin{array}{c}
n-1 \\
3
\end{array}\right)
$$

Let $m$ be the number of pairs $(s, t)$ such that $s \in S$ is a side of $t \in C \backslash T$. Since every $s \in S$ is a side of exactly $n-3$ triangles from $C \backslash T$, we have

$$
m=|S| \cdot(n-3)=\left(\begin{array}{c}
n-1 \\
2
\end{array}\right) \cdot(n-3)=3 \cdot\left(\begin{array}{c}
n-1 \\
3
\end{array}\right)=3 \cdot|C \backslash T|
$$

On the other hand, every $t \in C \backslash T$ has at most three sides from $S$. By the above equality, for every $t \in C \backslash T$, all its sides must be in $S$.

Assume that for $p \in P$ there is a side $s \in S$ such that $p$ is an endpoint of $s$. Then $p$ is also a vertex of each of the $n-3$ triangles in $C \backslash T$ which have $s$ as a side. Consequently, $p$ is an endpoint of $n-2$ sides in $S$. Since every side in $S$ has exactly 2 endpoints, the number of points $p \in P$ which occur as a vertex of some $s \in S$ is

$$
\frac{2 \cdot|S|}{n-2}=\frac{2}{n-2} \cdot\left(\begin{array}{c}
n-1 \\
2
\end{array}\right)=n-1
$$

Consequently, there is an $x \in P$ which is not an endpoint of any $s \in S$, and hence $T$ must be equal to $T_{x}$.


problem: Two magicians show the following trick. The first magician goes out of the room. The second magician takes a deck of 100 cards labelled by numbers $1,2, \ldots, 100$ and asks three spectators to choose in turn one card each. The second magician sees what card each spectator has taken. Then he adds one more card from the rest of the deck. Spectators shuffle these 4 cards, call the first magician and give him these 4 cards. The first magician looks at the 4 cards and "guesses" what card was chosen by the first spectator, what card by the second and what card by the third. Prove that the magicians can perform this trick.

solution:
We will identify ourselves with the second magician. Then we need to choose a card in such a manner that another magician will be able to understand which of the 4 cards we have chosen and what information it gives about the order of the other cards. We will reach these two goals independently.

Let $a, b, c$ be remainders of the labels of the spectators' three cards modulo 5 . There are three possible cases.

1) All the three remainders coincide. Then choose a card with a remainder not equal to the remainder of spectators' cards. Denote this remainder $d$.

Note that we now have 2 different remainders, one of them in 3 copies (this will be used by the first magician to distinguish betwwen the three cases). To determine which of the cards is chosen by us is now a simple exercise in division by 5 . But we must also encode the ordering of the spectators' cards. These cards have a natural ordering by their labels, and they are also ordered by their belonging to the spectators. Thus, we have to encode a permutation of 3 elements. There are 6 permutations of 3 elements, let us enumerate them somehow. Then, if we want to inform the first magician that spectators form a permutation number $k$ with respect to the natural ordering, we choose the card number $5 k+d$.

2) The remainders $a, b, c$ are pairwise different. Then it is clear that exactly one of the following possibilities takes place:

$$
\text { either }|b-a|=|a-c| \text {, or }|a-b|=|b-c| \text {, or } \quad|a-c|=|c-b|
$$

(the equalities are considered modulo 5). It is not hard to prove it by a case study, but one could also imagine choosing three vertices of a regular pentagon - these vertices always form an isosceles, but not an equilateral triangle.

Each of these possibilities has one of the remainders distinguished from the other two remainders (these distinguished remainders are $a, b, c$, respectively). Now, choose a card from the rest of the deck having the distinguished remainder modulo 5. Hence, we have three different remainders, one of them distinguished by (9) and presented in two copies. Let $d$ be the distinguished remainder and $s=5 m+d$ be the spectator's card with this remainder.

Now we have to choose a card $r$ with the remainder $d$ such that the first magician would be able to understand which of the cards $s$ and $r$ was chosen by us and what permutation of spectators it implies. This can be done easily: if we want to inform the first magician that spectators form a permutation number $k$ with respect to the natural ordering, we choose the card number $s+5 k(\bmod 100)$.

The decoding procedure is easy: if we have two numbers $p$ and $q$ that have the same remainder modulo 5 , calculate $p-q(\bmod 100)$ and $q-p(\bmod 100)$. If $p-q(\bmod 100)>q-p(\bmod 100)$ then $r=q$ is our card and $s=p$ is the spectator's card. (The case $p-q(\bmod 100)=q-p(\bmod 100)$ is impossible since the sum of these numbers is equal to 100 , and one of them is not greater than $6 \cdot 5=30$.)

3) Two remainders (say, $a$ and $b$ ) coincide. Let us choose a card with the remainder $d=(a+c) / 2 \bmod 5$. Then $|a-d|=|d-c| \bmod 5$, so the remainder $d$ is distinguished by (9). Hence we have three different remainders, one of them distinguished by (9) and one of the non-distinguished remainders presented in two copies. The first magician will easily determine our card, and the rule to choose the card in order to enable him also determine the order of spectators is similar to the one in the 1-st case.

Alternative solution. This solution gives a non-constructive proof that the trick is possible. For this, we need to show there is an injective mapping from the set of ordered triples to the set of unordered quadruples that additionally respects inclusion.

To prove that the desired mapping exists, let's consides a bipartite graph such that the set of ordered triples $T$ and the set of unordered quadruples $Q$ form the two disjoint sets of vertices and there is an edge between a triple and a quadruple if and only if the triple is a subset of the quadruple.

For each triple $t \in T$, we can add any of the remaining 97 cards to it, and thus we have 97 different quadruples connected to each triple in the graph. Conversely, for each quadruple $q \in Q$, we can remove any of the 4 cards from it, and reorder the remaining 3 cards in $3 !=6$ different ways, and thus we have 24 different triples connected to each quadruple in the graph.

According to the Hall's theorem, a bipartite graph $G=(T, Q, E)$ has a perfect matching if and only if for each subset $T^{\prime} \subseteq T$ the set of neighbours of $T^{\prime}$, denoted $N\left(T^{\prime}\right)$, satisfies $\left|N\left(T^{\prime}\right)\right| \geqslant\left|T^{\prime}\right|$.

To prove that this condition holds for our graph, consider any subset $T^{\prime} \subseteq T$. Because we have 97 quadruples for each triple, and there can be at most 24 copies of each of them in the multiset of neighbours, we have $\left|N\left(T^{\prime}\right)\right| \geqslant \frac{97}{24}\left|T^{\prime}\right|>4\left|T^{\prime}\right|$, which is even much more than we need.

Thus, the desired mapping is guaranteed to exist.

Another solution. Let the three chosen numbers be $\left(x_{1}, x_{2}, x_{3}\right)$. At least one of the sets $\{1,2, \ldots, 24\}$, $\{25,26, \ldots, 48\},\{49,50, \ldots, 72\}$ and $\{73,74, \ldots, 96\}$ should contain none of $x_{1}, x_{2}$ and $x_{3}$, let $S$ be such set. Next we split $S$ into 6 parts: $S=S_{1} \cup S_{2} \cup \ldots \cup S_{6}$ so that 4 first elements of $S$ are in $S_{1}$, four next in $S_{2}$, etc. Now we choose $i \in\{1,2, \ldots, 6\}$ corresponding to the order of numbers $x_{1}, x_{2}$ and $x_{3}$ (if $x_{1}<x_{2}<x_{3}$ then $i=1$, if $x_{1}<x_{3}<x_{2}$ then $i=2, \ldots$,if $x_{3}<x_{2}<x_{1}$ then $i=6$ ). At last let $j$ be the number of elements in $\left\{x_{1}, x_{2}, x_{3}\right\}$ that are greater than elements of $S$ (note that any $x_{k}$, $k \in\{1,2,3\}$, is either greater or smaller than all the elements of $S$ ). Now we choose $x_{4} \in S_{i}$ so that $x_{1}+x_{2}+x_{3}+x_{4} \equiv j \bmod 4$ and add the card number $x_{4}$ to those three cards.

Decoding of $\{a, b, c, d\}$ is straightforward. We first put the numbers into increasing order and then calculate $a+b+c+d \bmod 4$ showing the added card. The added card belongs to some $S_{i}(i \in\{1,2, \ldots, 6\})$ for some $S$ and $i$ shows us the initial ordering of cards.


problem:
Let $N$ be a positive integer. Two persons play the following game. The first player writes a list of positive integers not greater than 25 , not necessarily different, such that their sum is at least 200 . The second player wins if he can select some of these numbers so that their sum $S$ satisfies the condition $200-N \leqslant S \leqslant 200+N$. What is the smallest value of $N$ for which the second player has a winning strategy?

Answer: $N=11$.

solution:
If $N=11$, then the second player can simply remove numbers from the list, starting with the smallest number, until the sum of the remaining numbers is less than 212. If the last number removed was not 24 or 25 , then the sum of the remaining numbers is at least $212-23=189$. If the last number removed was 24 or 25 , then only 24 -s and 25 -s remain, and there must be exactly 8 of them since their sum must be less than 212 and not less than $212-24=188$. Hence their sum $S$ satisfies $8 \cdot 24=192 \leqslant S \leqslant 8 \cdot 25=200$. In any case the second player wins.

On the other hand, if $N \leqslant 10$, then the first player can write 25 two times and 23 seven times. Then the sum of all numbers is 211 , but if at least one number is removed, then the sum of the remaining ones is at most 188 - so the second player cannot win.


problem: Let $n$ be a positive integer. Consider $n$ points in the plane such that no three of them are collinear and no two of the distances between them are equal. One by one, we connect each point to the two points nearest to it by line segments (if there are already other line segments drawn to this point, we do not erase these). Prove that there is no point from which line segments will be drawn to more than 11 points.

solution:
Suppose there exists a point $A$ such that $A$ is connected to twelve points. Then there exist three points $B, C$ and $D$ such that $\angle B A C \leqslant 60^{\circ}, \angle B A D \leqslant 60^{\circ}$ and $\angle C A D \leqslant 60^{\circ}$.

We can assume that $|A D|>|A B|$ and $|A D|>|A C|$. By the cosine law we have

$$
\begin{aligned}
|B D|^{2} & =|A D|^{2}+|A B|^{2}-2|A D \| A B| \cos \angle B A D \\
& <|A D|^{2}+|A B|^{2}-2|A B|^{2} \cos \angle B A D \\
& =|A D|^{2}+|A B|^{2}(1-2 \cos \angle B A D) \\
& \leqslant|A D|^{2}
\end{aligned}
$$

since $1 \leqslant 2 \cos (\angle B A D)$. Hence $|B D|<|A D|$. Similarly we get $|C D|<|A D|$. Hence $A$ and $D$ should not be connected which is a contradiction.

Comment. It would be interesting to know whether 11 can be achieved or the actual bound is lower.


problem:
A set $S$ of four distinct points is given in the plane. It is known that for any point $X \in S$ the remaining points can be denoted by $Y, Z$ and $W$ so that

$$
|X Y|=|X Z|+|X W| .
$$

Prove that all the four points lie on a line.

solution:
Let $S=\{A, B, C, D\}$ and let $A B$ be the longest of the six segments formed by these four points (if there are several longest segments, choose any of them). If we choose $X=A$ then we must also choose $Y=B$. Indeed, if we would, for example, choose $Y=C$, we should have $|A C|=|A B|+|A D|$ contradicting the maximality of $A B$. Hence we get

$$
|A B|=|A C|+|A D| \text {. }
$$

Similarly, choosing $X=B$ we must choose $Y=A$ and we obtain

$$
|A B|=|B C|+|B D| \text {. }
$$

On the other hand, from the triangle inequality we know that

$$
\begin{aligned}
& |A B| \leqslant|A C|+|B C|, \\
& |A B| \leqslant|A D|+|B D|,
\end{aligned}
$$

where at least one of the inequalities is strict if all the four points are not on the same line. Hence, adding the two last inequalities we get

$$
2|A B|<|A C|+|B C|+|A D|+|B D| .
$$

On the other hand, adding (10) and (11) we get

$$
2|A B|=|A C|+|A D|+|B C|+|B D|,
$$

a contradiction.


problem: Let $A B C$ be an acute triangle with $\angle B A C>\angle B C A$, and let $D$ be a point on side $A C$ such that $|A B|=|B D|$. Furthermore, let $F$ be a point on the circumcircle of triangle $A B C$ such that line $F D$ is perpendicular to side $B C$ and points $F, B$ lie on different sides of line $A C$. Prove that line $F B$ is perpendicular to side $A C$.

solution:
Let $E$ be the other point on the circumcircle of triangle $A B C$ such that $|A B|=|E B|$. Let $D^{\prime}$ be the point of intersection of side $A C$ and the line perpendicular to side $B C$, passing through $E$. Then $\angle E C B=\angle B C A$ and the triangle $E C D^{\prime}$ is isosceles. As $E D^{\prime} \perp B C$, the triangle $B E D^{\prime}$ is also isosceles and $|B E|=\left|B D^{\prime}\right|$ implying $D=D^{\prime}$. Hence, the points $E, D, F$ lie on one line. We now have

$$
\angle E F B+\angle F D A=\angle B C A+\angle E D C=90^{\circ} .
$$

The required result now follows.

![](https://cdn.mathpix.com/cropped/2024_04_17_0d7b2527e7110b7d89ceg-10.jpg?height=591&width=563&top_left_y=270&top_left_x=381)


problem: Let $L, M$ and $N$ be points on sides $A C, A B$ and $B C$ of triangle $A B C$, respectively, such that $B L$ is the bisector of angle $A B C$ and segments $A N, B L$ and $C M$ have a common point. Prove that if $\angle A L B=\angle M N B$ then $\angle L N M=90^{\circ}$.

solution:
Let $P$ be the intersection point of lines $M N$ and $A C$. Then $\angle P L B=\angle P N B$ and the quadrangle $P L N B$ is cyclic. Let $\omega$ be its circumcircle. It is sufficient to prove that $P L$ is a diameter of $\omega$.

Let $Q$ denote the second intersection point of the line $A B$ and $\omega$. Then $\angle P Q B=\angle P L B$ and

$$
\angle Q P L=\angle Q B L=\angle L B N=\angle L P N
$$

and the triangles $P A Q$ and $B A L$ are similar. Therefore,

$$
\frac{|P Q|}{|P A|}=\frac{|B L|}{|B A|}
$$

We see that the line $P L$ is a bisector of the inscribed angle $N P Q$. Now in order to prove that $P L$ is a diameter of $\omega$ it is sufficient to check that $|P N|=|P Q|$.

The triangles $N P C$ and $L B C$ are similar, hence

$$
\frac{|P N|}{|P C|}=\frac{|B L|}{|B C|}
$$

Note also that

$$
\frac{|A B|}{|B C|}=\frac{|A L|}{|C L|}
$$

by the properties of a bisector. Combining (12), (13) and (14) we have

$$
\frac{|P N|}{|P Q|}=\frac{|A L|}{|A P|} \cdot \frac{|C P|}{|C L|}
$$

We want to prove that the left hand side of this equality equals 1 . This follows from the fact that the quadruple of points $(P, A, L, C)$ is harmonic, as can be proven using standard methods (e.g. considering the quadrilateral $M B N S$, where $S=M C \cap A N$ ).

![](https://cdn.mathpix.com/cropped/2024_04_17_0d7b2527e7110b7d89ceg-11.jpg?height=554&width=945&top_left_y=194&top_left_x=381)


problem:
A spider and a fly are sitting on a cube. The fly wants to maximize the shortest path to the spider along the surface of the cube. Is it necessarily best for the fly to be at the point opposite to the spider? ("Opposite" means "symmetric with respect to the center of the cube".)

Answer: no.

solution:
Suppose that the side of the cube is 1 and the spider sits at the middle of one of the edges. Then the shortest path to the middle of the opposite edge has length 2 . However, if the fly goes to a point on this edge at distance $s$ from the middle, then the length of the shortest path is

$$
\min \left(\sqrt{4+s^{2}}, \sqrt{\frac{9}{4}+\left(\frac{3}{2}-s\right)^{2}}\right) .
$$

If $0<s<(3-\sqrt{7}) / 2$ then this expression is greater than 2 .


problem:
Find all nonnegative integers $m$ such that

$$
a_{m}=\left(2^{2 m+1}\right)^{2}+1
$$

is divisible by at most two different primes.

Answer: $m=0,1,2$ are the only solutions.

solution:
Obviously $m=0,1,2$ are solutions as $a_{0}=5, a_{1}=65=5 \cdot 13$, and $a_{2}=1025=25 \cdot 41$. We show that these are the only solutions.

Assume that $m \geqslant 3$ and that $a_{m}$ contains at most two different prime factors. Clearly, $a_{m}=4^{2 m+1}+1$ is divisible by 5 , and

$$
a_{m}=\left(2^{2 m+1}+2^{m+1}+1\right) \cdot\left(2^{2 m+1}-2^{m+1}+1\right) \text {. }
$$

The two above factors are relatively prime as they are both odd and their difference is a power of 2 . Since both factors are larger than 1 , one of them must be a power of 5 . Hence,

$$
2^{m+1} \cdot\left(2^{m} \pm 1\right)=5^{t}-1=(5-1) \cdot\left(1+5+\cdots+5^{t-1}\right)
$$

for some positive integer $t$, where $\pm$ reads as either plus or minus. For odd $t$ the right hand side is not divisible by 8 , contradicting $m \geqslant 3$. Therefore, $t$ must be even and

$$
2^{m+1} \cdot\left(2^{m} \pm 1\right)=\left(5^{t / 2}-1\right) \cdot\left(5^{t / 2}+1\right) .
$$

Clearly, $5^{t / 2}+1 \equiv 2(\bmod 4)$. Consequently, $5^{t / 2}-1=2^{m} \cdot k$ for some odd $k$, and $5^{t / 2}+1=2^{m} \cdot k+2$ divides $2\left(2^{m} \pm 1\right)$, i.e.

$$
2^{m-1} \cdot k+1 \mid 2^{m} \pm 1 .
$$

This implies $k=1$, finally leading to a contradiction since

$$
2^{m-1}+1<2^{m} \pm 1<2\left(2^{m-1}+1\right)
$$

for $m \geqslant 3$.


problem:
Show that the sequence

$$
\left(\begin{array}{l}
2002 \\
2002
\end{array}\right),\left(\begin{array}{c}
2003 \\
2002
\end{array}\right),\left(\begin{array}{l}
2004 \\
2002
\end{array}\right), \ldots
$$

considered modulo 2002, is periodic.

solution:
Define

$$
x_{n}^{k}=\left(\begin{array}{l}
n \\
k
\end{array}\right)
$$

and note that

$$
x_{n+1}^{k}-x_{n}^{k}=\left(\begin{array}{c}
n+1 \\
k
\end{array}\right)-\left(\begin{array}{l}
n \\
k
\end{array}\right)=\left(\begin{array}{c}
n \\
k-1
\end{array}\right)=x_{n}^{k-1}
$$

Let $m$ be any positive integer. We will prove by induction on $k$ that the sequence $\left\{x_{n}^{k}\right\}_{n=k}^{\infty}$ is periodic modulo $m$. For $k=1$ it is obvious that $x_{n}^{k}=n$ is periodic modulo $m$ with period $m$. Therefore it will suffice to show that the following is true: the sequence $\left\{x_{n}\right\}$ is periodic modulo $m$ if its difference sequence, $d_{n}=x_{n+1}-x_{n}$, is periodic modulo $m$.

Furthermore, if $t$ then the period of $\left\{x_{n}\right\}$ is equal to $h t$ where $h$ is the smallest positive integer such that $h\left(x_{t}-x_{0}\right) \equiv 0$ modulo $m$.

Indeed, let $t$ be the period of $\left\{d_{n}\right\}$ and $h$ be the smallest positive integer such that $h\left(x_{t}-x_{0}\right) \equiv 0$ modulo $m$. Then

$$
\begin{aligned}
x_{n+h t} & =x_{0}+\sum_{j=0}^{n+h t-1} d_{j}=x_{0}+\sum_{j=0}^{n-1} d_{j}+h\left(\sum_{j=0}^{t-1} d_{j}\right)= \\
& =x_{n}+h\left(x_{t}-x_{0}\right) \equiv x_{n}(\bmod m)
\end{aligned}
$$

for all $n$, so the sequence $\left\{x_{n}\right\}$ is in fact periodic modulo $m$ (with a period dividing $h t$ ).


problem: Find all integers $n>1$ such that any prime divisor of $n^{6}-1$ is a divisor of $\left(n^{3}-1\right)\left(n^{2}-1\right)$.

solution:
Clearly $n=2$ is such an integer. We will show that there are no others.

Consider the equality

$$
n^{6}-1=\left(n^{2}-n+1\right)(n+1)\left(n^{3}-1\right) \text {. }
$$

The integer $n^{2}-n+1=n(n-1)+1$ clearly has an odd divisor $p$. Then $p \mid n^{3}+1$. Therefore, $p$ does not divide $n^{3}-1$ and consequently $p \mid n^{2}-1$. This implies that $p$ divides $\left(n^{3}+1\right)+\left(n^{2}-1\right)=n^{2}(n+1)$. As $p$ does not divide $n$, we obtain $p \mid n+1$. Also, $p \mid\left(n^{2}-1\right)-\left(n^{2}-n+1\right)=n-2$. From $p \mid n+1$ and $p \mid n-2$ it follows that $p=3$, so $n^{2}-n+1=3^{r}$ for some positive integer $r$.

The discriminant of the quadratic $n^{2}-n+\left(1-3^{r}\right)$ must be a square of an integer, hence

$$
1-4\left(1-3^{r}\right)=3\left(4 \cdot 3^{r-1}-1\right)
$$

must be a squareof an integer. Since for $r \geqslant 2$ the number $4 \cdot 3^{r-1}-1$ is not divisible by 3 , this is possible only if $r=1$. So $n^{2}-n-2=0$ and $n=2$.


problem:
Let $n$ be a positive integer. Prove that the equation

$$
x+y+\frac{1}{x}+\frac{1}{y}=3 n
$$

does not have solutions in positive rational numbers.

solution:
Suppose $x=\frac{p}{q}$ and $y=\frac{r}{s}$ satisfy the given equation, where $p, q, r, s$ are positive integers and $\operatorname{gcd}(p, q)=1, \operatorname{gcd}(r, s)=1$. We have

$$
\frac{p}{q}+\frac{r}{s}+\frac{q}{p}+\frac{s}{r}=3 n
$$

or

$$
\left(p^{2}+q^{2}\right) r s+\left(r^{2}+s^{2}\right) p q=3 n p q r s,
$$

so $r s \mid\left(r^{2}+s^{2}\right) p q$. Since $\operatorname{gcd}(r, s)=1$, we have $\operatorname{gcd}\left(r^{2}+s^{2}, r s\right)=1$ and $r s \mid p q$. Analogously $p q \mid r s$, so $r s=p q$ and hence there are either two or zero integers divisible by 3 among $p, q, r, s$. Now we have

$$
\begin{aligned}
\left(p^{2}+q^{2}\right) r s+\left(r^{2}+s^{2}\right) r s & =3 n(r s)^{2} \\
p^{2}+q^{2}+r^{2}+s^{2} & =3 n r s,
\end{aligned}
$$

but $3 n r s \equiv 0(\bmod 3)$ and $p^{2}+q^{2}+r^{2}+s^{2}$ is congruent to either 1 or 2 modulo 3 , a contradiction.


problem:
Does there exist an infinite non-constant arithmetic progression, each term of which is of the form $a^{b}$, where $a$ and $b$ are positive integers with $b \geqslant 2$ ?

Answer: no.

solution:
For an arithmetic progression $a_{1}, a_{2}, \ldots$ with difference $d$ the following holds:

$$
\begin{aligned}
S_{n} & =\frac{1}{a_{1}}+\frac{1}{a_{2}}+\ldots+\frac{1}{a_{n+1}}=\frac{1}{a_{1}}+\frac{1}{a_{1}+d}+\ldots+\frac{1}{a_{1}+n d} \geqslant \\
& \geqslant \frac{1}{m}\left(\frac{1}{1}+\frac{1}{2}+\ldots+\frac{1}{n+1}\right),
\end{aligned}
$$

where $m=\max \left(a_{1}, d\right)$. Therefore $S_{n}$ tends to infinity when $n$ increases.

On the other hand, the sum of reciprocals of the powers of a natural number $x \neq 1$ is

$$
\frac{1}{x^{2}}+\frac{1}{x^{3}}+\ldots=\frac{\frac{1}{x^{2}}}{1-\frac{1}{x}}=\frac{1}{x(x-1)}
$$

Hence, the sum of reciprocals of the terms of the progression required in the problem cannot exceed

$$
\frac{1}{1}+\frac{1}{1 \cdot 2}+\frac{1}{2 \cdot 3}+\ldots=1+\left(\frac{1}{1}-\frac{1}{2}+\frac{1}{2}-\frac{1}{3}+\ldots\right)=2
$$

a contradiction.

Alternative solution. Let $a_{k}=a_{0}+d k, k=0,1, \ldots$ Choose a prime number $p>d$ and set $k^{\prime} \equiv\left(p-a_{0}\right) d^{-1} \bmod p^{2}$. Then $a_{k^{\prime}}=a_{0}+k^{\prime} d \equiv p \bmod p^{2}$ and hence, $a_{k^{\prime}}$ can not be a power of a natural number.

Another solution. There can be at most $\lfloor\sqrt{n}\rfloor$ squares in the set $\{1,2, \ldots, n\}$, at most $\lfloor\sqrt[3]{n}\rfloor$ cubes in the same set, etc. The greatest power that can occur in the set $\{1,2, \ldots, n\}$ is $\left\lfloor\log _{2} n\right\rfloor$ and thus there are no more than

$$
\lfloor\sqrt{n}\rfloor+\lfloor\sqrt[3]{n}\rfloor+\ldots+\left\lfloor\left\lfloor\log _{2} \sqrt[n]{n}\right\rfloor\right.
$$

powers among the numbers $1,2, \ldots, n$. Now we can estimate this sum above:

$$
\begin{aligned}
\lfloor\sqrt{n}\rfloor+\lfloor\sqrt[3]{n}\rfloor+\ldots+\left\lfloor\left\lfloor\log _{2} \sqrt[n\rfloor\right]{n}\right\rfloor & \leqslant\lfloor\sqrt{n}\rfloor\left(\left\lfloor\log _{2} n\right\rfloor-1\right)< \\
& <\lfloor\sqrt{n}\rfloor \cdot\left\lfloor\log _{2} n\right\rfloor=o(n)
\end{aligned}
$$

This means that every arithmetic progression grows faster than the share of powers.