Find all functions $f: \mathbb{N}^{*} \rightarrow \mathbb{N}^{*}$ such that for all $n$, we have

$$
x f(x)+y f(y) \mid\left(x^{2}+y^{2}\right)^{2022}
$$
Here, it seems more difficult to force $x^{2}+y^{2}$ to be a prime number. Therefore, we will reason in the other direction: we are given a prime number $p$, and we seek to "force" $x f(x)+y f(y)$ to be divisible by $p$. If we assume that $p$ divides $x$ and $y$, we learn nothing.

Suppose then that $p$ divides $x$ and $f(y)$. Then $p$ must divide $\left(x^{2}+y^{2}\right)^{2022}$, so $p \mid x^{2}+y^{2}$, and since $p$ divides $x$, it also divides $y$. We have thus shown that if $x$ is coprime with $y$, then it is coprime with $f(y)$. In particular, taking $y=1$, we find $f(y)=1$. Taking $y$ as a prime, we also obtain that $f(y)$ has no prime divisor other than $p$, so $f(p)$ is a power of $p$.

Furthermore, taking $x=y=p$, we find $p f(p) \mid p^{4044}$, so $f(p)$ is of the form $p^{\alpha}$ with $0 \leqslant \alpha \leqslant 4043$. We want to show that $\alpha=1$. We fix $\alpha \in\{0,2,3,4, \ldots, 4043\}$. For any prime number $p$ such that $f(p)=p^{\alpha}$, taking $x=p$ and $y=1$, we find

$$
p^{\alpha+1}+1 \mid\left(p^{2}+1\right)^{2022}
$$

However, since $\alpha \neq 1$, the polynomial $X^{\alpha+1}+1$ does not divide the polynomial $\left(X^{2}+1\right)^{2022}$, so the remainder $R$ of the Euclidean division of $\left(X^{2}+1\right)^{2022}$ by $X^{\alpha+1}+1$ is a polynomial of degree $<\alpha+1$. But then, for any $p$ such that $f(p)=p^{\alpha}$, we have

$$
p^{\alpha+1}+1 \mid R(p)
$$

so $p^{\alpha+1}+1 \leqslant|R(p)|$, which is false for $p$ large enough. Consequently, for any $\alpha \neq 1$, there are only finitely many $p$ such that $f(p)=p^{\alpha}$, hence $f(p)=p$ for $p$ large enough.

Finally, let $x \in \mathbb{N}^{*}$. For any large enough prime $p$, we have

$$
0 \equiv\left(x^{2}+p^{2}\right)^{2022} \equiv\left(x^{2}-x f(x)\right)^{2022} \quad\left(\bmod x f(x)+p^{2}\right)
$$

using the statement with $y=p$. We deduce that $x^{2}-x f(x)$ has infinitely many divisors, so $f(x)=x$.

## 6 Combinatorics (Paul and Vincent)

## Combinatorics - Various Exercises

This course is dedicated to solving problems proposed during selection tests of various countries or pre-selected to be proposed at the International Mathematical Olympiad.