# Diophantine equation: x^2 - p*y^2 = -4

Warut Roonguthai warut822 at gmail.com
Mon Aug 6 01:34:56 CEST 2007

```Recently, there was a discussion in the number theory mailing list
about the existence of a solution to the Diophantine equation: x^2 -
p*y^2 = -4 when p is a prime of the form 8k + 5 and x, y are odd.

(Note that for the Diophantine equation: x^2 - p*y^2 = -4 to have a
solution in odd integers x, y, we must have p = 5 (mod 8) since any
odd square is congruent to 1 modulo 8. And if odd y > 0, then y = 1
(mod 4) since if y = 3 (mod 4), there must exist a prime factor q = 3
(mod 4) of y and we would have (x/2)^2 = -1 (mod q) which is
impossible.)

Here is the list of the smallest primes p = 5 (mod 8) such that the
Diophantine equation: x^2 - p*y^2 = -4 has no solution in odd integers
x, y:

37, 101, 197, 269, 349, 373, 389, 557, 677, 701, 709, 757, 829, 877,
997, 1213, 1301, 1613, 1861, 1901, 1949, 1973, 2069, 2221, 2269, 2341,
2357, 2621, 2797, 2837, 2917, 3109, 3181, 3301, 3413, 3709, 3797,
3821, 3853, 3877, 4013, 4021, 4093

And here is the list of the smallest primes p such that the
Diophantine equation: x^2 - p*y^2 = -4 has a solution in odd integers
x, y:

5, 13, 29, 53, 61, 109, 149, 157, 173, 181, 229, 277, 293, 317, 397,
421, 461, 509, 541, 613, 653, 661, 733, 773, 797, 821, 853, 941, 1013,
1021, 1061, 1069, 1093, 1109, 1117, 1181, 1229, 1237, 1277, 1373,
1381, 1429, 1453, 1493, 1549, 1597

My computation was done with Dario Alpern's quadratic Diophantine