Show that there are only four solution to $P(x^2)\equiv -1\pmod{x}$

71 Views Asked by At

The function $P(n)$ gives the smallest prime larger or equal to n. Example: $P(3)=3,P(4)=5.$

Show that, Equation $P(x^2)\equiv -1\pmod{x}$ have only four solution such as $x=1,2,3,5$? Where $x\in\mathbb{Z}_+$.

Source code Pari GP

? for(a=1,10000,if(nextprime(a^2)%a==a-1, print ([a])))
[1]
[2]
[3]
[5]