Find, with proof, all prime numbers $p$ and $q$ such that $p^2-2q^2=1$

411 Views Asked by At

Find, with proof, all prime numbers $p$ and $q$ such that $p^2-2q^2=1$.

I've got a crappy guess-and-check solution, which states that only $p=3$ and $q=2$ works, which is obvious. The equation also doesn't seem to be factorable.

How do I prove that I didn't miss anything?

2

There are 2 best solutions below

3
On

Consider the equation modulo 3. You can check that any number squared mod 3 is either 0 or 1, and in particular if $n$ is a prime not equal to 3, then $n^2$ is 1. Say $(p, q)$ solves the equation, where $p$ and $q$ are prime. If $q$ is not equal to $3$, then $2q^2+1 = 0$ (mod 3), so $p$ must be 3. So, either $p$ or $q$ is $3$, and you can check $q=3$ doesn't work clearly, so $(3,2)$ is the only solution.

4
On

$$(p-1)(p+1)=2q^2$$

Notice $p= 2$ is not a solution, and thus the left side are two even numbers, thus $q$ has to be even, not a prime if it is larger than 2