Problem

Source: IMOC 2017 N8

Tags: number theory



Find all pairs $(p,n)$ of integers so that $p$ is a prime and there exists $x,y\not\equiv0\pmod p$ with $$x^2+y^2\equiv n\pmod p.$$