Are there any integer solutions to $x^2 - (n^2 - 2)y^2 = -1$?

380 Views Asked by At

I was just wondering if there are any integer solutions to the Diophantine equation:

$x^2 - (n^2 - 2)y^2 = -1 \ \ $ for $n > 2$

I don't think there are any but can't prove why.

3

There are 3 best solutions below

5
On BEST ANSWER

Note that if $d$ is divisible by a prime $p$ of the form $4k+3$, then the equation $x^2-dy^2\equiv -1$ cannot have a solution, for $x^2\equiv -1\pmod{p}$ does not have a solution.

If $n>2$ is odd, then $n^2-2\equiv -1\pmod{4}$, so $n^2-2$ is divisible by a prime of the form $4k+3$.

If $n$ is divisible by $4$, then again $n^2-2$ is divisible by a prime of the form $4k+3$. But this leaves the possibility $n\equiv 2\pmod{4}$, where $n^2-2$ need not have a prime divisor of the form $4k+3$.

Remark: Will Jagy has settled the problem in general, by observing that the continued fraction of $\sqrt{n^2-2}$ has period $4$. (If $\sqrt{d}$ has continued fraction with even period, then the equation $x^2-dy^2=-1$ has no integer solutions.)

There is an approach that does not use properties of continued fractions, but instead uses basic properties of Pell equations. Note that $x=n^2-1$, $y=n$ is a solution of the Pell equation $x^2-(n^2-2)y^2=1$. If there were solutions of $x^2-(n^2-2)y^2=-1$, there would be a fundamental solution $(a_0,b_0)$, and $(n^2-1,n)$ would be an "even power" of $(a_0,b_0)$, in the sense that $n^2-1+n\sqrt{n^2-2}=(a_0+b_0\sqrt{n^2-2})^{2k}$ for some positive integer $k$. This is not possible, for if $(a_0+b_0\sqrt{n^2-2})^{2k}=a+b\sqrt{n^2-2}$, then $a \ge n^2-1$, and we cannot have equality.

5
On

EDIT: in simple terms, this follows from the fact that the continued fraction for $\sqrt{n^2 -2}$ has period $4,$ with coefficients $$ [n-1;1,n-2,1,2n-2] $$

There are no solutions for $$ x^2 - (n^2-2)y^2 = -1 $$ with $n>2.$The small values of $ x^2 - (n^2-2)y^2,$ given by continued fractions or by this, the method of neighboring reduced forms, are $$ 1, \, 2, \; 3 - 2 n. $$

jagy@phobeusjunior:~/old drive/home/jagy/Cplusplus$ 
    jagy@phobeusjunior:~/old drive/home/jagy/Cplusplus$ ./Pell
Input n for Pell 
7

0  form   1 4 -3   delta  -1
1  form   -3 2 2   delta  1
2  form   2 2 -3   delta  -1
3  form   -3 4 1   delta  4
4  form   1 4 -3

 disc   28
Automorph, written on right of Gram matrix:  
2  9
3  14


 Pell automorph 
8  21
3  8

Pell unit 
8^2 - 7 * 3^2 = 1 

=========================================
jagy@phobeusjunior:~/old drive/home/jagy/Cplusplus$ ./Pell
Input n for Pell 
14

0  form   1 6 -5   delta  -1
1  form   -5 4 2   delta  2
2  form   2 4 -5   delta  -1
3  form   -5 6 1   delta  6
4  form   1 6 -5

 disc   56
Automorph, written on right of Gram matrix:  
3  20
4  27


 Pell automorph 
15  56
4  15

Pell unit 
15^2 - 14 * 4^2 = 1 

=========================================
jagy@phobeusjunior:~/old drive/home/jagy/Cplusplus$ ./Pell
Input n for Pell 
23

0  form   1 8 -7   delta  -1
1  form   -7 6 2   delta  3
2  form   2 6 -7   delta  -1
3  form   -7 8 1   delta  8
4  form   1 8 -7

 disc   92
Automorph, written on right of Gram matrix:  
4  35
5  44


 Pell automorph 
24  115
5  24

Pell unit 
24^2 - 23 * 5^2 = 1 

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

Since Andre is asking about $n \equiv 2 \pmod 4$ when $n^2 -2$ may happen to have no prime divisors $q \equiv 3 \pmod 4,$ I have also run $n=6,14.$

=========================================
jagy@phobeusjunior:~/old drive/home/jagy/Cplusplus$ 
    jagy@phobeusjunior:~/old drive/home/jagy/Cplusplus$ ./Pell
Input n for Pell 
34

0  form   1 10 -9   delta  -1
1  form   -9 8 2   delta  4
2  form   2 8 -9   delta  -1
3  form   -9 10 1   delta  10
4  form   1 10 -9

 disc   136
Automorph, written on right of Gram matrix:  
5  54
6  65


 Pell automorph 
35  204
6  35

Pell unit 
35^2 - 34 * 6^2 = 1 

=========================================
jagy@phobeusjunior:~/old drive/home/jagy/Cplusplus$ ./Pell
Input n for Pell 
194

0  form   1 26 -25   delta  -1
1  form   -25 24 2   delta  12
2  form   2 24 -25   delta  -1
3  form   -25 26 1   delta  26
4  form   1 26 -25

 disc   776
Automorph, written on right of Gram matrix:  
13  350
14  377


 Pell automorph 
195  2716
14  195

Pell unit 
195^2 - 194 * 14^2 = 1 

=========================================
jagy@phobeusjunior:~/old drive/home/jagy/Cplusplus$ 
3
On

This can be a form of Pell's equation if $\,n^2-2\,$ is not a square, and it always has non-trivial solutions with $\,y>0\,$ by a theorem of Lagrange.