## 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$.

Advertisements

### 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.

2. Keith Raskin Says:

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

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

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

3. Keith Raskin Says:

HEY! How about a contest???

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.

Whaddayou think???

4. Keith Raskin Says:

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.

5. Keith Raskin Says:

PS: The proof mentioned directly above is alas invalid.

6. Keith Raskin Says:

Corollaries and conjecture:
If a pair of triples of the form {a,b,c} and {2a,d,c} exist, then it is easy to show that c – 2a, c -a, c + a and c + 2a are squares. Just look at their forms in Euclid’s algorithm, given that a must be even (must equal 2mn, c – a = m^2 – 2mn + n^2, c – 2a = r^2 – 2rs + s^2, etc.)
Let these squares be expressed as M^2, N^2, O^2 and P^2. The first and last two differ by a = N^2 – M^2, and the middle two differ by 2a. So, we can express them as M^2, N^2, 3N^2 – 2M^2 and 4N^2 – 3M^2, with M and N odd. It appears from inspection of tables that when 3N^2 – 2M^2 or 4N^2 – 3M^2 is a square, the other misses being an odd square by a factor of 8. In other words, either O or P must be irrational, it appears. In still other words, if you take an interval with perfect square endpoints and advance it by double its length, one of the new endpoints is not a perfect square; the image of the original interval under the square root function has integral length, while the image of the new one has irrational length. If this conjecture is proven true, it would suffice in proving that the original triples could not exist.
Also, if we represent O as N +q and P as N + p, then we get that q^2 + 2Nq over p^2 + 2Np must equal 2/3. There are some inherent constraints: p and q are even integers, with p bigger, and N must be greater than or equal to 1/2q^2 + Nq + 1. If that quotient can never be exactly 2/3 for qualifying entries of p, q and N, then no such original triples exist.