# Conditions on $n\in\mathbb N^+$ for $p\in\mathbb P\implies p^2+2n\notin\mathbb P$

The condition on $n\in\mathbb N^+$ for $$\forall p\in\mathbb P:\, p^2+2n\notin\mathbb P$$ seems to be: $$n\equiv 1\pmod 3\wedge 9+2n\notin\mathbb P$$

I would like to see a proof or a counter-example.

• I believe you should edit your post and omit $\forall p\in\Bbb{P}$. – Galc127 Mar 5 '17 at 13:13
• @Galc127: You are right. Have edited. – Lehs Mar 5 '17 at 13:28

If $\,p\in\mathbb P\,$ and $\,p\neq3$, then $$p\equiv1\ \ ({\rm mod}\ 3)\quad\text{or}\quad p\equiv2\ \ ({\rm mod}\ 3)$$ Square both sides and we have $$p^2\equiv1\ \ ({\rm mod}\ 3)$$
First, if $\ \,n\equiv1\ \ ({\rm mod}\ 3)$, $\ \$then $$p^2+2n\equiv1+2\equiv0\ \ ({\rm mod}\ 3)$$ Thus, $\,p^2+2n\,$ is divisible by $\,3$, which means that $\,p^2+2n\notin\mathbb P$
Besides, if $\,p=3\,$ then for $\,p^2+2n\notin\mathbb P$, it requires $$\,p^2+2n=9+2n\notin\mathbb P$$
Thus, we have proven that if $$n\equiv1\ \ ({\rm mod}\ 3)\quad\text{and}\quad9+2n\notin\mathbb P$$ then $\,p\in\mathbb P\ \Rightarrow\ p^2+2n\notin\mathbb P\,$