# probably Lagrange or Legendre, Pell variant

Evidently Legendre showed that, for positive primes, if $p \equiv 3 \pmod 8$ there is an integral solution to $x^2 - p y^2 = -2.$ Next, if $q \equiv 7 \pmod 8$ there is an integral solution to $x^2 -q y^2 = 2.$

What I would like, and seems to be true, is $x^2 - 2 p y^2 = -2$ for $p \equiv 3 \pmod 8,$ and $x^2 - 2 q y^2 = 2$ for $q \equiv 7 \pmod 8.$ It is probably in Mordell's book, which I do not have here.

Mordell does $x^2 - r y^2 = -1$ for any prime $r \equiv 1 \pmod 4,$ I do remember that. Anyway, I am writing up something and this issue came up.

P.S. Note these are the same as $2x^2 - p y^2 = -1$ if $p \equiv 3 \pmod 8,$ while if $q \equiv 7 \pmod 8$ there is $2x^2 -q y^2 = 1.$

-
Dirichlet generalized Legendre's technique to composite values of m in $x^2 - my^2 = d$; whether he actually treated the cases you are interested in is irrelevant since the method of proof can be transferred easily. I might have given a few references in my papers on descent on Pell conics. –  Franz Lemmermeyer Jul 2 '12 at 18:49
@Franz thanks. I looked at some of your homework solution pdfs and did not see this. I will look at the Pell conics items. –  Will Jagy Jul 2 '12 at 19:01

In volume 3, page 19, Dickson gives a bit more detail, but he seems to be reporting on writing $p$ and $2p$ as $x^2 \pm 2 y^2.$ Anyway, continued fractions are fine by me, I am happy using "reduced" indefinite binary quadratic forms, and demonstrating equivalence by finding the cycle of neighboring forms. This is a disguise for continued fractions. So if $p \equiv 3 \pmod 8,$ then $p x^2 - 2 y^2 \equiv x^2 - 2 p y^2,$ and if $q \equiv 7 \pmod 8,$ then $2 x^2 - q y^2 \equiv x^2 - 2 q y^2.$ –  Will Jagy Jul 2 '12 at 23:35