Problem

Source: 2025 China Mathematical Olympiad Day 2 Problem 5

Tags: number theory, prime numbers



Let $p$ be a prime number and $f$ be a bijection from $\left\{0,1,\ldots,p-1\right\}$ to itself. Suppose that for integers $a,b \in \left\{0,1,\ldots,p-1\right\}$, $|f(a) - f(b)|\leqslant 2024$ if $p \mid a^2 - b$. Prove that there exists infinite many $p$ such that there exists such an $f$ and there also exists infinite many $p$ such that there doesn't exist such an $f$.