## Generating Pythagorean Triples

Some small Pythagorean triples are

$3, 4, 5$

$5, 12, 13$

$7, 24, 25$.

In each case, the hypotenuse has length one greater one of the legs. Let’s try to find all such triples.

Let the longer of the legs be $x$. Then the hypotenuse is $x+1$. The shorter leg must be an integer, $n$.

$(x+1)^2 = x^2 + n^2$

$2x+1 = n^2$

$x = \frac{n^2-1}{2}$.

In order to get a Pythagorean triple, $x$ must also be an integer. That means $n^2 - 1$ must be even, so $n^2$ must be odd. That happens whenever $n$ itself is odd.

$\begin{array}{ccc} n & x = (n^2 - 1)/2 & x+1 \\ 1 & 0 & 1 \\ 3 & 4 & 5 \\ 5 & 12 & 13 \\ 7 & 24 & 25 \\ 9 & 40 & 41 \\ 11 & 60 & 61 \\ 13 & 84 & 85 \end{array}$

How about Pythagorean triples where one of the legs is two less than the hypotenuse?

$(x+2)^2 = x^2 + n^2$

$4(x+1) = n^2$

$x = \frac{n^2}{4} - 1$

So here we must have $n^2$ a multiple of $4$, which happens when $n$ is even.

$\begin{array}{ccc} n & x = n^2/4-1 & x+2 \\ 2 & 0 & 2 \\ 4 & 3 & 5 \\ 6 & 8 & 10 \\ 8 & 15 & 17 \\ 10 & 24 & 26 \\ 12 & 35 & 37 \\ 14 & 48 & 50 \\ 16 & 63 & 65 \end{array}$

How about triples where a leg is $\Delta$ less than the hypotenuse?

$(x+\Delta)^2 = x^2 + n^2$

$2\Delta x + \Delta^2 = n^2$

$x = \frac{n^2 - \Delta^2}{2\Delta}$

So the numerator, $n^2 - \Delta^2$ needs to be a multiple of $\Delta$. Since the second term already is one, so must be the first. That means

$n = c*\Delta$

for some integer $c$. Plugging that back into the equation for $x$ gives

$x = \frac{(c\Delta)^2 - \Delta^2}{2\Delta} = \frac{\Delta(c^2-1)}{2}$

So if $\Delta$ is even, there’s nothing to worry about. Otherwise, $c$ must be odd.

Want to find a Pythagorean triple that has a leg $103$ shorter than the hypotenuse? Then $\Delta = 103$ so we can choose any odd number for $c$. How about $33$?

$x = \frac{103(33^2-1)}{2} = 56032$.

$n = \Delta*c = 103*33 = 3399$

We have the Pythagorean triple $3399, 56032, 56135$.

### 6 Responses to “Generating Pythagorean Triples”

1. Keith Says:

You can also generate the primitive triples using generalized Pell sequences. This partially (non-uniquely) sorts them by leg difference.
See my paper in the Rational Argumentator, an online journal. Or google: Ordering the Primitive Pythagorean Triples . . . By Size and Leg Difference Using Generalized Pell Sequences.

Or go here to see the revised version of the paper:

http://rationalargumentator.com/issue232/PPTs_Pellian.html

http://rationalargumentator.com/issue232/Pellian.pdf

Who can either unearth or craft a proof that no pair of Pythagorean triples of the form {a, b, c} and {2a, d, c} exists?

Without loss of generality, I believe, we can safely assume that the triples are primitive and the doubled leg is the even one, ie a is even.

We could extend this to any or all n such that no pair of Pythagorean triples of the form {a, b, c} and {na, d, c} exists.

Full Disclosure: At the time I posted the above challenge a fairly esteemed blogger outlined a proof using the Fibonacci Box method that triples cannot be transformed to get the above result. I argued that I needed more than inability to transform; I needed proof of the impossibility of the existence of the triples above. We agreed to disagree.

But perhaps the blogger is right and there is a proof resting on the use of Fibonacci Boxes and/or Ternary Trees.