Problem

Source: 2017 KMO Problem 2

Tags: number theory



Find all primes $p$ such that there exist an integer $n$ and positive integers $k, m$ which satisfies the following. $$ \frac{(mk^2+2)p-(m^2+2k^2)}{mp+2} = n^2$$