exam: EGMO

problem:
According to Anna, the number 2021 is fantabulous. She states that if any element of the set $\{m, 2 m+1,3 m\}$ is fantabulousfor a positive integer $m$, then they are all fantabulous. Is the number 2021 ${ }^{2021}$ fantabulous?
(Australia, Angelo Di Pasquale)
Answer: Yes

solution:
Consider the sequence of positive integers $m, 3 m, 6 m+1,12 m+3,4 m+1,2 m$. Since each number in the sequence is fantabulous if and only if the next one is, we deduce that $m$ is fantabulous if and only if $2 m$ is fantabulous.

Combined with the fact that $m$ is fantabulous if and only if $2 m+1$ is fantabulous, this implies that $m>1$ is fantabulous if and only if $f(m)=\left[\frac{m}{2}\right]$ is fantabulous. We can apply $f$ sufficiently many times to any positive integer $n$ to conclude that $n$ is fantabulous if and only if 1 is fantabulous. Therefore, the fact that 2021 is fantabulous implies that 1 is fantabulous, which in turn implies that $2021^{2021}$ is fantabulous.

problem_match: Problem 1.

solution_match: # Solution 1.


solution:
Let $m>1$ be a fantabulous number. Note that at least one of the following four cases must hold.

- Case 1. The number $m$ is odd;

We have $m=2 a+1$ for some positive integer $a$, so $a<m$ is also fantabulous.

- Case 2. The number $m$ is a multiple of 3;

We have $m=3 a$ for some positive integer $a$, so $a<m$ is also fantabulous.

- Case 3. The number $m$ is 4 modulo 6;

We have $m=6 a-2$ for some positive integer $a$. We have the sequence of fantabulous numbers

$$
(6 a-2) \rightarrow(12 a-3) \rightarrow(4 a-1)
$$

so $4 a-1<m$ is also fantabulous.

## - Case 4. The number $m$ is 2 modulo 6;

We have $m=6 a+2$ for some positive integer $a$. We have the sequence of fantabulous numbers

$$
(6 a+2) \rightarrow(12 a+5) \rightarrow(36 a+15) \rightarrow(18 a+7) \rightarrow(9 a+3) \rightarrow(3 a+1)
$$

so $3 a+1<m$ is also fantabulous.

In all cases, we see that there is another fantabulous number less than $m$. Since 2021 is fantabulous, it follows that 1 is fantabulous.

Observe that a number $m$ is not fantabulous if and only if all of the elements of the set $\{m, 2 m+1,3 m\}$ are not fantabulous. So, the argument above shows that if there exists a positive integer that is not fantabulous, then 1 would not be fantabulous either. This is a contradiction, so all positive integers are fantabulous and, in particular, $2021^{2021}$ is fantabulous.

solution_match: # Solution 2.


solution:
The following transformations show that $a$ is fantabulous if and only if $3 a, 3 a+1$ or $3 a+2$ are fantabulous.

$$
\begin{aligned}
& a \rightarrow 3 a \\
& a \rightarrow 2 a+1 \rightarrow 6 a+3 \rightarrow 3 a+1 \\
& a \rightarrow 2 a+1 \rightarrow 4 a+3 \rightarrow 12 a+9 \rightarrow 36 a+27 \rightarrow 18 a+13 \rightarrow 9 a+6 \rightarrow 3 a+2
\end{aligned}
$$

This implies that $a \geq 3$ is fantabulous if and only if $f(a)=\left[\frac{a}{3}\right]$ is fantabulous. We can use this to deduce that 1 and 2 are fantabulous from the fact that 2021 is fantabulous in the following way:

$$
2021 \rightarrow 673 \rightarrow 224 \rightarrow 74 \rightarrow 24 \rightarrow 8 \rightarrow 2 \rightarrow 5 \rightarrow 1
$$

We can apply $f$ sufficiently many times to any positive integer $n$ to arrive at the number 1 or 2 . It follows that every positive integer is fantabulous, so $2021^{2021}$ is fantabulous.

solution_match: # Solution 3.


problem:
Find all functions $f: \mathbb{Q} \rightarrow \mathbb{Q}$ such that the equation

$$
f(x f(x)+y)=f(y)+x^{2}
$$

holds for all rational numbers $x$ and $y$.
Here, $\mathbb{Q}$ denotes the set of rational numbers.
(Slovakia, Patrik Bak)

Answer: $f(x)=x$ and $f(x)=-x$.

solution:
Denote the equation from the statement by (1). Let $x f(x)=A$ and $x^{2}=B$. The equation (1) is of the form

$$
f(A+y)=f(y)+B
$$

Also, if we put $y \rightarrow-A+y$, we have $f(A-A+y)=f(-A+y)+B$. Therefore

$$
f(-A+y)=f(y)-B
$$

We can easily show that for any integer $n$ we even have

$$
f(n A+y)=f(y)+n B
$$

Indeed, it's trivially true for $n=0$ and if this holds true for some integer $n$, then

$$
f((n+1) A+y)=f(A+y+n A)=f(n y+A)+B=f(y)+n B+B=f(y)+(n+1) B
$$

and

$$
f((n-1) A+y)=f(-A+n A+y)=f(n A+y)-B=f(y)+n B-B=f(y)+(n-1) B .
$$

So, equation (2) follows from the induction on $n$.
Now we can say that for any integer $k$ it holds

$$
f(n x f(x)+y)=f(y)+n x^{2}
$$

If $y$ is given, then $f(y)+n x^{2}$ can be any rational number, since $n x^{2}$ can be any rational number. If it is supposed to be $\frac{p}{q}$, where $q \neq 0$, then we may take $n=p q$, and $x=\frac{1}{q}$. Therefore $f$ is surjective on $\mathbb{Q}$. So there's a rational number $c$ such that $f(c)=0$. Be putting $x=c$ into (1) we immediately get $c=0$, i.e. $f(0)=0$. Therefore, $f(x)=0$ if and only if $x=0$.

For any integer $n$ and for any rational $x, y$ it holds

$$
f\left(n^{2} x f(x)+y\right)=f(y)+n^{2} x^{2}=f(y)+(n x)^{2}=f(n x f(n x)+y)
$$

After taking $y=-n x f(n x)$ in (4), the right-hand side becomes 0 , therefore

$$
n^{2} x f(x)-n x f(n x)=0
$$

This simplifies into $n f(x)=f(n x)$ for $x \neq 0$, but it also holds for $x=0$. Therefore, for any rational number $x=\frac{p}{q}$ we have,

$$
f(x)=f\left(\frac{p}{q}\right)=f\left(p \cdot \frac{1}{q}\right)=p \cdot f\left(\frac{1}{p}\right)=p \cdot \frac{f\left(q \cdot \frac{1}{q}\right)}{q}=\frac{p}{q} \cdot f(1)=x f(1)
$$

So, we have $f(x)=k x$, for some rational number $k$. Let's put this answer in (1) and we get $k(x k x+y)=k y+x^{2}$, thus $k^{2}=1$. Therefore $f(x)=x$ and $f(x)=-x$ are solutions.

problem_match: Problem 2.

solution_match: Solution.


problem: Let $A B C$ be a triangle with an obtuse angle at $A$. Let $E$ and $F$ be the intersections of the external bisector of angle $A$ with the altitudes of $A B C$ through $B$ and $C$ respectively. Let $M$ and $N$ be the points on the segments $E C$ and $F B$ respectively such that $\angle E M A=\angle B C A$ and $\angle A N F=\angle A B C$. Prove that the points $E, F, N, M$ lie on a circle.

solution:
The first solution is based on the main Lemma. We present this Lemma with two different proofs.
Lemma: Let $A B C$ be an acute triangle with $A B=B C$. Let $P$ be any point on $A C$. Line passing through $P$ perpendicular to $A B$, intersects ray $B C$ in point $T$. If the line $A T$ intersects the circumscribed circle of the triangle $A B C$ the second time at point $K$, then $\angle A K P=\angle A B P$.
![](https://cdn.mathpix.com/cropped/2024_11_22_733ba101a074dac10deeg-4.jpg?height=497&width=488&top_left_y=586&top_left_x=233)

## Proof 1:

Let $H$ be the orthocenter of the triangle $A B P$. Then

$$
\angle B H P=180^{\circ}-\angle B A C=180^{\circ}-\angle B C P
$$

So $B H P C$ is cyclic. Then we get

$$
T K \cdot T A=T C \cdot T B=T P \cdot T H
$$

So, $A H P K$ is also cyclic. But then

$$
\angle A K P=180^{\circ}-\angle A H P=\angle A B P
$$

Proof 2:
Consider the symmetric points $B^{\prime}$ and $C^{\prime}$ of $B$ and $C$, respectively, with respect to the line $P T$. It is clear that

$$
\mathrm{TC}^{\prime} \cdot T B^{\prime}=T C \cdot T B=T K \cdot T A
$$

So $B^{\prime} C^{\prime} K A$ is cyclic. Also, because of the symmetry we have

$$
\angle P C^{\prime} B^{\prime}=\angle P C B=\angle P A B
$$

So $B^{\prime} C^{\prime} P A$ is also cyclic. Therefore, the points $B^{\prime}, C^{\prime}, K, P$ and $A$ all lie on the common circle. Because of this fact and because of the symmetry again we have

$$
\angle P K A=\angle P B^{\prime} A=\angle P B A .
$$

So, lemma is proved and now return to the problem.
![](https://cdn.mathpix.com/cropped/2024_11_22_733ba101a074dac10deeg-4.jpg?height=613&width=619&top_left_y=1084&top_left_x=1271)

Let $H$ be intersection point of the altitudes at $B$ and $C$. Denote by $M^{\prime}$ and $N^{\prime}$ the intersection points of the circumcircle of the triangle $H E F$ with the segments $E C$ and $F B$, respectively. We are going to show that $M=M^{\prime}$ and $N=N^{\prime}$ and it will prove the points $E, F, N, M$ lie on a common circle.

Of course, $A$ is an orthocenter of the triangle $B C H$. Therefore $\angle B H A=\angle B C A, \angle C H A=\angle C B A$ and $\angle H B A=\angle H C A$. Thus

$$
\angle H E F=\angle H B A+\angle E A B=\angle H C A+\angle F A C=\angle H F E
$$

So, the triangle $H E F$ is isosceles, $H E=H F$.
By using lemma, we get

$$
\angle A M^{\prime} E=\angle A H E=\angle A C B
$$

and

$$
\angle A N^{\prime} F=\angle A H F=\angle A B C \text {. }
$$

![](https://cdn.mathpix.com/cropped/2024_11_22_733ba101a074dac10deeg-4.jpg?height=524&width=735&top_left_y=1906&top_left_x=1156)

Therefore $M=M^{\prime}$ and $N=N^{\prime}$ and we are done.

problem_match: Problem 3.


solution:
Let $X, Y$ be projections of $B$ on $A C$, and $C$ on $A B$, respectively. Let $\omega$ be circumcircle of $B X Y C$. Let $Z$ be intersection of $E C$ and $\omega$ and $D$ be projection of $E$ on $B A$.

$$
\angle M A C=\angle A M E-\angle M C A=\angle X C B-\angle X C E=\angle Z C B=\angle Z X B
$$

Since $B X Y C$ is cyclic $\angle A C Y=\angle X B A$, and since $D E X A$ is cyclic

$$
\angle E X D=\angle E A D=\angle F A C
$$

Therefore, we get that the quadrangles $B Z X D$ and $C M A F$ are similar. Hence $\angle F M C=\angle D Z B$. Since $Z E D B$ is cyclic,

$$
\angle D Z B=\angle D E B=\angle X A B .
$$

Thus $\angle F M C=\angle X A B$. Similarly, $\angle E N B=\angle Y A C$. We get that $\angle F M C=\angle E N B$ and it implies that the points $E, F, N, M$ lie on a circle.
![](https://cdn.mathpix.com/cropped/2024_11_22_733ba101a074dac10deeg-5.jpg?height=470&width=846&top_left_y=481&top_left_x=1046)


problem:
Let $A B C$ be a triangle with incentre Iand let $D$ be an arbitrary point on the side $B C$. Let the line through $D$ perpendicular to $B I$ intersect $C I$ at $E$. Let the line through $D$ perpendicular to $C I$ intersect $B I$ at $F$. Prove that the reflection of $A$ in the line $E F$ lies on the line $B C$.
(Australia, Sampson Wong)

solution:
Let us consider the case when $I$ lies inside of triangle $E F D$. For the other cases the proof is almost the same only with the slight difference.

We are going to prove that the intersection point of the circumcircles of $A E C$ and $A F B$ (denote it by $T$ ) lies on the line $B C$ and this point is the symmetric point of $A$ with respect to $E F$. First of all we prove that $A E I F$ is cyclic, which implies that $T$ lies on the line $B C$, because

$$
\angle A T B+\angle A T C=\angle A F B+\angle A E C=\angle A F I+\angle A E I=180^{\circ} .
$$

![](https://cdn.mathpix.com/cropped/2024_11_22_733ba101a074dac10deeg-5.jpg?height=844&width=1644&top_left_y=1454&top_left_x=238)

Denote by $N$ an intersection point of the lines $D F$ and $A C$. Of course $N$ is the symmetric point with respect to $C I$. Thus, $\angle I N A=\angle I D B$. Also,

$$
\angle I F D=\angle N D C-\angle I B C=90^{\circ}-\angle I C B-\angle I B C=\angle I A N .
$$

So, we get that $A, I, N$ and $F$ lie on a common circle. Therefore, we have $\angle A F I=\angle I N A=\angle I D B$. Analogously, $\angle A E I=\angle I D C$ and we have

$$
\angle A F I+\angle A E I=\angle I D B+\angle I D C
$$

So $\angle A F I+\angle A E I=180^{\circ}$, thus $A E I F$ is cyclic and $T$ lies on the line $B C$.

Because $E C$ bisects the angle $A C B$ and $A E T C$ is cyclic we get $E A=E T$. Because of the similar reasons we have $F A=F T$. Therefore $T$ is the symmetric point of $A$ with respect to the line $E F$ and it lies on the line $B C$.
![](https://cdn.mathpix.com/cropped/2024_11_22_733ba101a074dac10deeg-6.jpg?height=353&width=462&top_left_y=249&top_left_x=1422)

problem_match: Problem 4.


solution:
Like to the first solution, consider the case when $I$ lies inside of triangle $E F D$. we need to prove that $A E I F$ is cyclic. The finish of the proof is the same.
![](https://cdn.mathpix.com/cropped/2024_11_22_733ba101a074dac10deeg-6.jpg?height=421&width=429&top_left_y=760&top_left_x=238)
first note that $\triangle F D B \sim \triangle A I B$, because $\angle F B D=\angle A B I$, and

$$
\angle B F D=\angle F D C-\angle I B C=90^{\circ}-\angle I C D-\angle I B C=\angle I A B .
$$

Because of the similarity we have $\frac{A B}{A F}=\frac{B I}{B D}$. This equality of the length ratios with $\angle I B D=\angle A B F$ implies that $\triangle A B F \sim \triangle I B D$. Therefore, we have $\angle I D B=\angle A F B$. Analogously, we can get $\angle I D C=\angle A E C$, thus

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

So, $A E I F$ is cyclic and we are done.


problem:
A plane has a special point $O$ called the origin. Let $P$ be a set of 2021 points in the plane, such that
(i) no three points in $P$ lie on a line and
(ii) no two points in $P$ lie on a line through the origin.

A triangle with vertices in $P$ is fat, if $O$ is strictly inside the triangle. Find the maximum number of fat triangles.
(Austria, Veronika Schreitter)

Answer: $2021 \cdot 505 \cdot 337$

solution:
We will count minimal number of triangles that are not fat. Let $F$ set of fat triangles, and S set of triangles that are not fat. If triangle $X Y Z \in S$, we call $X$ and $Z$ good vertices if $O Y$ is located between $O X$ and $O Z$. For $A \in P$ let $S_{A} \subseteq S$ be set of triangles in $S$ for which $A$ is one of the good vertex.

It is easy to see that

$$
2|S|=\sum_{A \in P}\left|S_{A}\right|
$$

For $A \in P$, let $R_{A} \subset P$ and $L_{A} \subset P$ be parts of $P \backslash\{A\}$ divided by $A O$. Suppose for $A X Y \in S$ vertex $A$ is good, then clearly $X, Y \in R_{A}$ or $X, Y \in L_{A}$. On the other hand, if $X, Y \in R_{A}$ or $X, Y \in L_{A}$ then clearly $A X Y \in S$ and $A$ is its good vertex. Therefore,

$$
\left|S_{A}\right|=\binom{\left|R_{A}\right|}{2}+\binom{\left|L_{A}\right|}{2}
$$

It is easy to show following identity:

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

By using (2) and (3) we get

$$
\left|S_{A}\right| \geq 2 \cdot\binom{\frac{\left|R_{A}\right|+\left|L_{A}\right|}{2}}{2}=2 \cdot\binom{1010}{2}=1010 \cdot 1009
$$

and the equality holds when $\left|R_{A}\right|=\left|L_{A}\right|=1010$. Hence

$$
|S|=\frac{\sum_{A \in P}\left|S_{A}\right|}{2} \geq \frac{2021 \cdot 1010 \cdot 1009}{2}=2021 \cdot 505 \cdot 1009
$$

Therefore,

$$
|F|=\binom{2021}{3}-|S| \leq 2021 \cdot 1010 \cdot 673-2021 \cdot 505 \cdot 1009=2021 \cdot 505 \cdot 337
$$

For configuration of points on regular 2021-gon which is centered at $O$, in equalities in (4), (5), (6) become equalities. Hence $2021 \cdot 505 \cdot 337$ is indeed the answer.

problem_match: Problems 5.

solution_match: # Solution


problem:
Does there exist a nonnegative integer $a$ for which the equation

$$
\left\lfloor\frac{m}{1}\right\rfloor+\left\lfloor\frac{m}{2}\right\rfloor+\left\lfloor\frac{m}{3}\right\rfloor+\cdots+\left\lfloor\frac{m}{m}\right\rfloor=n^{2}+a
$$

has more than one million different solutions $(m, n)$ where $m$ and $n$ are positive integers? (The expression $\lfloor x\rfloor$ denotesthe integer part(or floor) of the real numberx. Thus $\lfloor\sqrt{2}\rfloor=1,\lfloor\pi\rfloor=\left\lfloor\frac{22}{7}\right\rfloor=$ $3,\lfloor 42\rfloor=42$ and $\lfloor 0\rfloor=0)$

Answer: Yes.

solution:
Denote the equation from the statement by (1). The left hand side of (1) depends only on $m$, and will throughout be denoted by $L(m)$. Fix an integer $q>10^{7}$ and note that for $m=q^{3}$

$$
L\left(q^{3}\right)=\sum_{k=1}^{q^{3}}\left[\frac{q^{3}}{k}\right] \leq \sum_{k=1}^{q^{3}} \frac{q^{3}}{k} \leq q^{3} \cdot \sum_{k=1}^{q^{3}} \frac{1}{k} \leq q^{3} \cdot q=q^{4}
$$

Indeed, the first inequality results from $[x] \leq x$. The second inequality can be seen (for instance) as follows. We divide the terms in the sum $\sum_{k=1}^{q^{3}} \frac{1}{k}$ into several groups: For $j \geq 0$, the $j$-th group contains the $2^{j}$ consecutive terms $\frac{1}{2^{j}}, \ldots, \frac{1}{2^{j+1}-1}$. Since every term in the $j$-th group is bounded by $\frac{1}{2^{j}}$, the overall contribution of the $j$-th group to the sum is at most 1 . Since the first $q$ groups together would contain $2^{q}-1>q^{3}$ terms, the number of groups does not exceed $q$, and hence the value of the sum under consideration is indeed bounded by $q$.

Call an integer $m$ special, if it satisfies $1 \leq L(m) \leq q^{4}$. Denote by $g(m) \geq 1$ the largest integer whose square is bounded by $L(m)$; in other words $g^{2}(m) \leq L(m)<(g(m)+1)^{2}$. Notethat $g(m) \leq$ $q^{2}$ for all special $m$, which implies

$$
0 \leq L(m)-g^{2}(m)<(g(m)+1)^{2}-g^{2}(m)=2 g(m)+1 \leq 2 q^{2}+1
$$

Finally, we do some counting. Inequality (2) and the monotonicity of $L(m)$ imply that there exist at least $q^{3}$ special integers. Because of (3), every special integer $m$ has $0 \leq L(m)-g^{2}(m) \leq 2 q^{2}+1$. By averaging, at least $\frac{q^{3}}{2 q^{2}+2}>10^{6}$ special integers must yield the same value $L(m)-g^{2}(m)$. This frequently occurring value is our choice for $\alpha$, which yields more than $10^{6}$ solutions $(m, g(m))$ to equation (1). Hence, the answer to the problem is YES.

problem_match: Problems 6.

solution_match: # Solution.