Pythagorean Triples

Are integer length sides of right triangles. Here's a trick for finding them.

Enter two positive integers:
s: < t:

A Pythagorean Triple:

What might one want to do with a list of pythagorean triples? Here are a few ideas:

  • Impress your friends who have only just learned about Pythagorean triples.
  • It gets boring working with (3,4,5) all the time.
  • If designing a contaner that is to be decorated by gluing lots of some small object to the sides in a diagonal x-shape, try laying out a Pythagorean triangle in the objects -- choosing a Pythagorean triangle that has proportions that fit your materials or goals.
  • Chain two together to make a rectangular box with an integer length diagonal. For example, take 3,4,5 and 12,5,13... make two edges of a box 3 and 4 units long. Then the diagonal of a face they share will be 5. Now make the third edge length of the box 12 units long. The long diagonal of the box is the 13-unit-long hypotenuse of the triangle formed by one of the 12-unit-long edges and the 5-unit-long diagonal of a face.
    Does an example exist of such a 4-dimensional box?

How it works

The formulas for x, y, and z are as follows: x = 2*s*t, y = t^2 -s^2, and z = t^2 +s^2, you pick s and t from the positive integers. For example, if s=1 and t=2 you get (3,4,5).

If you want to ensure that the triple can't be reduced by dividing by a common factor, follow this rule: make s and t coprime (having no common divisors other than 1) and not both odd. A non-reducable Pythagorean triple is called a primitive Pythagorean triple.

It can easily be verified that x^2 +y^2 = z^2, with x, y, and z in terms of s and t, the tough part is in deriving these equations from scratch.

I've even gone so far as to generate Pythagorean triples from one number.


Back to Robert's Neat Math page