Proving Exhaustion of Primitive Pythagorean Triples

229 Views Asked by At

I claim that the following algorithm will always give a primitive Pythagorean triple.

Let $d$ be some even number and let $D$ be the set containing all its factors. Then for any two coprime factors $d_1,d_2$ who multiply to $d$ where $d_1\equiv1\pmod 2$ and $d_2\equiv0\pmod2$, the following is always a primitive Pythagorean triple:

$$\left(d+d_1^2,d+\frac{d_2^2}{2},d+d_1^2+\frac{d_2^2}{2}\right)$$

Ex. $d=12$ has coprime factors $d_1=3$ and $d_2=4$. Plugging into our formula:

$$\left(12+3^2,12+\frac{4^2}{2},12+3^2+\frac{4^2}{2}\right)$$ $$(21,20,29)$$

I noticed this from doing some geometric constructions of inscribed circles of natural radius within known Pythagorean triple triangles and spotting patterns. I would be very surprised if this were not well known. It is fairly straightforward to show that this formula always generates a primitive Pythagorean triple by using prime factorizations. Choosing relatively composite factors simply generates nonprimitive triples.

However, I also wrote a program to check if this approach exhausts primitive Pythagorean triples, and for the first ~2.7 million triples it does. But I have no idea how one might prove something like this. Some advice would be greatly appreciated.

2

There are 2 best solutions below

0
On BEST ANSWER

This is a case of Euclid's formula, which covers all primitive triples, see e.g. here.
Condition statement is "$m$ and $n$ are coprime and one of them is even" and "$m > n > 0$".
In your case only the $d+\frac{d_2^2}{2}$ item is even because $d = d_1 d_2$ and $d_2 = 2a$ by definition, in Euclid's formula it is only $2mn$, so
$2mn = d + \frac{d_2^2}{2} = d_1 d_2 + \frac{d_2^2}{2} = d_2(d_1 + \frac{d_2}{2}) = 2a(d1 + a)$
$mn = a(d1 + a)$
As $m$ is the bigger, $m = d_1 + a$ and $n = a$.
As above $d_2 = 2a = 2n$ and $m = d_1 + a = d_1 + n$ so $d_1 = m - n$. As $d_1$ is odd by definition, one of $m$ and $n$ is even, which is Euclid's formula's one condition. The other one is to be coprime, and it is also true, as if it wasn't, then $m - n$ could be written as $gcd(m,n)$ times a number, and the same for $2n$, but then $d_1$ and $d_2$ would also not be coprime, which contradicts your condition.
Checking your other two items:
$d + d_1^2 = d_1 d_2 + d_1^2 = (m - n)2n + (m - n)^2 = 2mn - 2n^2 + m^2 - 2mn + n^2 = -n^2 + m^2$
$d + d_1^2 + \frac{d_2^2}{2} = -n^2 + m^2 + \frac{d2^2}{2} = -n^2 + m^2 + \frac{(2n)^2}{2} = -n^2 + m^2 + 2n^2 = m^2 + n^2$
Which means all items are of the form of Euclid's formula's items, therefore all generate primitive Pythagorean triples. They cover all such triples, if any $(m,n)$ can be converted to $(d_1,d_2)$. Starting from the above $d + d_1^2 = -n^2 + m^2$:
$m^2 - n^2 = (m - n)(m + n) = d + d_1^2 = d_1 d_2 + d_1^2 = d_1(d_2 + d_1)$
or in short $(m - n)(m + n) = d_1(d_2 + d_1)$
As $d_1 = m - n$ always exists for any $(m,n)$, and $d_2 + d_1 = 2n + (m - n) = n + m$, we are done - or at least I hope I haven't missed something.

8
On

Algebraically, your theorem holds up in generating Pythagorean triples.

\begin{align*} (x + y)^2 + \left(x + \dfrac{\big(\frac{x}{y}\big)^2}{2}\right)^2 &= \dfrac{x^4}{4 y^4} + \dfrac{x^3}{y^2} + 2 x^2 + 2 x y^2 + y^4 \\\\ \left(x+y^2+\frac{\big(\frac{x}{y}\big)^2}{2}\right)^2 &= \dfrac{x^4}{4 y^4} + \dfrac{x^3}{y^2} + 2 x^2 + 2 x y^2 + y^4 \end{align*}

Not all triples generated are primitive. Compare the following to the table of triples in my answer to a question asked by @VIBHU where, e.g. $\,GCD(27,26,45)=9.\,$

Note that $\,y^2\,$ is the difference $\,C-B\,$ in all triples generated.

\begin{align*} \quad x=2, y=1\implies C=5\\ \quad x=4, y=1\implies C=13\\ \quad x=6, y=1\implies C=25\\ \quad x=8, y=1\implies C=41\\ \\ \quad x=6, y=3\implies C=17\\ \quad x=12, y=3\implies C=29\\ \quad x=18, y=3\implies C=45\\ \quad x=24, y=3\implies C=65\\ \\ \quad x=10, y=5\implies C=37\\ \quad x=20, y=5\implies C=53\\ \quad x=30, y=5\implies C=73\\ \quad x=40, y=5\implies C=97\\ \end{align*}