problem: Let $H$ be the orthocenter of the triangle $A B C$. Let $M$ and $N$ be the midpoints of the sides $A B$ and $A C$, respectively. Assume that $H$ lies inside the quadrilateral $B M N C$ and that the circumcircles of triangles $B M H$ and $C N H$ are tangent to each other. The line through $H$ parallel to $B C$ intersects the circumcircles of the triangles $B M H$ and $C N H$ in the points $K$ and $L$, respectively. Let $F$ be the intersection point of $M K$ and $N L$ and let $J$ be the incenter of triangle $M H N$. Prove that $F J=F A$.

solution:
Lemma 1. In a triangle $A B C$, let $D$ be the intersection of the interior angle bisector at $A$ with the circumcircle of $A B C$, and let $I$ be the incenter of $\triangle A B C$. Then

$$
D I=D B=D C
$$

![](https://cdn.mathpix.com/cropped/2024_11_22_c87ece96a341aa1506ccg-1.jpg?height=637&width=618&top_left_y=938&top_left_x=725)

Proof.

$$
\angle D B I=\frac{\angle B A C}{2}+\frac{\widehat{B}}{2}=\angle D I B \quad \Rightarrow \quad D I=D B
$$

Analogously $D I=D C$.
We start solving the problem. First we state some position considerations. Since there is an arc of the circumcircle of $B H M$ outside the triangle $A B C$, it must happen that $K$ and $N$ lie on opposite sides of $A M$. Similarly, $L$ and $M$ lie on opposite sides of $A N$. Also, $K$ and $L$ lie on the same side of $M N$, and opposite to $A$. Therefore, $F$ lies inside the triangle $A M N$.

Now, since $H$ is the orthocenter of $\triangle A B C$ and the circumcircles of $B M H$ and $C N H$ are tangent we have

$$
\angle A B H=90^{\circ}-\angle B A C=\angle A C H \quad \Rightarrow \quad \angle M H N=\angle M B H+\angle N C H=180^{\circ}-2 \angle B A C .
$$

So $\angle M B H=\angle M K H=\angle N C H=\angle N L H=90^{\circ}-\angle B A C$ and, since $M N \| K L$, we have

$$
\angle F M N=\angle F N M=90^{\circ}-\angle B A C \Rightarrow \angle M F N=2 \angle B A C .
$$

The relations (1) and (2) yield that the quadrilateral $M F N H$ is cyclic, with the vertices in this order around the circumference. Since $F M=F N, \angle M F N=2 \angle B A C$ and $F$ is the correct side of $M N$ we have that the point $F$ is the circumcenter of triangle $A M N$, and thus $F A=F M=F N$.
![](https://cdn.mathpix.com/cropped/2024_11_22_c87ece96a341aa1506ccg-2.jpg?height=801&width=1029&top_left_y=179&top_left_x=519)

Since the quadrilateral $M F N H$ is cyclic, $F M=F N$ and $H$ lies on the correct side of $M N$, we have that $H, J$ and $F$ are collinear. According to Lemma $1, F J=F M=F N$. So $F J=F A$.

problem_match: Problem 1.

solution_match: # Solution.


solution:
: According to Solution 1, we have $\angle M H N=180^{\circ}-2 \angle B A C$ and since the point $J$ is the incenter of $\triangle M H N$, we have $\angle M J N=90^{\circ}+\frac{1}{2} \angle M H N=180^{\circ}-\angle B A C$. So the quadrilateral $A M J N$ is cyclic.

According to Solution 1, the point $F$ is the circumcenter of $\triangle A M N$. So $F J=F A$.

solution_match: Solution 2


problem:
Let $f(x)$ and $g(x)$ be given by

$$
f(x)=\frac{1}{x}+\frac{1}{x-2}+\frac{1}{x-4}+\cdots+\frac{1}{x-2018}
$$

and

$$
g(x)=\frac{1}{x-1}+\frac{1}{x-3}+\frac{1}{x-5}+\cdots+\frac{1}{x-2017} .
$$

Prove that

$$
|f(x)-g(x)|>2
$$

for any non-integer real number $x$ satisfying $0<x<2018$.

solution:
There are two cases: $2 n-1<x<2 n$ and $2 n<x<2 n+1$. Note that $f(2018-x)=-f(x)$ and $g(2018-x)=-g(x)$, that is, a half turn about the point $(1009,0)$ preserves the graphs of $f$ and $g$. So it suffices to consider only the case $2 n-1<x<2 n$.

Let $d(x)=g(x)-f(x)$. We will show that $d(x)>2$ whenever $2 n-1<x<2 n$ and $n \in\{1,2, \ldots, 1009\}$.

For any non-integer $x$ with $0<x<2018$, we have

$$
d(x+2)-d(x)=\left(\frac{1}{x+1}-\frac{1}{x+2}\right)+\left(\frac{1}{x-2018}-\frac{1}{x-2017}\right)>0+0=0
$$

Hence it suffices to prove $d(x)>2$ for $1<x<2$. Since $x<2$, it follows that $\frac{1}{x-2 i-1}>$ $\frac{1}{x-2 i}$ for $i=2,3, \ldots, 1008$. We also have $\frac{1}{x-2018}<0$. Hence it suffices to prove the following
for $1<x<2$.

$$
\begin{aligned}
& \frac{1}{x-1}+\frac{1}{x-3}-\frac{1}{x}-\frac{1}{x-2}>2 \\
\Leftrightarrow & \left(\frac{1}{x-1}+\frac{1}{2-x}\right)+\left(\frac{1}{x-3}-\frac{1}{x}\right)>2 \\
\Leftrightarrow & \frac{1}{(x-1)(2-x)}+\frac{3}{x(x-3)}>2 .
\end{aligned}
$$

By the $G M-H M$ inequality (alternatively, by considering the maximum of the quadratic $(x-1)(2-x))$ we have

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

To find a lower bound for $\frac{3}{x(x-3)}$, note that $x(x-3)<0$ for $1<x<2$. So we seek an upper bound for $x(x-3)$. From the shape of the quadratic, this occurs at $x=1$ or $x=2$, both of which yield $\frac{3}{x(x-3)}>-\frac{3}{2}$.

It follows that $d(x)>4-\frac{3}{2}>2$, as desired.

problem_match: Problem 2.

solution_match: Solution 1


solution:
As in Solution 1, we may assume $2 n-1<x<2 n$ for some $1 \leq n \leq 1009$. Let $d(x)=$ $f(x)-g(x)$, and note that

$$
d(x)=\frac{1}{x}+\sum_{m=1}^{1009} \frac{1}{(x-2 m)(x-2 m+1)}
$$

We split the sum into three parts: the terms before $m=n$, after $m=n$, and the term $m=n$. The first two are

$$
\begin{aligned}
0 & \leq \sum_{m=1}^{n-1} \frac{1}{(x-2 m)(x-2 m+1)} \\
& \leq \sum_{m=1}^{n-1} \frac{1}{(2 n-1-2 m)(2 n-2 m)}=\sum_{i=1}^{n-1} \frac{1}{(2 i)(2 i-1)} \leq \sum_{i=1}^{1008} \frac{1}{2 i-1}-\frac{1}{2 i} \\
0 & \leq \sum_{m=n+1}^{1009} \frac{1}{(2 m-x)(2 m-1-x)} \\
& \leq \sum_{m=n+1}^{1009} \frac{1}{(2 m-2 n+1)(2 m-2 n)}=\sum_{i=1}^{1009-n} \frac{1}{(2 i+1)(2 i)} \leq \sum_{i=1}^{1008} \frac{1}{2 i}-\frac{1}{2 i+1} .
\end{aligned}
$$

When we add the two sums the terms telescope and we are left with

$$
0 \leq \sum_{1 \leq m \leq 1009, m \neq n} \frac{1}{(x-2 m)(x-2 m+1)} \leq 1-\frac{1}{2017}<1
$$

For the term $m=n$, we write

$$
0<-(x-2 n)(x-2 n+1)=0.25-(x-2 n+0.5)^{2} \leq 0.25
$$

whence

$$
-4 \geq \frac{1}{(x-2 n)(x-2 n+1)}
$$

Finally, $\frac{1}{x}<1$ since $x>2 n-1 \geq 1$. Combining these we get

$$
d(x)=\frac{1}{x}+\sum_{m=1}^{1009} \frac{1}{(x-2 m)(x-2 m+1)}<1+1-4<-2 .
$$

solution_match: # Solution 2


solution:
First notice that

$$
f(x)-g(x)=\frac{1}{x}-\frac{1}{x-1}+\frac{1}{x-2}-\cdots-\frac{1}{x-2017}+\frac{1}{x-2018} .
$$

As in Solution 1, we may deal only with the case $2 n<x<2 n+1$. Then $x-2 k+1$ and $x-2 k$ never differ in sign for any integer $k$. Then

$$
\begin{aligned}
-\frac{1}{x-2 k+1}+\frac{1}{x-2 k} & =\frac{1}{(x-2 k+1)(x-2 k)}>0 \quad \text { for } k=1,2, \ldots, n-1, n+2, \ldots, 1009 \\
\frac{1}{x-2 n}-\frac{1}{x-2 n-1} & =\frac{1}{(x-2 n)(2 n+1-x)} \geq\left(\frac{2}{x-2 n+2 n+1-x}\right)^{2}=4
\end{aligned}
$$

Therefore, summing all inequalities and collecting the remaining terms we find $f(x)-g(x)>$ $4+\frac{1}{x-2}>4-1=3$ for $0<x<1$ and, for $n>0$,

$$
\begin{aligned}
f(x)-g(x) & >\frac{1}{x}-\frac{1}{x-2 n+1}+4+\frac{1}{x-2 n-2} \\
& =\frac{1}{x}-\frac{1}{x-2 n+1}+4-\frac{1}{2 n+2-x} \\
& >\frac{1}{x}-\frac{1}{2 n-2 n+1}+4-\frac{1}{2 n+2-2 n-1} \\
& =2+\frac{1}{x}>2 .
\end{aligned}
$$

solution_match: # Solution 3


problem:
A collection of $n$ squares on the plane is called tri-connected if the following criteria are satisfied:
(i) All the squares are congruent.
(ii) If two squares have a point $P$ in common, then $P$ is a vertex of each of the squares.
(iii) Each square touches exactly three other squares.

How many positive integers $n$ are there with $2018 \leq n \leq 3018$, such that there exists a collection of $n$ squares that is tri-connected?

Answer: 501

solution:
We will prove that there is no tri-connected collection if $n$ is odd, and that tri-connected collections exist for all even $n \geq 38$. Since there are 501 even numbers in the range from 2018 to 3018, this yields 501 as the answer.

For any two different squares $A$ and $B$, let us write $A \sim B$ to mean that square $A$ touches square $B$. Since each square touches exactly three other squares, and there are $n$ squares in total, the total number of instances of $A \sim B$ is $3 n$. But $A \sim B$ if and only if $B \sim A$. Hence the total number of instances of $A \sim B$ is even. Thus $3 n$ and hence also $n$ is even.

We now construct tri-connected collections for each even $n$ in the range. We show two
Construction 1 The idea is to use the following two configurations. Observe that in each configuration every square is related to three squares except for the leftmost and rightmost squares which are related to two squares. Note that the configuration on the left is of variable length. Also observe that multiple copies of the configuration on the right can be chained together to end around corners.
![](https://cdn.mathpix.com/cropped/2024_11_22_c87ece96a341aa1506ccg-5.jpg?height=164&width=835&top_left_y=752&top_left_x=625)

Putting the above two types of configurations together as in the following figure yields a tri-connected collection for every even $n \geq 38$.
![](https://cdn.mathpix.com/cropped/2024_11_22_c87ece96a341aa1506ccg-5.jpg?height=309&width=789&top_left_y=1099&top_left_x=631)

Construction 2 Consider a regular $4 n$-gon $A_{1} A_{2} \cdots A_{4 n}$, and make $4 n$ squares on the outside of the $4 n$-gon with one side being on the $4 n$-gon. Reflect squares sharing sides $A_{4 m+2} A_{4 m+3}, A_{4 m+3} A_{4 m+4}$ across line $A_{4 m+2} A_{4 m+4}$, for $0 \leq m \leq n-1$. This will produce a tri-connected set of $6 n$ squares, as long as the squares inside the $4 n$-gon do not intersect. When $n \geq 4$, this will be true. The picture for $n=24$ is as follows:
![](https://cdn.mathpix.com/cropped/2024_11_22_c87ece96a341aa1506ccg-5.jpg?height=830&width=824&top_left_y=1758&top_left_x=593)

To treat the other cases, consider the following gadget
![](https://cdn.mathpix.com/cropped/2024_11_22_c87ece96a341aa1506ccg-6.jpg?height=184&width=272&top_left_y=296&top_left_x=869)

Two squares touch 3 other squares, and the squares containing $X, Y$ touch 2 other squares. Take the $4 n$-gon from above, and break it into two along the line $A_{1} A_{2 n}$, moving the two parts away from that line. Do so until the gaps can be exactly filled by inserting two copies of the above figure, so that the vertices $X, Y$ touch the two vertices which used to be $A_{1}$ in one instance, and the two vertices which used to be $A_{2 n}$ in the other.
This gives us a valid configuration for $6 n+8$ squares, $n \geq 4$. Finally, if we had instead spread the two parts out more and inserted two copies of the above figure into each gap, we would get $6 n+16$ for $n \geq 4$, which finishes the proof for all even numbers at least 36 .

problem_match: Problem 3.

solution_match: Solution.


problem:
Let $A B C$ be an equilateral triangle. From the vertex $A$ we draw a ray towards the interior of the triangle such that the ray reaches one of the sides of the triangle. When the ray reaches a side, it then bounces off following the law of reflection, that is, if it arrives with a directed angle $\alpha$, it leaves with a directed angle $180^{\circ}-\alpha$. After $n$ bounces, the ray returns to $A$ without ever landing on any of the other two vertices. Find all possible values of $n$.

Answer: All $n \equiv 1,5 \bmod 6$ with the exception of 5 and 17

solution:
Consider an equilateral triangle $A A_{1} A_{2}$ of side length $m$ and triangulate it with unitary triangles. See the figure. To each of the vertices that remain after the triangulation we can assign a pair of coordinates $(a, b)$ where $a, b$ are non-negative integers, $a$ is the number of edges we travel in the $A A_{1}$ direction and $b$ is the number of edges we travel in the $A A_{2}$ direction to arrive to the vertex, (we have $A=(0,0), A_{1}=(m, 0)$ and $A_{2}=(0, m)$ ). The unitary triangle with vertex $A$ will be our triangle $A B C,(B=(1,0), C=(0,1))$. We can obtain every unitary triangle by starting with $A B C$ and performing reflections with respect to a side (the vertex $(1,1)$ is the reflection of $A$ with respect to $B C$, the vertex $(0,2)$ is the reflection of $B=(1,0)$ with respect to the side formed by $C=(1,0)$ and $(1,1)$, and so on).

When we reflect a vertex $(a, b)$ with respect to a side of one of the triangles, the congruence of $a-b$ is preserved modulo 3. Furthermore, an induction argument shows that any two vertices $(a, b)$ and $\left(a^{\prime}, b^{\prime}\right)$ with $a-b \equiv a^{\prime}-b^{\prime}$ mod 3 can be obtained from each other by a series of such reflections. Therefore, the set of vertices $V$ that result from the reflections of $A$ will be those of the form $(a, b)$ satisfying $a \equiv b \bmod 3$. See the green vertices in the figure.

Now, let $U$ be the set of vertices $u$ that satisfy that the line segment between $u$ and $A$ does not pass through any other vertex. A pair $(a, b)$ is in $U$ if and only if $\operatorname{gcd}(a, b)=1$, since otherwise for $d=\operatorname{gcd}(a, b)$ we have that the vertex $(a / d, b / d)$ also lies on the line segment between $u$ and $A$.

Observe that the rays that come out from $A$ and eventually return to $A$ are those that come out towards a vertex in $V \cap U$ (they would be in $V$ to be able to come back to $A$ and in $U$ so that they do not reach a vertex beforehand). In the diagram, a ray toward one such vertex $(a, b)$ will intersect exactly $(a-1)+(b-1)+(a+b-1)=2(a+b)-3$ lines: $a-1$ of them parallel to $A B, b-1$ parallel to $A C$ and $a+b-1$ parallel to $B C$. Therefore, in the triangle $A B C$ the ray will bounce $2(a+b)-3$ times before returning to $A$. So we want to find all
![](https://cdn.mathpix.com/cropped/2024_11_22_c87ece96a341aa1506ccg-7.jpg?height=906&width=1044&top_left_y=175&top_left_x=506)
$n=2(a+b)-3$ where $a \equiv b \bmod 3$ and $\operatorname{gcd}(a, b)=1$.
If $a+b$ is a multiple of 3 then we cannot satisfy both conditions simultaneously, therefore $n$ is not a multiple of 3 . We also know that $n$ is odd. Therefore $n \equiv 1,5,7,11 \bmod 12$. Note that the pair $(1,3 k+1)$ satisfies the conditions and we can create $n=2(3 k+2)-3=6 k+1$ for all $k \geq 0$ (this settles the question for $n \equiv 1,7 \bmod 12$ ). For $n \equiv 5 \bmod 12$ consider the pair $(3 k-1,3 k+5)$ when $k$ is even or $(3 k-4,3 k+8)$ when $k$ is odd. This gives us all the integers of the form $12 k+5$ for $k \geq 2$. For $11 \bmod 12$, take the pairs $(3 k-1,3 k+2)($ with $k \geq 1)$, which yield all positive integers of the form $12 k-1$.

Finally, to discard 5 and 17 note that the only pairs $(a, b)$ that are solutions to $2(a+b)-3=5$ or $2(a+b)-3=17$ with the same residue $\bmod 3$ in this range are the non-relatively prime pairs $(2,2),(2,8)$ and $(5,5)$.

problem_match: Problem 4.


problem:
Find all polynomials $P(x)$ with integer coefficients such that for all real numbers $s$ and $t$, if $P(s)$ and $P(t)$ are both integers, then $P(s t)$ is also an integer.

Answer: $P(x)=x^{n}+k,-x^{n}+k$ for $n$ a non-negative integer and $k$ an integer.

solution:
: $P(x)=x^{n}+k,-x^{n}+k$ for $n$ a non-negative integer and $k$ an integer.
Notice that if $P(x)$ is a solution, then so is $P(x)+k$ and $-P(x)+k$ for any integer $k$, so we may assume that the leading coefficient of $P(x)$ is positive and that $P(0)=0$, i.e., we can assume that $P(x)=\sum_{i=1}^{n} a_{i} x^{i}$ with $a_{n}>0$. We are going to prove that $P(x)=x^{n}$ in this case.

Let $p$ be a large prime such that $p>\sum_{i=1}^{n}\left|a_{i}\right|$. Because $P$ has a positive leading coefficient and $p$ is large enough, we can find $t \in \mathbb{R}$ such that $P(t)=p$. Denote the greatest common divisor of the polynomial $P(x)-p$ and $P(2 x)-P(2 t)$ as $f(x)$, and $t$ is a root of it, so $f$ is a non-constant polynomial. Notice that $P(2 t)$ is an integer by using the hypothesis for $s=2$ and $t$. Since $P(x)-p$ and $P(2 x)-P(2 t)$ are polynomials with integer coefficients, $f$ can be chosen as a polynomial with rational coefficients.

In the following, we will prove that $f$ is the same as $P(x)-p$ up to a constant multiplier. Say $P(x)-p=f(x) g(x)$, where $f$ and $g$ are non-constant polynomials. By Gauss's lemma, we can get $f_{1}, g_{1}$ with $P(x)-p=f_{1}(x) g_{1}(x)$ where $f_{1}$ is a scalar multiple of $f$ and $g_{1}$ is a scalar multiple of $g$ and one of $f_{1}, g_{1}$ has constant term $\pm 1$ (this is because $-p=P(0)-p=f(0) g(0)$ with $p$ prime). So $P(x)-p$ has at least one root $r$ with absolute value not greater than 1 (using

Vieta, the product of the roots of the polynomial with constant term $\pm 1$ is $\pm 1$ ), but

$$
|P(r)-p|=\left|\sum_{i=1}^{n} a_{i} r^{i}-p\right|>p-\sum_{i=1}^{n}\left|a_{i}\right|>0
$$

hence we get a contradiction!
Therefore $f$ is a constant multiple of $P(x)-p$, so $P(2 x)-P(2 t)$ is a constant multiple of $P(x)-p$ because they both have the same degree. By comparing leading coefficients we get that $P(2 x)-P(2 t)=2^{n}(P(x)-p)$. Comparing the rest of the coefficients we get that $P(x)=a_{n} x^{n}$. If we let $a=b=\left(1 / a_{n}\right)^{1 / n}$, then $P(a)=P(b)=1$, so $P(a b)$ must also be an integer. But $P(a b)=\frac{1}{a_{n}}$. Therefore $a_{n}=1$ and the proof is complete.

problem_match: Problem 5.


solution:
: Assume $P(x)=\sum_{i=0}^{n} a_{i} x^{i}$. Consider the following system of equations

$$
\begin{aligned}
& a_{0}=P(0) \\
& a_{n} t^{n}+a_{n-1} t^{n-1}+\cdots+a_{0}=P(t) \\
& 2^{n} a_{n} t^{n}+2^{n-1} a_{n-1} t^{n-1}+\cdots+a_{0}=P(2 t) \\
& \vdots \\
& n^{n} a_{n} t^{n}+n^{n-1} a_{n-1} t^{n-1}+\cdots+a_{0}=P(n t)
\end{aligned}
$$

viewing $a_{k} t^{k}$ as variables. Note that if $P(t)$ is an integer, then by the hypothesis all the terms on the right hand side of the equations are integers as well. By using Cramer's rule, we can get that $a_{k} t^{k}=D / M$, where $D$ is an integer and $M$ is the following determinant

$$
\left|\begin{array}{ccccc}
1 & 0 & 0 & \cdots & 0 \\
1 & 1 & 1 & \cdots & 1 \\
1 & 2 & 4 & \cdots & 2^{n} \\
\vdots & \vdots & \vdots & & \vdots \\
1 & n & n^{2} & \cdots & n^{n}
\end{array}\right| \neq 0
$$

Thus, if we let $r$ be the smallest positive index such that $a_{r} \neq 0$, we can express each $t \in \mathbb{R}$ with $P(t) \in \mathbb{Z}$ in the form $\left(\frac{m}{M^{\prime}}\right)^{1 / r}$ for some integer $m$, and where $M^{\prime}=M \times a_{r}$ is a constant.

We can choose $L$ large enough such that $\left.P\right|_{\mathbb{R}_{\geq L}}$ is injective, and for any larger $N$, the growth order of the number of values in the form $\left(\frac{m}{M^{\prime}}\right)^{1 / r}$ is $N^{r}$, while the growth order of the number of integers in $[P(L), P(N)]$ is $N^{n}$, so $r=n$. Therefore $P(x)$ is of the form $a_{n} x^{n}+k$. The problem can be finished as in Solution 1.