Problem

Source: Latvian TST for Baltic Way 2019 Problem 14

Tags: number theory unsolved, number theory



Let $m$ be a positive integer and $p$ be a prime, such that $m^2 - 2$ is divisible by $p$. Suppose that there exists positive integer $a$ such that $a^2+m-2$ is divisible by $p$. Prove that there exists positive integer $b$ such that $b^2- m -2$ is divisible by $p$.