Diophantine: $px^2+2=y^2$ where $p\in \mathbb{P}$

417 Views Asked by At

Solve the Diophantine Equation: $px^2+2=y^2$, where $p$ is a prime number and $x,y$ integers.

I tried this for ages but didn't get anywhere, but I don't know any advanced machinery since I am only in high school. I would prefer a characterization of solutions or a proof that there exist infinitely many.

Thanks for your help!

2

There are 2 best solutions below

3
On

In the Wikipedia article related to Pell'equations, you can see (in the paragraph "Transformations") that Legendre proved that the Pell's equation $$ x^2 - py^2 = 2$$ has an integer solution (hence an infinite number of integer solutions) for any prime $p\equiv -1\pmod{8}$. As shown in the comments, this is a necessary condition.

0
On

There is a particular method of doing continued fractions for quadratic irrationals, due to Gauss and Lagrange, I give a fair amount of detail at https://mathoverflow.net/questions/22811/upper-bound-of-period-length-of-continued-fraction-representation-of-very-compos/23014#23014

Since $2$ is squarefree and small in absolute value, this method shows, quickly, whether there is a solution to $x^2 - n y^2 = 2.$ I told the program to print out the values of $x,y$ that accomplish it. Here are the first few for primes $n \equiv 7 \pmod 8$:

 3^2 - 7 * 1^2 = 2 
5^2 - 23 * 1^2 = 2 
39^2 - 31 * 7^2 = 2 
7^2 - 47 * 1^2 = 2 
59^2 - 71 * 7^2 = 2
9^2 - 79 * 1^2 = 2 
477^2 - 103 * 47^2 = 2 
2175^2 - 127 * 193^2 = 2
41571^2 - 151 * 3383^2 = 2
13^2 - 167 * 1^2 = 2
2999^2 - 191 * 217^2 = 2 
127539^2 - 199 * 9041^2 = 2 
15^2 - 223 * 1^2 = 2 
2489^2 - 239 * 161^2 = 2
373^2 - 263 * 23^2 = 2 
340551^2 - 271 * 20687^2 = 2 
4109^2 - 311 * 233^2 = 2 

Let's see, it is a theorem of Lagrange that all numbers $w$ that are properly represented ($\gcd(x,y)=1$) by $x^2 - n y^2$ with $|w| < \sqrt n$ occur as first coefficients in the cycle of that form, essentially the result of finding continued fraction convergents for $\sqrt n,$ call a convergent $p/q,$ and checking the values of $p^2 - n q^2.$ If you do have a quadratic irrational, the advantage of the cycle method for computer is: (I) no decimal accuracy required, at all, and (II) no cycle detection needed. Here is most of the output for prime 199:

jagy@phobeusjunior:~/old drive/home/jagy/Cplusplus$ ./Pell 199


0  form   1 28 -3   delta  -9
1  form   -3 26 10   delta  2
2  form   10 14 -15   delta  -1
3  form   -15 16 9   delta  2
4  form   9 20 -11   delta  -2
5  form   -11 24 5   delta  5
6  form   5 26 -6   delta  -4
7  form   -6 22 13   delta  1
8  form   13 4 -15   delta  -1
9  form   -15 26 2   delta  13
10  form   2 26 -15   delta  -1
11  form   -15 4 13   delta  1
12  form   13 22 -6   delta  -4
13  form   -6 26 5   delta  5
14  form   5 24 -11   delta  -2
15  form   -11 20 9   delta  2
16  form   9 16 -15   delta  -1
17  form   -15 14 10   delta  2
18  form   10 26 -3   delta  -9
19  form   -3 28 1   delta  28
20  form   1 28 -3

 disc   796
Automorph, written on right of Gram matrix:  
123075134  3459240297
1153080099  32409317906


 Pell automorph 
16266196520  229462939701
1153080099  16266196520

Pell unit 
16266196520^2 - 199 * 1153080099^2 = 1 

=========================================

  2 
127539^2 - 199 * 9041^2 = 2 

=========================================


199       199

jagy@phobeusjunior:~/old drive/home/jagy/Cplusplus$