problem:
Let $f: \mathbb{R} \rightarrow \mathbb{R}$ be a function such that
(i) For all $x, y \in \mathbb{R}$,

$$
f(x)+f(y)+1 \geq f(x+y) \geq f(x)+f(y)
$$

(ii) For all $x \in[0,1), f(0) \geq f(x)$,
(iii) $-f(-1)=f(1)=1$.

Find all such functions $f$.
Answer: $f(x)=\lfloor x\rfloor$, the largest integer that does not exceed $x$, is the only function.

solution:
Plug $y \rightarrow 1$ in (i):

$$
f(x)+f(1)+1 \geq f(x+1) \geq f(x)+f(1) \Longleftrightarrow f(x)+1 \leq f(x+1) \leq f(x)+2
$$

Now plug $y \rightarrow-1$ and $x \rightarrow x+1$ in (i):

$$
f(x+1)+f(-1)+1 \geq f(x) \geq f(x+1)+f(-1) \Longleftrightarrow f(x) \leq f(x+1) \leq f(x)+1
$$

Hence $f(x+1)=f(x)+1$ and we only need to define $f(x)$ on $[0,1)$. Note that $f(1)=$ $f(0)+1 \Longrightarrow f(0)=0$.
Condition (ii) states that $f(x) \leq 0$ in $[0,1)$.
Now plug $y \rightarrow 1-x$ in (i):

$$
f(x)+f(1-x)+1 \leq f(x+(1-x)) \leq f(x)+f(1-x) \Longrightarrow f(x)+f(1-x) \geq 0
$$

If $x \in(0,1)$ then $1-x \in(0,1)$ as well, so $f(x) \leq 0$ and $f(1-x) \leq 0$, which implies $f(x)+f(1-x) \leq 0$. Thus, $f(x)=f(1-x)=0$ for $x \in(0,1)$. This combined with $f(0)=0$ and $f(x+1)=f(x)+1$ proves that $f(x)=\lfloor x\rfloor$, which satisfies the problem conditions, as since
$x+y=\lfloor x\rfloor+\lfloor y\rfloor+\{x\}+\{y\}$ and $0 \leq\{x\}+\{y\}<2 \Longrightarrow\lfloor x\rfloor+\lfloor y\rfloor \leq x+y<\lfloor x\rfloor+\lfloor y\rfloor+2$ implies

$$
\lfloor x\rfloor+\lfloor y\rfloor+1 \geq\lfloor x+y\rfloor \geq\lfloor x\rfloor+\lfloor y\rfloor .
$$

problem_match: # Problem 1

solution_match: # Solution


problem: Given a nondegenerate triangle $A B C$, with circumcentre $O$, orthocentre $H$, and circumradius $R$, prove that $|O H|<3 R$.

solution:
Embed $A B C$ in the complex plane, with $A, B$ and $C$ in the circle $|z|=R$, so $O$ is the origin. Represent each point by its lowercase letter. It is well known that $h=a+b+c$, so

$$
O H=|a+b+c| \leq|a|+|b|+|c|=3 R .
$$

The equality cannot occur because $a, b$, and $c$ are not collinear, so $O H<3 R$.

problem_match: # Problem 2

solution_match: # Solution 1


solution:
Suppose with loss of generality that $\angle A<90^{\circ}$. Let $B D$ be an altitude. Then

$$
A H=\frac{A D}{\cos \left(90^{\circ}-C\right)}=\frac{A B \cos A}{\sin C}=2 R \cos A
$$

By the triangle inequality,

$$
O H<A O+A H=R+2 R \cos A<3 R
$$

Comment: With a bit more work, if $a, b, c$ are the sidelengths of $A B C$, one can show that

$$
O H^{2}=9 R^{2}-a^{2}-b^{2}-c^{2} .
$$

In fact, using vectors in a coordinate system with $O$ as origin, by the Euler line

$$
\overrightarrow{O H}=3 \overrightarrow{O G}=3 \cdot \frac{\overrightarrow{O A}+\overrightarrow{O B}+\overrightarrow{O C}}{3}=\overrightarrow{O A}+\overrightarrow{O B}+\overrightarrow{O C}
$$

so

$$
O H^{2}=\overrightarrow{O H} \cdot \overrightarrow{O H}=(\overrightarrow{O A}+\overrightarrow{O B}+\overrightarrow{O C}) \cdot(\overrightarrow{O A}+\overrightarrow{O B}+\overrightarrow{O C})
$$

Expanding and using the fact that $\overrightarrow{O X} \cdot \overrightarrow{O X}=O X^{2}=R^{2}$ for $X \in\{A, B, C\}$, as well as
$\overrightarrow{O A} \cdot \overrightarrow{O B}=O A \cdot O B \cdot \cos \angle A O B=R^{2} \cos 2 C=R^{2}\left(1-2 \sin ^{2} C\right)=R^{2}\left(1-2\left(\frac{c}{2 R}\right)^{2}\right)=R^{2}-\frac{c^{2}}{2}$, we find that

$$
\begin{aligned}
O H^{2} & =\overrightarrow{O A} \cdot \overrightarrow{O A}+\overrightarrow{O B} \cdot \overrightarrow{O B}+\overrightarrow{O C} \cdot \overrightarrow{O C}+2 \overrightarrow{O A} \cdot \overrightarrow{O B}+2 \overrightarrow{O A} \cdot \overrightarrow{O C}+2 \overrightarrow{O B} \cdot \overrightarrow{O C} \\
& =3 R^{2}+\left(2 R^{2}-c^{2}\right)+\left(2 R^{2}-b^{2}\right)+\left(2 R^{2}-a^{2}\right) \\
& =9 R^{2}-a^{2}-b^{2}-c^{2}
\end{aligned}
$$

as required.
This proves that $O H^{2}<9 R^{2} \Longrightarrow O H<3 R$, and since $a, b, c$ can be arbitrarily small (fix the circumcircle and choose $A, B, C$ arbitrarily close in this circle), the bound is sharp.

solution_match: # Solution 2


problem:
Let $n$ be an integer of the form $a^{2}+b^{2}$, where $a$ and $b$ are relatively prime integers and such that if $p$ is a prime, $p \leq \sqrt{n}$, then $p$ divides $a b$. Determine all such $n$.

Answer: $n=2,5,13$.

solution:
A prime $p$ divides $a b$ if and only if divides either $a$ or $b$. If $n=a^{2}+b^{2}$ is a composite then it has a prime divisor $p \leq \sqrt{n}$, and if $p$ divides $a$ it divides $b$ and vice-versa, which is not possible because $a$ and $b$ are coprime. Therefore $n$ is a prime.
Suppose without loss of generality that $a \geq b$ and consider $a-b$. Note that $a^{2}+b^{2}=(a-b)^{2}+2 a b$.

- If $a=b$ then $a=b=1$ because $a$ and $b$ are coprime. $n=2$ is a solution.
- If $a-b=1$ then $a$ and $b$ are coprime and $a^{2}+b^{2}=(a-b)^{2}+2 a b=2 a b+1=2 b(b+1)+1=$ $2 b^{2}+2 b+1$. So any prime factor of any number smaller than $\sqrt{2 b^{2}+2 b+1}$ is a divisor of $a b=b(b+1)$.
One can check that $b=1$ and $b=2$ yields the solutions $n=1^{2}+2^{2}=5$ (the only prime $p$ is 2 ) and $n=2^{2}+3^{2}=13$ (the only primes $p$ are 2 and 3 ). Suppose that $b>2$.
Consider, for instance, the prime factors of $b-1 \leq \sqrt{2 b^{2}+2 b+1}$, which is coprime with $b$. Any prime must then divide $a=b+1$. Then it divides $(b+1)-(b-1)=2$, that is, $b-1$ can only have 2 as a prime factor, that is, $b-1$ is a power of 2 , and since $b-1 \geq 2$, $b$ is odd.
Since $2 b^{2}+2 b+1-(b+2)^{2}=b^{2}-2 b-3=(b-3)(b+1) \geq 0$, we can also consider any prime divisor of $b+2$. Since $b$ is odd, $b$ and $b+2$ are also coprime, so any prime divisor of $b+2$ must divide $a=b+1$. But $b+1$ and $b+2$ are also coprime, so there can be no such primes. This is a contradiction, and $b \geq 3$ does not yield any solutions.
- If $a-b>1$, consider a prime divisor $p$ of $a-b=\sqrt{a^{2}-2 a b+b^{2}}<\sqrt{a^{2}+b^{2}}$. Since $p$ divides one of $a$ and $b, p$ divides both numbers (just add or subtract $a-b$ accordingly.) This is a contradiction.

Hence the only solutions are $n=2,5,13$.

problem_match: # Problem 3


problem:
Is there an infinite set of points in the plane such that no three points are collinear, and the distance between any two points is rational?
Answer: Yes.

solution:
The answer is yes and we present the following construction: the idea is considering points in the unit circle of the form $P_{n}=(\cos (2 n \theta), \sin (2 n \theta))$ for an appropriate $\theta$. Then the distance $P_{m} P_{n}$ is the length of the chord with central angle $(2 m-2 n) \theta \bmod \pi$, that is, $2|\sin ((m-n) \theta)|$. Our task is then finding $\theta$ such that (i) $\sin (k \theta)$ is rational for all $k \in \mathbb{Z}$; (ii) points $P_{n}$ are all distinct. We claim that $\theta \in(0, \pi / 2)$ such that $\cos \theta=\frac{3}{5}$ and therefore $\sin \theta=\frac{4}{5}$ does the job. Proof of (i): We know that $\sin ((n+1) \theta)+\sin ((n-1) \theta)=2 \sin (n \theta) \cos \theta$, so if $\sin ((n-1) \theta$ and $\sin (n \theta)$ are both rational then $\sin ((n+1) \theta)$ also is. Since $\sin (0 \theta)=0$ and $\sin \theta$ are rational, an induction shows that $\sin (n \theta)$ is rational for $n \in \mathbb{Z}_{>0}$; the result is also true if $n$ is negative because $\sin$ is an odd function.
Proof of (ii): $P_{m}=P_{n} \Longleftrightarrow 2 n \theta=2 m \theta+2 k \pi$ for some $k \in \mathbb{Z}$, which implies $\sin ((n-m) \theta)=$ $\sin (k \pi)=0$. We show that $\sin (k \theta) \neq 0$ for all $k \neq 0$.
We prove a stronger result: let $\sin (k \theta)=\frac{a_{k}}{5^{k}}$. Then

$$
\begin{aligned}
\sin ((k+1) \theta)+\sin ((k-1) \theta)=2 \sin (k \theta) \cos \theta & \Longleftrightarrow \frac{a_{k+1}}{5^{k+1}}+\frac{a_{k-1}}{5^{k-1}}=2 \cdot \frac{a_{k}}{5^{k}} \cdot \frac{3}{5} \\
& \Longleftrightarrow a_{k+1}=6 a_{k}-25 a_{k-1}
\end{aligned}
$$

Since $a_{0}=0$ and $a_{1}=4, a_{k}$ is an integer for $k \geq 0$, and $a_{k+1} \equiv a_{k}(\bmod 5)$ for $k \geq 1$ (note that $a_{-1}=-\frac{4}{25}$ is not an integer!). Thus $a_{k} \equiv 4(\bmod 5)$ for all $k \geq 1$, and $\sin (k \theta)=\frac{a_{k}}{5^{k}}$ is an irreducible fraction with $5^{k}$ as denominator and $a_{k} \equiv 4(\bmod 5)$. This proves (ii) and we are done.

problem_match: # Problem 4


solution:
We present a different construction. Consider the (collinear) points

$$
P_{k}=\left(1, \frac{x_{k}}{y_{k}}\right),
$$

such that the distance $O P_{k}$ from the origin $O$,

$$
O P_{k}=\frac{\sqrt{x_{k}^{2}+y_{k}^{2}}}{y_{k}}
$$

is rational, and $x_{k}$ and $y_{k}$ are integers. Clearly, $P_{i} P_{j}=\left|\frac{x_{i}}{y_{i}}-\frac{x_{j}}{y_{j}}\right|$ is rational.
Perform an inversion with center $O$ and unit radius. It maps the line $x=1$, which contains all points $P_{k}$, to a circle (minus the origin). Let $Q_{k}$ be the image of $P_{k}$ under this inversion. Then

$$
Q_{i} Q_{j}=\frac{1^{2} P_{i} P_{j}}{O P_{i} \cdot O P_{j}}
$$

is rational and we are done if we choose $x_{k}$ and $y_{k}$ accordingly. But this is not hard, as we can choose the legs of a Pythagorean triple, say

$$
x_{k}=k^{2}-1, \quad y_{k}=2 k
$$

This implies $O P_{k}=\frac{k^{2}+1}{2 k}$, and then

$$
Q_{i} Q_{j}=\frac{\left|\frac{i^{2}-1}{i}-\frac{j^{2}-1}{j}\right|}{\frac{i^{2}+1}{2 i} \cdot \frac{j^{2}+1}{2 j}}=\frac{|4(i-j)(i j+1)|}{\left(i^{2}+1\right)\left(j^{2}+1\right)}
$$


problem:
You are given three lists $A, B$, and $C$. List $A$ contains the numbers of the form $10^{k}$ in base 10, with $k$ any integer greater than or equal to 1 . Lists $B$ and $C$ contain the same numbers translated into base 2 and 5 respectively:

| $A$ | $B$ | $C$ |
| :--- | :--- | :--- |
| 10 | 1010 | 20 |
| 100 | 1100100 | 400 |
| 1000 | 1111101000 | 13000 |
| $\vdots$ | $\vdots$ | $\vdots$ |

Prove that for every integer $n>1$, there is exactly one number in exactly one of the lists $B$ or $C$ that has exactly $n$ digits.

solution:
Let $b_{k}$ and $c_{k}$ be the number of digits in the $k$ th term in lists $B$ and $C$, respectively. Then

$$
2^{b_{k}-1} \leq 10^{k}<2^{b_{k}} \Longleftrightarrow \log _{2} 10^{k}<b_{k} \leq \log _{2} 10^{k}+1 \Longleftrightarrow b_{k}=\left\lfloor k \cdot \log _{2} 10\right\rfloor+1
$$

and, similarly

$$
c_{k}=\left\lfloor k \cdot \log _{5} 10\right\rfloor+1
$$

Beatty's theorem states that if $\alpha$ and $\beta$ are irrational positive numbers such that

$$
\frac{1}{\alpha}+\frac{1}{\beta}=1
$$

then the sequences $\lfloor k \alpha\rfloor$ and $\lfloor k \beta\rfloor, k=1,2, \ldots$, partition the positive integers.
Then, since

$$
\frac{1}{\log _{2} 10}+\frac{1}{\log _{5} 10}=\log _{10} 2+\log _{10} 5=\log _{10}(2 \cdot 5)=1
$$

the sequences $b_{k}-1$ and $c_{k}-1$ partition the positive integers, and therefore each integer greater than 1 appears in $b_{k}$ or $c_{k}$ exactly once. We are done.
Comment: For the sake of completeness, a proof of Beatty's theorem follows.
Let $x_{n}=\alpha n$ and $y_{n}=\beta n, n \geq 1$ integer. Note that, since $\alpha m=\beta n$ implies that $\frac{\alpha}{\beta}$ is rational but

$$
\frac{\alpha}{\beta}=\alpha \cdot \frac{1}{\beta}=\alpha\left(1-\frac{1}{\alpha}\right)=\alpha-1
$$

is irrational, the sequences have no common terms, and all terms in both sequences are irrational.
The theorem is equivalent to proving that exactly one term of either $x_{n}$ of $y_{n}$ lies in the interval $(N, N+1)$ for each $N$ positive integer. For that purpose we count the number of terms of the union of the two sequences in the interval $(0, N)$ : since $n \alpha<N \Longleftrightarrow n<\frac{N}{\alpha}$, there are $\left\lfloor\frac{N}{\alpha}\right\rfloor$ terms of $x_{n}$ in the interval and, similarly, $\left\lfloor\frac{N}{\beta}\right\rfloor$ terms of $y_{n}$ in the same interval. Since the sequences are disjoint, the total of numbers is

$$
T(N)=\left\lfloor\frac{N}{\alpha}\right\rfloor+\left\lfloor\frac{N}{\beta}\right\rfloor
$$

However, $x-1<\lfloor x\rfloor<x$ for nonintegers $x$, so

$$
\begin{aligned}
\frac{N}{\alpha}-1+\frac{N}{\beta}-1<T(N)<\frac{N}{\alpha}+\frac{N}{\beta} & \Longleftrightarrow N\left(\frac{1}{\alpha}+\frac{1}{\beta}\right)-2<T(N)<N\left(\frac{1}{\alpha}+\frac{1}{\beta}\right) \\
& \Longleftrightarrow N-2<T(N)<N,
\end{aligned}
$$

that is, $T(N)=N-1$.
Therefore the number of terms in $(N, N+1)$ is $T(N+1)-T(N)=N-(N-1)=1$, and the result follows.

problem_match: # Problem 5