Problem

Source: Vietnam Mathematical Olympiad 2022 problem 4 day 1

Tags: vmo, number theory, Divisibility



For every pair of positive integers $(n,m)$ with $n<m$, denote $s(n,m)$ be the number of positive integers such that the number is in the range $[n,m]$ and the number is coprime with $m$. Find all positive integers $m\ge 2$ such that $m$ satisfy these condition: i) $\frac{s(n,m)}{m-n} \ge \frac{s(1,m)}{m}$ for all $n=1,2,...,m-1$; ii) $2022^m+1$ is divisible by $m^2$