TITLE: Analysis of a quadratic diophantine equation
QUESTION [11 upvotes]: Hi! This is my first post on Math Overflow. I have two equations: $a(3a-1) + b(3b-1) = c(3c-1)$ and $a(3a-1) - b(3b-1) = d(3d-1)$. I'm trying to find properties of $a$ and $b$ that lead to solutions, where $a, b, c, d \in \mathbb{N}$. I'm having trouble applying any of the techniques in my abstract algebra book, as they mostly only apply to linear Diophantine equations.
So far, I only really have managed to deduce the following things:
$2b(3b-1) + d(3d-1) = a(3a-1) +b(3b-1)$
$2b(3b-1) = c(3c-1) - d(3d-1)$
$2b(3b-1) = (c-d)(3(c+d)-1)$
Any ideas on where to go from here would be greatly appreciated. Thanks!

REPLY [4 votes]: For this system one can find a general rational parametrization and
then N&S conditions for integer solutions.
Adding the pair:
$x^2 + y^2 = z^2 + 1$
$x^2 - y^2 = t^2 - 1$
gives:
$2 x^2 = z^2 + t^2$
which has a general rational parametrization (GPR):
$(z + t)/2  =  (v^2 - 1) x / (v^2 + 1)$
$(z - t)/2  =        2 v x / (v^2 + 1)$
Adding these gives an expression for z and plugging this back
in the first of the original pair then gives:
$(y/x)^2 - (1/x)^2  =  4 v (v^2 - 1)/(v^2 + 1)^2$  ( $= 4 R$ say)
which has GPR:
$y/x,  1/x  =  (L^2 + R)/L, (L^2 - R)/L$
and replacing $u := L (v^2 + 1)$ (to give an obvious simplification)
yields a general rational solution of the original pair as:
$D    =  u^2 - v (v^2 - 1)$
$D x  =  u (v^2 + 1)$
$D y  =  u^2 + v (v^2 - 1)$
$D z  =  u (v^2 + 2 v - 1)$
$D t  =  u (v^2 - 2 v - 1)$
Homogenizing these by taking $u, v = a/c, b/c$ with $(a, b, c) = 1$,
we now investigate how to specialize this to integer solutions.
First, $y$ is an integer iff $a^2 c - b (b^2 - c^2)$ divides $2 a^2 c$.
Equivalently, there is an integer $L$ such that:
$b L (b^2 - c^2)  =  (L - 2) a^2 c$
Then two cases arise, depending on the parity of L.
Case 1  L odd
We show that this is impossible (given the other constraints of
the problem).
If $L$ is odd then $(L, L - 2) = 1$ and thus for some integer $n$
we have:
$a^2 c,  b(b^2 - c^2)  =  L n,  (L - 2) n$
Multiplying the equations for $z$ and $t$ by $2 a b$, and plugging
the above pair into the result gives:
$2 a b z  =  a^2 (L - 2) + 2 b^2 L$
$2 a b t  =  a^2 (L - 2) - 2 b^2 L$
So letting $a, b = A e, B e$ with $(A, B) = 1$ implies the following,
in which $2 L / A$ and $(L - 2) / B$ are integers:
$2 z  =  A (L - 2) / B + B (2 L / A)$
$2 t  =  A (L - 2) / B - B (2 L / A)$
For z, t to be integers we require $A (L - 2) / B$ and $B (2 L / A)$
to both odd or both even.
If they are both odd then A and $2 L / A$ must be both odd, which
is impossible.
If they are both even then A even implies B odd and thus $2 L / A$
even, and A odd implies $(L - 2) / B$ even. So in either case this
implies L even, contrary to hypothesis.
So that leaves us with ..
Case 2  L even
Denoting $m := L / 2$ for convenience, we must how have for some
integer $n$ :
$a^2 c,  b(b^2 - c^2)  =  m n,  (m - 1) n$    [*]
which, as in Case 1, implies:
$2 z  =  A (m - 1) / B + B (2 m / A)$
$2 t  =  A (m - 1) / B - B (2 m / A)$
Again $A (m - 1) / B$ and $B (2 m / A)$ must be either both odd
or both even..
Both odd leads to the same contradiction as Case 1 as it requires
$A$ and $2 m / A$ both odd.
So they must be both even, which is the case iff $A \equiv m \mod(2)$
(provided that when $m$ is odd, $(m - 1) / B$ is even, in other
words $B$ does not divide out the power of 2 dividing $m - 1$).
Furthermore from the form of $z$, $t$, as $f \pm g$, they have
the same parity. So adding and subtracting the original pair
implies that $x, y$ are integers iff $z, t$ are integers.
Note that the above isn't an explicit integer solution. All I
have done is reduce the problem to the pair [*], to which I
have a draft solution that needs checking. But if anyone else
wishes to nip in first with a solution to these then obviously
feel free!