problem: Let $n \geqslant 3$ be an integer. A frog is to jump along the real axis, starting at the point 0 and making $n$ jumps: one of length 1 , one of length $2, \ldots$, one of length $n$. It may perform these $n$ jumps in any order. If at some point the frog is sitting on a number $a \leqslant 0$, its next jump must be to the right (towards the positive numbers). If at some point the frog is sitting on a number $a>0$, its next jump must be to the left (towards the negative numbers). Find the largest positive integer $k$ for which the frog can perform its jumps in such an order that it never lands on any of the numbers $1,2, \ldots, k$.

solution:
We claim that the largest positive integer $k$ with the given property is $\left\lfloor\frac{n-1}{2}\right\rfloor$, where $\lfloor x\rfloor$ is by definition the largest integer not exceeding $x$.

Consider a sequence of $n$ jumps of length $1,2, \ldots n$ such that the frog never lands on any of the numbers $1,2, \ldots, k$, where $k \geqslant 1$. Note that we must have $k<n$ in order for the frog to be able to make its first jump. As the frog jumps to the right only if it is in a number $a \leqslant 0$, and the largest jump has length $n$, it is impossible to reach numbers greater than $n$. On the other hand, suppose the frog is in a number $a>0$, then it must even be in a number $a \geqslant k+1$, since it is not allowed to hit the numbers $1,2, \ldots, k$. So the frog jumps to the left only if it is in a number $a \geqslant k+1$, and therefore it is impossible to reach numbers less than $(k+1)-n=k-n+1$. This means the frog only possibly lands on the numbers $i$ satisfying

$$
k-n+1 \leqslant i \leqslant 0 \quad \text { or } \quad k+1 \leqslant i \leqslant n \text {. }
$$

When performing a jump of length $k$, the frog has to remain at either side of the numbers $1,2, \ldots, k$. Indeed, jumping over $1,2, \ldots, k$ requires a jump of at least length $k+1$. In case it starts at a number $a>0$ (in fact $k+1 \leqslant a \leqslant n$ ), it lands in $a-k$ and we must also have $a-k \geqslant k+1$. So $2 k+1 \leqslant a \leqslant n$, therefore $2 k+1 \leqslant n$. In case it starts at a number $a \leqslant 0$ (in fact $k-n+1 \leqslant a \leqslant 0$ ), it lands in $a+k$ and we must also have $a+k \leqslant 0$. Adding $k$ to both sides of $k-n+1 \leqslant a$, we obtain $2 k-n+1 \leqslant a+k \leqslant 0$, so in this case we have $2 k+1 \leqslant n$ as well. We conclude that $k \leqslant \frac{n-1}{2}$. Since $k$ is integer, we even have $k \leqslant\left\lfloor\frac{n-1}{2}\right\rfloor$.

Next we prove that this upperbound is sharp: for $k=\left\lfloor\frac{n-1}{2}\right\rfloor$ the frog really can perform its jumps in such an order that it never lands on any of the numbers $1,2, \ldots, k$.

Suppose $n$ is odd, then $\frac{n-1}{2}$ is an integer and we have $k=\frac{n-1}{2}$, so $n=2 k+1$. We claim that when the frog performs the jumps of length $1, \ldots, 2 k+1$ in the following order, it does never land on $1,2, \ldots, k$ : it starts with a jump of length $k+1$, then it performs two jumps, one of length $k+2$ followed by one of length 1 , next two jumps of length $k+3$ and $2, \ldots$, next two jumps of length $k+(i+1)$ and $i, \ldots$, and finally two jumps of length $k+(k+1)$ and $k$. In this order of the jumps every length between 1 and $n=2 k+1$ does occur: it performs a pair of jumps for $1 \leqslant i \leqslant k$, which are the jumps of length $1,2, \ldots$, $k$ and the jumps of length $k+2, k+3, \ldots, 2 k+1$, and it starts with the jump of length $k+1$.

We now prove the correctness of this jumping scheme. After the first jump the frog lands in $k+1>k$. Now suppose the frog is in 0 or $k+1$ and is about to perform the pair of jumps of length $k+(i+1)$ and $i$. Starting from 0 , it lands in $k+(i+1)>k$, after which it lands in $(k+i+1)-i=k+1>k$. If on the contrary it starts in $k+1$, it lands in $(k+1)-(k+(i+1))=-i<1$, after which it lands in $(-i)+i=0$. We see that, starting in 0 , the frog lands in $k+1$ after the pair of jumps, while starting in $k+1$ the frog lands in 0 , while in both cases the jumps do not touch $1,2, \ldots k$. This proves the correctness of its series of jumps. As the frog (after its first jump) alters between $k+1$ and 0 exactly $k$ times, for odd $k$ it will end up in 0 , while for even $k$ it will end up in $k+1$.

Suppose $n$ is even, then $\frac{n-1}{2}$ is not an integer and we have $k=\frac{n-1}{2}-\frac{1}{2}=\frac{n-2}{2}$, so $n=2 k+2$. Let the frog firstly perform the same series of jumps as in the previous case; they still do not touch $1,2, \ldots, k$. Now let the frog make a final extra jump of length $2 k+2$. It will land in $0+(2 k+2)=2 k+2>k$ if $k$ is odd, or in $(k+1)-(2 k+2)=-k-1<1$ if $k$ is even, and its series of jumps is correct again.

We conclude that the largest positive integer $k$ with the given property is $\left\lfloor\frac{n-1}{2}\right\rfloor$.

problem_match: Problem 1.

solution_match: Solution.


problem:
Find all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ such that

$$
f(x+y)+y \leqslant f(f(f(x)))
$$

holds for all $x, y \in \mathbb{R}$.

solution:
Let $f: \mathbb{R} \rightarrow \mathbb{R}$ be a function satisfying the given inequality (2). Writing $z$ for $x+y$, we find that $f(z)+(z-x) \leqslant f(f(f(x)))$, or equivalently

$$
f(z)+z \leqslant f(f(f(x)))+x
$$

for all $x, z \in \mathbb{R}$. Substituting $z=f(f(x))$ yields $f(f(f(x)))+f(f(x)) \leqslant f(f(f(x)))+x$, from which we see that

$$
f(f(x)) \leqslant x
$$

for all $x \in \mathbb{R}$. Substituting $f(x)$ for $x$ we get $f(f(f(x))) \leqslant f(x)$, which combined with (3) gives $f(z)+z \leqslant f(f(f(x)))+x \leqslant f(x)+x$. So

$$
f(z)+z \leqslant f(x)+x
$$

for all $x, z \in \mathbb{R}$. By symmetry we see that we also have $f(x)+x \leqslant f(z)+z$, from which we conclude that in fact we even have

$$
f(z)+z=f(x)+x
$$

for all $x, z \in \mathbb{R}$. So $f(z)+z=f(0)+0$ for all $z \in \mathbb{R}$, and we conclude that $f(z)=c-z$ for some $c \in \mathbb{R}$.

Now we check whether all functions of this form satisfy the given inequality. Let $c \in \mathbb{R}$ be given and consider the function $f: \mathbb{R} \rightarrow \mathbb{R}$ defined by $f(z)=c-z$ for all $z \in \mathbb{R}$. Note that $f(f(z))=c-(c-z)=z$ for all $z \in \mathbb{R}$. For the lefthand side of (2) we find

$$
f(x+y)+y=(c-(x+y))+y=c-x,
$$

while the righthand side reads

$$
f(f(f(x)))=f(x)=c-x .
$$

We see that inequality (2) holds; in fact we even have equality here.
We conclude that the solutions to (2) are given by the functions $f: \mathbb{R} \rightarrow \mathbb{R}$ defined by $f(z)=c-z$ for all $z \in \mathbb{R}$, where $c$ is an arbitrary real constant.

problem_match: Problem 2.


problem:
Let $\triangle A B C$ be a triangle with circumcircle $\Gamma$, and let $I$ be the center of the incircle of $\triangle A B C$. The lines $A I, B I$ and $C I$ intersect $\Gamma$ in $D \neq A, E \neq B$ and $F \neq C$. The tangent lines to $\Gamma$ in $F, D$ and $E$ intersect the lines $A I, B I$ and $C I$ in $R, S$ and $T$, respectively. Prove that

$$
|A R| \cdot|B S| \cdot|C T|=|I D| \cdot|I E| \cdot|I F|
$$

solution:
We first prove that $|D B|=|D I|$. (This may also be claimed by referring to the lemma that $D$ is the centre of the circumcircle of $B I C I_{a}$.) By the constant angle theorem and the fact that $A D$ and $B E$ are angle bisectors of triangle $A B C$, we see that

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

while

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

So $\triangle B D I$ has equal angles $\angle D B I=\angle D I B$, so $|D B|=|D I|$. This proves our claim. We similarly deduce that $|E C|=|E I|$ and $|F A|=|F I|$.

Rewriting (7) into $\frac{|A R|}{|I F|} \cdot \frac{|B S|}{|I D|} \cdot \frac{|C T|}{|I E|}=1$, we see that it suffices to prove that

$$
\frac{|A R|}{|A F|} \cdot \frac{|B S|}{|B D|} \cdot \frac{|C T|}{|C E|}=1
$$

We now prove by angle chasing that $\triangle R F A \sim \triangle A C I$. As $R F$ is tangent to the circumcircle of $\triangle A F C$, we obtain (using also that $C F$ is angle bisector of $\angle A C B$ )

$$
\angle R F A=\angle F C A=\angle I C A .
$$

Moreover, from $|F A|=|F I|$ we deduce that $\angle F A I=\angle F I A$, so

$$
\angle F A R=180^{\circ}-\angle F A I=180^{\circ}-\angle F I A=\angle C I A
$$

This proves our similarity, which entails that $\frac{|A R|}{|A F|}=\frac{|I A|}{|I C|}$. In the same way we deduce that $\frac{|B S|}{|B D|}=\frac{|I B|}{|I A|}$ and $\frac{|C T|}{|C E|}=\frac{|I C|}{|I B|}$. By these equal ratios we know that

$$
\frac{|A R|}{|A F|} \cdot \frac{|B S|}{|B D|} \cdot \frac{|C T|}{|C E|}=\frac{|I A|}{|I C|} \cdot \frac{|I B|}{|I A|} \cdot \frac{|I C|}{|I B|}=1
$$

which proves (8), as required.

#

problem_match: Problem 3.


problem:
a) Find all positive integers $g$ with the following property: for each odd prime number $p$ there exists a positive integer $n$ such that $p$ divides the two integers

$$
g^{n}-n \quad \text { and } \quad g^{n+1}-(n+1)
$$

b) Find all positive integers $g$ with the following property: for each odd prime number $p$ there exists a positive integer $n$ such that $p$ divides the two integers

$$
g^{n}-n^{2} \quad \text { and } \quad g^{n+1}-(n+1)^{2}
$$

#

solution:
a) Let $g$ be a positive integer with the given property. So for each odd prime number $p$ there exists a positive integer $n$ such that $p \mid g^{n}-n$ and $p \mid g^{n+1}-(n+1)$.
If $g$ has an odd prime factor $p$, then from $p \mid g^{n}-n$ it follows that $p \mid n$, while from $p \mid g^{n+1}-(n+1)$ we deduce that $p \mid n+1$. But $p$ cannot divide both $n$ and $n+1$; contradiction. So $g$ is a power of $2: g=2^{k}$ for some $k \geqslant 0$.
If $g=2^{0}=1$, then $p \mid 1-n$ and $p \mid 1-(n+1)$, which is again a contradiction.
Suppose $k \geqslant 2$. Then $g-1$ has an odd prime factor $p$, therefore $g \equiv 1(\bmod p)$ so $0 \equiv g^{n}-n \equiv 1-n(\bmod p)$ and $0 \equiv g^{n+1}-(n+1) \equiv 1-(n+1)(\bmod p)$, which is again a contradiction.
Now we prove that $g=2^{1}=2$ does satisfy the condition. Let a prime $p>2$ be given. Choose $n=(p-1)^{2}$, then we have $n \equiv(-1)^{2}=1(\bmod p)$. By Fermat's little theorem (using $\operatorname{gcd}(2, p)=1)$ we know that $2^{p-1} \equiv 1(\bmod p)$, so

$$
2^{n}=2^{(p-1)^{2}}=\left(2^{p-1}\right)^{p-1} \equiv 1 \equiv n \quad(\bmod p)
$$

Multiplying both sides by 2 , we see that also

$$
2^{n+1} \equiv 2 n=n+n \equiv n+1 \quad(\bmod p)
$$

We conclude that only $g=2$ has the given property.
b) Let $g$ be a positive integer with the given property. So for each odd prime number $p$ there exists a positive integer $n$ such that $p \mid g^{n}-n^{2}$ and $p \mid g^{n+1}-(n+1)^{2}$.
If $g$ has an odd prime factor $p$, then from $p \mid g^{n}-n^{2}$ it follows that $p \mid n^{2}$, so also $p \mid n$, while from $p \mid g^{n+1}-(n+1)^{2}$ we deduce that $p \mid(n+1)^{2}$, so also $p \mid n+1$.

But $p$ cannot divide both $n$ and $n+1$; contradiction. So $g$ is a power of $2: g=2^{k}$ for some $k \geqslant 0$.
If $g=2^{0}=1$, then for any odd prime $p$ we have $p \mid 1-n^{2}=(1-n)(1+n)$ and $p \mid 1-(n+1)^{2}=(1-(n+1))(1+(n+1))$. Now take $p=5$. The first statement says that $n \equiv 1$ or $n \equiv-1 \equiv 4(\bmod 5)$, and the second that $n \equiv 0$ or $n \equiv-2 \equiv 3$ $(\bmod 5)$. But this yields a contradiction.
If $g=2^{1}=2$, then for any odd prime $p$ we have $p \mid 2^{n}-n^{2}$ and $p \mid 2^{n+1}-(n+1)^{2}$. Now take $p=3$. As $3 \nmid 2^{n}$ and $3 \nmid 2^{n+1}$, we know that $3 \nmid n^{2}$ and $3 \nmid(n+1)^{2}$. So these two squares must be 1 modulo 3 (as 2 can never be a square modulo 3 ). Therefore also $2^{n}$ and $2^{n+1}$ must be 1 modulo 3 , which gives $2 \cdot 1 \equiv 2 \cdot 2^{n}=2^{n+1} \equiv 1(\bmod 3)$; contradiction.
Now suppose $k \geqslant 2$. Then $g-1$ has an odd prime factor $p$, therefore $g \equiv 1(\bmod p)$ so $0 \equiv g^{n}-n^{2} \equiv 1-n^{2}=(1-n)(1+n)(\bmod p)$ and $0 \equiv g^{n+1}-(n+1)^{2} \equiv$ $1-(n+1)^{2}=(1-(n+1))(1+(n+1))(\bmod p)$. Suppose $p \geqslant 5$. The first statement says that $n \equiv 1$ or $n \equiv-1(\bmod p)$, and the second that $n \equiv 0$ or $n \equiv-2(\bmod p)$. But $n$ can only be congruent to at most one of the numbers $-2,-1,0$ and 1 , since $p \geqslant 5$; contradiction. We conclude that $p=3$, so $g-1$ contains only prime factors 3 . Hence $2^{k}-1=3^{\ell}$ for some $\ell>0$. We see that $2^{k}-1 \equiv(-1)^{k}-1(\bmod 3)$, while $3^{\ell} \equiv 0(\bmod 3)$. So $k$ has to be even, say $k=2 m$, and our equation becomes $2^{2 m}-1=3^{\ell}$, or equivalently $\left(2^{m}-1\right)\left(2^{m}+1\right)=3^{\ell}$. Not both factors on the left-hand side can be divisible by 3 , so $2^{m}-1=1$ and $2^{m}+1=3^{\ell}$, so $m=1$. Hence $g=2^{2}=4$.
Now we show that $g=4$ does have the given property. For this we use that $g=2$ is a solution to part (a): for any odd prime $p$ there exists a positive integer $n$ such that

$$
n \equiv 2^{n} \quad(\bmod p) \quad \text { and } \quad n+1 \equiv 2^{n+1} \quad(\bmod p) .
$$

Taking the square of both congruences, we obtain

$$
n^{2} \equiv\left(2^{n}\right)^{2}=\left(2^{2}\right)^{n}=4^{n} \quad(\bmod p)
$$

and

$$
(n+1)^{2} \equiv\left(2^{n+1}\right)^{2}=\left(2^{2}\right)^{n+1}=4^{n+1} \quad(\bmod p)
$$

as desired.
We conclude that only $g=4$ has the given property.

problem_match: # Problem 4.

solution_match: # Solution.