1

If $p$ is a prime number, such that there is $a\in \mathbb{Z}$ $$a^2\equiv -2 \ (\text{mod }p).$$ how do I show that one of the equations has an integer solution $$x^2+2y^2=p$$ and $$x^2+2y^2=2p?$$

I don't know where to begin with this problem. Any ideas?

ncmathsadist
  • 49,383
  • See http://math.stackexchange.com/questions/591663/for-a-prime-p-equiv-1-or-3-mod-8-show-that-the-equation-x2-2y2/591668#591668 or http://math.stackexchange.com/questions/541665/fermats-2-square-like-results-from-minkowski-lattice-proofs/549525#549525 – tc1729 Mar 05 '15 at 00:04

1 Answers1

0

We will choose $x \equiv ay \pmod{p}$ so that $x^2 = a^2y^2 \equiv -2y^2 \pmod{p}$, and so $p \mid x^2 + 2y^2$. We want to choose $y > 0$ so that both $y$ and $ay \pmod{p}$ are small. For a $t$ to be chosen later, consider the values $x_s = sy \pmod{p}$ for $s=1,\ldots,t$. Since there are $t$ values, there must be two values, say $s_1,s_2$, such that $x_{s_2} - x_{s_1} \leq p/s$ (measured on the circle $\mathbb{Z}_p$). Taking $r = s_2-s_1$, we deuce that $0 < r < s$ and $0 < x_r < p/s$. In particular, choosing $s = \lceil \sqrt{p} \rceil$ we obtain $0 < r \leq \sqrt{p}$ and $0 < x_r < \sqrt{p}$. Taking $y = r$ and $x = x_r$, we deduce $p \mid x^2 + 2y^2$ while $0 < x^2 + 2y^2 < 3p$, and so $x^2 + 2y^2 \in \{p,2p\}$.

Yuval Filmus
  • 57,157