exam: BalticWay

problem: $\overline{a_{1} a_{2} a_{3}}$ and $\overline{a_{3} a_{2} a_{1}}$ are two three-digit decimal numbers, with $a_{1}, a_{3}$ being different non-zero digits. The squares of these numbers are five-digit numbers $\overline{b_{1} b_{2} b_{3} b_{4} b_{5}}$ and $\overline{b_{5} b_{4} b_{3} b_{2} b_{1}}$ respectively. Find all such threedigit numbers.

solution: Assume $a_{1}>a_{3}>0$. As the square of $\overline{a_{1} a_{2} a_{3}}$ must be a five-digit number we have $a_{1} \leq 3$. Now a straightforward case study shows that $\overline{a_{1} a_{2} a_{3}}$ can be 301, 311, 201, 211 or 221 .

solution_match: Solution.


problem: Do there exist positive integers $a>b>1$ such that for each positive integer $k$ there exists a positive integer $n$ for which $a n+b$ is a $k$ th power of a positive integer?

solution: Let $a=6, b=3$ and denote $x_{n}=a n+b$. Then we have $x_{l} \cdot x_{m}=x_{6 l m+3(l+m)+1}$ for any natural numbers $l$ and $m$. Thus, any powers of the numbers $x_{n}$ belong to the same sequence.


problem: Let's call a positive integer "interesting" if it is a product of two (distinct or equal) prime numbers. What is the greatest number of consecutive positive integers all of which are "interesting"?

solution: The three consecutive numbers $33=3 \cdot 11,34=2 \cdot 17$ and $35=5 \cdot 7$ are all "interesting". On the other hand, among any four consecutive numbers there is one of the form $4 k$ which is "interesting" only if $k=1$. But then we have either 3 or 5 among the four numbers, neither of which is "interesting".


problem:
Determine all integers $n$ for which

$$
\sqrt{\frac{25}{2}+\sqrt{\frac{625}{4}-n}}+\sqrt{\frac{25}{2}-\sqrt{\frac{625}{4}-n}}
$$

is an integer.

solution:
Let

$$
p=\sqrt{\frac{25}{2}+\sqrt{\frac{625}{4}-n}}+\sqrt{\frac{25}{2}-\sqrt{\frac{625}{4}-n}}=\sqrt{25+2 \sqrt{n}} .
$$

Then $n=\left(\frac{p^{2}-25}{2}\right)^{2}$ and obviously $p$ is an odd number not less than 5. If $p \geq 9$ then $n>\frac{625}{4}$ and the initial expression would be undefined. The two remaining values $p=5$ and $p=7$ give $n=0$ and $n=144$ respectively.


problem: Prove that for any odd positive integer $n, n^{12}-n^{8}-n^{4}+1$ is divisible by $2^{9}$.

solution:
Factorizing the expression, we get

$$
n^{12}-n^{8}-n^{4}+1=\left(n^{4}+1\right)\left(n^{2}+1\right)^{2}(n-1)^{2}(n+1)^{2} .
$$

Now note that one of the two even numbers $n-1$ and $n+1$ is divisible by 4 .


problem: Suppose two functions $f(x)$ and $g(x)$ are defined for all $x$ such that $2<x<4$ and satisfy $2<f(x)<4$, $2<g(x)<4, f(g(x))=g(f(x))=x$ and $f(x) \cdot g(x)=x^{2}$ for all such values of $x$. Prove that $f(3)=g(3)$.

solution:
Let $h(x)=\frac{f(x)}{x}$. Then we have $g(x)=\frac{x^{2}}{f(x)}=\frac{x}{h(x)}$ and $g(f(x))=\frac{f(x)}{h(f(x))}=x$ which yields $h(f(x))=\frac{f(x)}{x}=h(x)$. Using induction we easily get $h\left(f^{(k)}(x)\right)=h(x)$ for any natural number $k$ where $f^{(k)}(x)$ denotes $\underbrace{f(f(\ldots f}_{k}(x) \ldots))$. Now

$$
f^{(k+1)}(x)=f\left(f^{(k)}(x)\right)=f^{(k)}(x) \cdot h\left(f^{(k)}(x)\right)=f^{(k)}(x) \cdot h(x)
$$

and $\frac{f^{(k+1)}(x)}{f^{(k)}(x)}=h(x)$ for any natural number $k$. Thus

$$
\frac{f^{(k)}(x)}{x}=\frac{f^{(k)}(x)}{f^{(k-1)}(x)} \cdots \cdot \frac{f(x)}{x}=(h(x))^{k}
$$

and $\frac{f^{(k)}(3)}{3}=(h(3))^{k} \in\left(\frac{2}{3}, \frac{4}{3}\right)$ for all $k$. This is only possible if $h(3)=1$ and thus $f(3)=g(3)=3$.


problem:
Solve the system of equations in integers:

$$
\left\{\begin{array}{l}
z^{x}=y^{2 x} \\
2^{z}=4^{x} \\
x+y+z=20 .
\end{array}\right.
$$

solution:
From the second and third equation we find $z=2 x$ and $x=\frac{20-y}{3}$. Substituting these into the first equation yields $\left(\frac{40-2 y}{3}\right)^{x}=\left(y^{2}\right)^{x}$. As $x \neq 0$ (otherwise we have $0^{0}$ in the first equation which is usually considered undefined) we have $y^{2}= \pm \frac{40-2 y}{3}$ (the ' - ' case occurring only if $x$ is even). The equation $y^{2}=-\frac{40-2 y}{3}$ has no integer solutions; from $y^{2}=\frac{40-2 y}{3}$ we get $y=-4, x=8, z=16$ (the other solution $y=\frac{10}{3}$ is not an integer).

Remark. If we accept the definition $0^{0}=1$, then we get the additional solution $x=0, y=20, z=0$. Defining $0^{0}=0$ gives no additional solution.


problem: Compute the sum of all positive integers whose digits form either a strictly increasing or a strictly decreasing sequence.

solution:
Denote by $I$ and $D$ the sets of all positive integers with strictly increasing (respectively, decreasing) sequence of digits. Let $D_{0}, D_{1}, D_{2}$ and $D_{3}$ be the subsets of $D$ consisting of all numbers starting with 9 , not starting with 9 , ending in 0 and not ending in 0 , respectively. Let $S(A)$ denote the sum of all numbers belonging to a set $A$. All numbers in $I$ are obtained from the number 123456789 by deleting some of its digits. Thus, for any $k=0,1, \ldots, 9$ there are $\left(\begin{array}{l}9 \\ k\end{array}\right) k$-digit numbers in $I$ (here we consider 0 a 0 -digit number). Every $k$-digit number $a \in I$ can be associated with a unique number $b_{0} \in D_{0}, b_{1} \in D_{1}$ and $b_{3} \in D_{3}$ such that

$$
\begin{aligned}
& a+b_{0}=999 \ldots 9=10^{k+1}-1 \\
& a+b_{1}=99 \ldots 9=10^{k}-1 \\
& a+b_{3}=111 \ldots 10=\frac{10}{9}\left(10^{k}-1\right)
\end{aligned}
$$

Hence we have

$$
\begin{aligned}
& S(I)+S\left(D_{0}\right)=\sum_{k=0}^{9}\left(\begin{array}{l}
9 \\
k
\end{array}\right)\left(10^{k+1}-1\right)=10 \cdot 11^{9}-2^{9} \\
& S(I)+S\left(D_{1}\right)=\sum_{k=0}^{9}\left(\begin{array}{l}
9 \\
k
\end{array}\right)\left(10^{k}-1\right)=11^{9}-2^{9} \\
& S(I)+S\left(D_{3}\right)=\frac{10}{9}\left(11^{9}-2^{9}\right)
\end{aligned}
$$

Noting that $S\left(D_{0}\right)+S\left(D_{1}\right)=S\left(D_{2}\right)+S\left(D_{3}\right)=S(D)$ and $S\left(D_{2}\right)=10 S\left(D_{3}\right)$ we obtain the system of equations

$$
\left\{\begin{aligned}
2 S(I)+S(D) & =11^{10}-2^{10} \\
S(I)+\frac{1}{11} S(D) & =\frac{10}{9}\left(11^{9}-2^{9}\right)
\end{aligned}\right.
$$

which yields

$$
S(I)+S(D)=\frac{80}{81} \cdot 11^{10}-\frac{35}{81} \cdot 2^{10} .
$$

This sum contains all one-digit numbers twice, so the final answer is

$$
\frac{80}{81} \cdot 11^{10}-\frac{35}{81} \cdot 2^{10}-45=25617208995
$$


problem:
Solve the system of equations:

$$
\left\{\begin{array}{l}
x^{5}=y+y^{5} \\
y^{5}=z+z^{5} \\
z^{5}=t+t^{5} \\
t^{5}=x+x^{5} .
\end{array}\right.
$$

solution: Adding all four equations we get $x+y+z+t=0$. On the other hand, the numbers $x, y, z, t$ are simultaneously positive, negative or equal to zero. Thus, $x=y=z=t=0$ is the only solution.


problem:
Let $a_{1}, a_{2}, \ldots, a_{n}$ and $b_{1}, b_{2}, \ldots, b_{n}$ be two finite sequences consisting of $2 n$ different real numbers. Rearranging each of the sequences in the increasing order we obtain $a_{1}^{\prime}, a_{2}^{\prime}, \ldots, a_{n}^{\prime}$ and $b_{1}^{\prime}, b_{2}^{\prime}, \ldots, b_{n}^{\prime}$. Prove that

$$
\max _{1 \leq i \leq n}\left|a_{i}-b_{i}\right| \geq \max _{1 \leq i \leq n}\left|a_{i}^{\prime}-b_{i}^{\prime}\right| .
$$

solution: Let $m$ be such index that $\left|a_{m}^{\prime}-b_{m}^{\prime}\right|=\max _{1 \leq i \leq n}\left|a_{i}^{\prime}-b_{i}^{\prime}\right|=c$. Without loss of generality we may assume $a_{m}^{\prime}>b_{m}^{\prime}$. Consider the numbers $a_{m}^{\prime}, a_{m+1}^{\prime}, \ldots, a_{n}^{\prime}$ and $b_{1}^{\prime}, b_{2}^{\prime}, \ldots, b_{m}^{\prime}$. As there are $n+1$ numbers altogether and only $n$ places in the initial sequence there must exist an index $j$ such that we have $a_{j}$ among $a_{m}^{\prime}, a_{m+1}^{\prime}, \ldots, a_{n}^{\prime}$ and $b_{j}$ among $b_{1}^{\prime}, b_{2}^{\prime}, \ldots, b_{m}^{\prime}$. Now, as $b_{j} \leq b_{m}^{\prime}<a_{m}^{\prime} \leq a_{j}$ we have $\left|a_{j}-b_{j}\right| \geq\left|a_{m}^{\prime}-b_{m}^{\prime}\right|=c$ and $\max _{1 \leq i \leq n}\left|a_{i}-b_{i}\right| \geq c=\max _{1 \leq i \leq n}\left|a_{i}^{\prime}-b_{i}^{\prime}\right|$.


problem: An equilateral triangle is divided into $n^{2}$ congruent equilateral triangles. A spider stands at one of the vertices, a fly at another. Alternately each of them moves to a neighbouring vertex. Prove that the spider can always catch the fly.

solution:
Assume that the big triangle lies on one of its sides. Then a suitable strategy for the spider will be as follows:

(1) First, move to the lower left vertex of the big triangle.

(2) Then, as long as the fly is higher than the spider, move upwards along the left side of the big triangle.

(3) After reaching the horizontal line where the fly is, retain this situation while moving to the right (more precisely: move "right", "right and up" or "right and down" depending on the last move of the fly).


problem: There are 13 cities in a certain kingdom. Between some pairs of cities two-way direct bus, train or plane connections are established. What is the least possible number of connections to be established in order that choosing any two means of transportation one can go from any city to any other without using the third kind of vehicle?

solution:
An example for 18 connections is shown in Figure 1 (where single, double and dashed lines denote the three different kinds of transportation). On the other hand, a connected graph with 13 vertices has at least 12 edges, so the total number of connections for any two kinds of vehicle is at least 12 . Thus, twice the total number of all connections is at least $12+12+12=36$.

![](https://cdn.mathpix.com/cropped/2024_04_17_38aae83e469137ba6b44g-3.jpg?height=337&width=357&top_left_y=1693&top_left_x=632)

Figure 1

![](https://cdn.mathpix.com/cropped/2024_04_17_38aae83e469137ba6b44g-3.jpg?height=294&width=303&top_left_y=1732&top_left_x=1205)

Figure 2


problem: An equilateral triangle $A B C$ is divided into 100 congruent equilateral triangles. What is the greatest number of vertices of small triangles that can be chosen so that no two of them lie on a line that is parallel to any of the sides of the triangle $A B C$ ?

solution: An example for 7 vertices is shown in Figure 2. Now assume we have chosen 8 vertices satisfying the conditions of the problem. Let the height of each small triangle be equal to 1 and denote by $a_{i}, b_{i}, c_{i}$ the distance of the $i$ th point from the three sides of the big triangle. For any $i=1,2, \ldots, 8$ we then have $a_{i}, b_{i}, c_{i} \geq 0$ and $a_{i}+b_{i}+c_{i}=10$. Thus, $\left(a_{1}+a_{2}+\cdots+a_{8}\right)+\left(b_{1}+b_{2}+\cdots+b_{8}\right)+\left(c_{1}+c_{2}+\cdots+c_{8}\right)=80$. On the other hand, each of the sums in the brackets is not less than $0+1+\cdots+7=28$, but $3 \cdot 28=84>80$, a contradiction.


problem:
A square is divided into 16 equal squares, obtaining the set of 25 different vertices. What is the least number of vertices one must remove from this set, so that no 4 points of the remaining set are the vertices of any square with sides parallel to the sides of the initial square?

Remark. The proposed solution to this problem claimed that it is enough to remove 7 vertices but the example to demonstrate this appeared to be incorrect. Below we show that removing 6 vertices is not sufficient but removing 8 vertices is. It seems that removing 7 vertices is not sufficient but we currently know no potential way to prove this, apart from a tedious case study.

solution:
The example in Figure 3a demonstrates that it suffices to remove 8 vertices to "destroy" all squares. Assume now that we have managed to do that by removing only 6 vertices. Denote the horizontal and vertical lines by $A, B, \ldots, E$ and $1,2, \ldots, 5$ respectively. Obviously, one of the removed vertices must be a vertex of the big square - let this be vertex $A 1$. Then, in order to "destroy" all the squares shown in Figure $3 \mathrm{~b}-\mathrm{e}$ we have to remove vertices $B 2, C 3, D 4, D 2$ and $B 4$. Thus we have removed 6 vertices without having any choice but a square shown in Figure $3 \mathrm{f}$ is still left intact.

12345

![](https://cdn.mathpix.com/cropped/2024_04_17_38aae83e469137ba6b44g-4.jpg?height=168&width=194&top_left_y=864&top_left_x=588)

$\mathrm{a}$

![](https://cdn.mathpix.com/cropped/2024_04_17_38aae83e469137ba6b44g-4.jpg?height=157&width=143&top_left_y=864&top_left_x=794)

$\mathrm{b}$

![](https://cdn.mathpix.com/cropped/2024_04_17_38aae83e469137ba6b44g-4.jpg?height=154&width=148&top_left_y=868&top_left_x=937)

c

![](https://cdn.mathpix.com/cropped/2024_04_17_38aae83e469137ba6b44g-4.jpg?height=154&width=148&top_left_y=868&top_left_x=1091)

d

![](https://cdn.mathpix.com/cropped/2024_04_17_38aae83e469137ba6b44g-4.jpg?height=154&width=146&top_left_y=868&top_left_x=1246)

e

![](https://cdn.mathpix.com/cropped/2024_04_17_38aae83e469137ba6b44g-4.jpg?height=154&width=149&top_left_y=868&top_left_x=1393)

f

Figure 3


problem: On each face of two dice some positive integer is written. The two dice are thrown and the numbers on the top faces are added. Determine whether one can select the integers on the faces so that the possible sums are $2,3,4,5,6,7,8,9,10,11,12,13$, all equally likely?

solution: We can write 1, 2, 3, 4, 5, 6 on the sides of one die and 1, 1, 1, 7, 7, 7 on the sides of the other. Then each of the 12 possible sums appears in exactly 3 cases.


problem: Two circles, both with the same radius $r$, are placed in the plane without intersecting each other. A line in the plane intersects the first circle at the points $A, B$ and the other at the points $C, D$ so that $|A B|=|B C|=|C D|=14 \mathrm{~cm}$. Another line intersects the circles at points $E, F$ and $G, H$ respectively, so that $|E F|=|F G|=|G H|=6 \mathrm{~cm}$. Find the radius $r$.

solution:
First, note that the centres $O_{1}$ and $O_{2}$ of the two circles lie on different sides of the line $E H-$ otherwise we have $r<12$ and $A B$ cannot be equal to 14 . Let $P$ be the intersection point of $E H$ and $O_{1} O_{2}$ (see Figure 4). Points $A$ and $D$ lie on the same side of the line $O_{1} O_{2}$ (otherwise the three lines $A D, E H$ and $O_{1} O_{2}$ would intersect in $P$ and $|A B|=|B C|=|C D|,|E F|=|F G|=|G H|$ would imply $|B C|=|F G|$, a contradiction). It is easy to see that $\left|O_{1} O_{2}\right|=2 \cdot\left|O_{1} P\right|=|A C|=28 \mathrm{~cm}$. Let $h=\left|O_{1} T\right|$ be the height of triangle $O_{1} E P$. Then we have $h^{2}=14^{2}-6^{2}=160$ from triangle $O_{1} T P$ and $r^{2}=h^{2}+3^{2}=169$ from triangle $O_{1} T F$. Thus $r=13 \mathrm{~cm}$.

![](https://cdn.mathpix.com/cropped/2024_04_17_38aae83e469137ba6b44g-4.jpg?height=258&width=442&top_left_y=1981&top_left_x=684)

Figure 4

![](https://cdn.mathpix.com/cropped/2024_04_17_38aae83e469137ba6b44g-4.jpg?height=237&width=297&top_left_y=1983&top_left_x=1185)

Figure 5


problem: Let's consider three pairwise non-parallel straight lines in the plane. Three points are moving along these lines with different non-zero velocities, one on each line (we consider the movement as having taken place for infinite time and continuing infinitely in the future). Is it possible to determine these straight lines, the velocities of each moving point and their positions at some "zero" moment in such a way that the points never were, are or will be collinear?

solution:
Yes, it is. First, place the three points at the vertices of an equilateral triangle at the "zero" moment and let them move with equal velocities along the straight lines determined by the sides of the
triangle as shown in Figure 5. Then, at any moment in the past or future, the points are located at the vertices of some equilateral triangle, and thus cannot be collinear. Finally, to make the velocities of the points also differ, take any non-zero constant vector such that its projections on the three lines have different lengths and add it to each of the velocity vectors. This is equivalent to making the whole picture "drift" across the plane with constant velocity, so the non-collinearity of our points is preserved (in fact, they are still located at the vertices of an equilateral triangle at any given moment).


problem: A convex quadrangle $A B C D$ is inscribed in a circle with the centre $O$. The angles $\angle A O B, \angle B O C, \angle C O D$ and $\angle D O A$, taken in some order, are of the same size as the angles of quadrangle $A B C D$. Prove that $A B C D$ is a square.

solution:
As the quadrangle $A B C D$ is inscribed in a circle, we have $\angle A B C+\angle C D A=\angle B C D+\angle D A B=$ $180^{\circ}$. It suffices to show that if each of these angles is equal to $90^{\circ}$, then each of the angles $A O B, B O C$, $C O D$ and $D O A$ is also equal to $90^{\circ}$ and thus $A B C D$ is a square. We consider the two possible situations:

(a) At least one of the diagonals of $A B C D$ is a diameter - say, $\angle A O B+\angle B O C=180^{\circ}$. Then $\angle A B C=$ $\angle C D A=90^{\circ}$ and at least two of the angles $A O B, B O C, C O D$ and $D O A$ must be $90^{\circ}$ : say, $\angle A O B=$ $\angle B O C=90^{\circ}$. Now, $\angle C O D=\angle D A B$ and $\angle D O A=\angle B C D$ (see Figure 7). Using the fact that $\frac{1}{2} \angle D O A=\angle D C A=\angle B C D-45^{\circ}$ we have $\angle B C D=\angle D A B=90^{\circ}$.

(b) None of the diagonals of the quadrangle $A B C D$ is a diameter. Then $\angle A O B+\angle C O D=\angle B O C+$ $\angle D O A=180^{\circ}$ and no angle of the quadrangle $A B C D$ is equal to $90^{\circ}$. Consequently, none of the angles $A O B, B O C, C O D$ and $D O A$ is equal to $90^{\circ}$. Without loss of generality we assume that $\angle A O B>90^{\circ}$, $\angle B O C>90^{\circ}$ (see Figure 8). Then $\angle A B C<90^{\circ}$ and thus $\angle A B C=\angle C O D$ or $\angle A B C=\angle D O A$. As $\angle C O D+\angle D O A=\angle A O C=2 \angle A B C$, we have $\angle C O D=\angle D O A$ and $\angle A O B+\angle D O A=180^{\circ}$, a contradiction.


problem: Let $Q$ be a unit cube. We say a tetrahedron is "good" if all its edges are equal and all its vertices lie on the boundary of $Q$. Find all possible volumes of "good" tetrahedra.

solution: Clearly, the volume of a regular tetrahedron contained in a sphere reaches its maximum value if and only if all four vertices of the tetrahedron lie on the surface of the sphere. Therefore, a "good" tetrahedron with maximum volume must have its vertices at the vertices of the cube (for a proof, inscribe the cube in a sphere). There are exactly two such tetrahedra, their volume being equal to $1-4 \cdot \frac{1}{6}=\frac{1}{3}$. On the other hand, one can find arbitrarily small "good" tetrahedra by applying homothety to the maximal tetrahedron, with the centre of the homothety in one of its vertices.