Okay, I've been making a brief foray into quadratic Diophantine equations. Here's my practice equation and it's solution to Pell form. (My questions will come after the derivation.)

$\displaystyle a^2 + a + 2 = 2c^2$

$\displaystyle a^2 + a + \frac{1}{4} - \frac{1}{4} + 2 = 2c^2$

$\displaystyle \left ( a + \frac{1}{2} \right ) ^2 + \frac{7}{4} = 2c^2$

$\displaystyle (2a + 1)^2 + 7 = 8c^2$

Let b = 2a + 1

$\displaystyle b^2 + 7 = 8c^2$

Now take this a modulo 7:

$\displaystyle b^2 \equiv c^2~\text{(mod 7)}$

Thus, since 7 is prime we obtain:

$\displaystyle b \equiv \pm c$

so

$\displaystyle b = 7y \pm c$

where y is any integer.

Plugging this in for b:

$\displaystyle (7y \pm c)^2 + 7 = 8c^2$

$\displaystyle 49y^2 \pm 14yc + c^2 + 7 = 8c^2$

$\displaystyle 49y^2 \pm 14yc - 7c^2 = -7$

$\displaystyle 7y^2 \pm 2yc - c^2 = -1$

$\displaystyle c^2 \mp 2yc + y^2 - y^2 - 7y^2 = 1$

$\displaystyle (c \mp y)^2 - 8y^2 = 1$

Let $\displaystyle x = c \mp y$ giving (finally!)

$\displaystyle x^2 - 8y^2 = 1$

This is a Pell equation. One solution to this is (x, y) = (1, 0), which generates the solutions (a, c) = (0, 1); (-1, 1).

A second solution (x, y) = (-1, 0) generates (a, c) = (0, -1); (-1, -1). So far so good.

Another solution to the Pell equation is (x, y) = (3, 1), which generates the solutions (a, c) = (4, 2); (5, 4). We can generate (a, c) = (4, -2); (5, -4) from (x, y) = (-3, 1). ((x, y) = (3, -1) and (-3, -1) simply copy these solutions.)

My first question: The "solutions" (a, c) = (4, 2); (4, -2) do not solve the original equation. Why do these solutions appear?

My second question: Two solutions (a, c) = (2, -2); (2, 2) do not appear using this method. Yet I understood that all solutions to the original equation derive from solutions to the Pell equation? I can't find a solution to the Pell equation that generates them.

Thanks!

-Dan