# Solving the Diophantine Equation $ax^2 + bx + c = dy^2 + ey + f$?

As a fun topic for personal research, I am trying to determine everything I can about Pythagorean triples for which all three integers are one less than a perfect square (please don't say anything about this if there is a known solution, I want to try to figure it out myself).

Here is my work so far;

Let $a^2 + b^2 = c^2$ be a primitive triple (that is, $a,b,c$ are pairwise relatively prime). Then the objective is to find a positive integer $g$ so that for some positive integers $x,y,z$;

$$ag = x^2 - 1$$ $$bg = y^2 - 1$$ $$cg = z^2 - 1$$

This is equivalent to solving $\dfrac{x^2-1}{a} = \dfrac{y^2-1}{b} = \dfrac{z^2-1}{c} \in \mathbb{Z}^+$.

Now, consider the problem of solving for $x$. The equation given for $x$ can be written $x^2 \equiv 1 \pmod{a}$. Let $\alpha$ be a solution to this equation in the reduced residue system mod $a$. Then we have a family of solutions to the Diophantine equation $ag = x^2 - 1$ given by $x = at + \alpha, t \in \mathbb{N}$. This leads to

$$\dfrac{x^2-1}{a} = \dfrac{(at+\alpha)^2-1}{a} = at^2 + 2\alpha t + \dfrac{\alpha^2-1}{a}$$

Now, doing the same thing for $y$ and $z$, we can reduce the problem to finding $t,m,n$ such that

$$at^2 + 2 \alpha t + \dfrac{\alpha^2-1}{a} = bm^2 + 2 \beta m + \dfrac{\beta^2-1}{b} = cn^2 + 2 \gamma n + \dfrac{\gamma^2-1}{c}$$

In case it helps, I found a pretty nice way to factorize these

$$at^2 + 2 \alpha t + \dfrac{\alpha^2-1}{a} = a \bigg{(} t + \dfrac{\alpha+1}{a} \bigg{)} \bigg{(} t + \dfrac{\alpha-1}{a} \bigg{)}$$

with the equivalent factorizations holding for the other expressions as well.

where $\alpha^2 \equiv 1 \pmod{a}, \beta^2 \equiv 1 \pmod{b}, \gamma^2 \equiv 1 \pmod{c}$. So my question is whether there is any method for solving an equation like this, even solving the equations pairwise, in the general case or for any special properties of $a,b,c,\alpha,\beta,\gamma$.

Here are all the solutions of which I am aware;

When $a,b,c = 33,56,65$, we can set $x,y,z = 10,13,14$. This yields the equation $99^2 + 168^2 = 195^2 \implies (3a)^2 + (3b)^2 = (3c)^2$.

When $a,b,c = 133,156,205$, we have $x,y,z = 265, 287, 329$. This yields the equation $70224^2 + 82368^2 = 108240^2 \implies (528a)^2 + (528b)^2 = (528c)^2$.

• It is not clear!!! What system should solve? Commented Apr 27, 2017 at 13:21
• I will edit my question to show all the solutions I know of. Commented Apr 27, 2017 at 13:23
• And this all really boils down to solving a general two-variable quadratic Diophantine (that is guaranteed not to have an $xy$ term if that is useful). Commented Apr 27, 2017 at 13:29
• artofproblemsolving.com/community/c3046h1049910 Commented Apr 27, 2017 at 16:56
• Thanks! I will see if that method can help me. Commented Apr 27, 2017 at 17:42

This is not a complete answer, but may be of use to OP

Consider the following approach: treat $ax^2+bx+c$ and $dx^2+ey+f$ as two separate quadratic polynomials.

I will write:

$(1) ax^2+bx+c$

$(2) dy^2+ey+f$

Apply the rational root test to $(1)$ and see if there are integer roots. Note that we can already eliminate all rational candidates because we only want integer solutions. Let $\phi_i$ enumerate the divisors of $a$ and let $\psi_i$ enumerate the divisors of $c$. We want to check if $\exists i$ s.t. $\frac{\phi_i}{\psi_i}\in \mathbb{Z}$. This gives us integer solutions to $(1)$. Enumerate the integer solutions to $(1)$ by $r_i$

Now repeat the process for $(2)$, but this time enumerate the integer solutions with $k_i$ and see if $k_i=r_i$ for some $i$.

You can then add constraints to the integers (one less than a perfect square as an example), and then go through the algorithm described above.

Legendre gave a general solution to the equation $$ax^2+bxy+cy^2+dx+ey+f=0.$$ Your equation/system can certainly be put in this form, and then the parameterization given by Legendre would provide you with the answers you seek.