This site is supported by donations to The OEIS Foundation.
Pythagorean triples
A Pythagorean triple is a triple of positive integers which represent the side lengths of a Pythagorean triangle, i.e.
where and are the leg (short and long, respectively) lengths of the right triangle and is the hypotenuse length.
Pythagorean triples such that GCD = 1 are called primitive Pythagorean triples. If a Pythagorean triple is not primitive, it is possible to use it to find a primitive triple through division of by GCD. For example, 24, 32, 40 is not a primitive triple, but dividing each number by 8 it leads to the primitive triple 3, 4, 5.
Contents
Hypotenuse numbers
Hypotenuse numbers are positive integers such their square is the sum of 2 distinct nonzero squares, hence the hypotenuse of a Pythagorean triangle.
Formulae
if and only if
This provides a way to obtain all Pythagorean triples, primitive and otherwise, by iterating through pairs of integers. To obtain just the primitive Pythagorean triples requires just a few restrictions on the pairs of integers.
Theorem PYT.
In order for positive integers and to give , , that form a primitive solution to , it is necessary that and that one of and be even.
Proof. First we verify that and give a solution as prescribed by expanding thus: and then . If , that means there is a prime such that and . Then , , . Dividing out , we obtain , and , and therefore , which means is not a primitive solution.If and both and are odd, then, since the difference of two odd numbers is even, , and also , which means that are all even and we can divide out . That leaves us just the case with either or even and the other odd. Now we can be certain that is odd while is at least doubly even, regardless of which of or is even. Furthermore, because is divisible by neither nor , while is divisible by both. Likewise with , we see that it is coprime to since or , and is also coprime to , which is even and divisible by both and , confirming that is indeed a primitive Pythagorean triple, and that it could only be obtained with coprime and , one of which is even, as specified by the theorem. □
So, for example, the pair 5, 2 will give the primitive triple 21, 20, 29, while 5, 3 gives the triple 16, 30, 34, which can be 'reduced' to the primitive triple 8, 15, 17.
Sequences
Sequences (legs)
A118905 Sum of legs of Pythagorean triangles (without multiple entries).
- {7, 14, 17, 21, 23, 28, 31, 34, 35, 41, 42, 46, 47, 49, 51, 56, 62, 63, 68, 69, 70, 71, 73, 77, 79, 82, 84, 85, 89, 91, 92, 93, 94, 97, 98, 102, 103, 105, 112, 113, 115, 119, 123, 124, 126, 127, 133, 136, ...}
Sequences (short legs)
A020884 Ordered short legs of primitive Pythagorean triangles.
- {3, 5, 7, 8, 9, 11, 12, 13, 15, 16, 17, 19, 20, 20, 21, 23, 24, 25, 27, 28, 28, 29, 31, 32, 33, 33, 35, 36, 36, 37, 39, 39, 40, 41, 43, 44, 44, 45, 47, 48, 48, 49, 51, 51, 52, 52, 53, 55, 56, 57, 57, 59, 60, ...}
A009004 Ordered short legs of Pythagorean triangles.
- {3, 5, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 15, 16, 16, 17, 18, 18, 19, 20, 20, 20, 21, 21, 21, 22, 23, 24, 24, 24, 24, 25, 25, 26, 27, 27, 27, 28, 28, 28, 29, 30, 30, 30, 31, 32, 32, 32, 33, 33, 33, ...}
A046083 The smallest member of the Pythagorean triples ordered by increasing .
- {3, 6, 5, 9, 8, 12, 15, 7, 10, 20, 18, 16, 21, 12, 15, 24, 9, 27, 30, 14, 24, 20, 28, 33, 40, 36, 11, 39, 33, 25, 16, 32, 42, 48, 24, 45, 21, 30, 48, 18, 51, 40, 36, 13, 60, 39, 54, 35, 57, 65, 60, 28, 20, 48, ...}
Sequences (long legs)
A020883 Ordered long legs of primitive Pythagorean triangles.
- {4, 12, 15, 21, 24, 35, 40, 45, 55, 56, 60, 63, 72, 77, 80, 84, 91, 99, 105, 112, 117, 120, 132, 140, 143, 144, 153, 156, 165, 168, 171, 176, 180, 187, 195, 208, 209, 220, 221, 224, 231, 240, 247, 252, 253, ...}
A009012 Ordered long legs of Pythagorean triangles.
- {4, 8, 12, 12, 15, 16, 20, 21, 24, 24, 24, 28, 30, 32, 35, 36, 36, 40, 40, 42, 44, 45, 45, 48, 48, 48, 52, 55, 56, 56, 60, 60, 60, 60, 63, 63, 64, 68, 70, 72, 72, 72, 72, 75, 76, 77, 80, 80, 80, 84, 84, 84, 84, ...}
A046084 The middle member of the Pythagorean triples ordered by increasing .
- {4, 8, 12, 12, 15, 16, 20, 24, 24, 21, 24, 30, 28, 35, 36, 32, 40, 36, 40, 48, 45, 48, 45, 44, 42, 48, 60, 52, 56, 60, 63, 60, 56, 55, 70, 60, 72, 72, 64, 80, 68, 75, 77, 84, 63, 80, 72, 84, 76, 72, 80, 96, 99, ...}
Sequences (hypotenuse)
A020882 Ordered hypotenuse numbers of primitive Pythagorean triangles (squares are sums of 2 distinct nonzero squares and GCD[a,b,c] = 1).
- {5, 13, 17, 25, 29, 37, 41, 53, 61, 65, 65, 73, 85, 85, 89, 97, 101, 109, 113, 125, 137, 145, 145, 149, 157, 169, 173, 181, 185, 185, 193, 197, 205, 205, 221, 221, 229, 233, 241, 257, 265, 265, 269, 277, ...}
A009003 Hypotenuse numbers (squares are sums of 2 distinct nonzero squares).
- {5, 10, 13, 15, 17, 20, 25, 26, 29, 30, 34, 35, 37, 39, 40, 41, 45, 50, 51, 52, 53, 55, 58, 60, 61, 65, 68, 70, 73, 74, 75, 78, 80, 82, 85, 87, 89, 90, 91, 95, 97, 100, 101, 102, 104, 105, 106, 109, 110, 111, ...}
A009000 Ordered hypotenuse numbers (squares are sums of 2 distinct nonzero squares). The largest member of the Pythagorean triples ordered by increasing .
- {5, 10, 13, 15, 17, 20, 25, 25, 26, 29, 30, 34, 35, 37, 39, 40, 41, 45, 50, 50, 51, 52, 53, 55, 58, 60, 61, 65, 65, 65, 65, 68, 70, 73, 74, 75, 75, 78, 80, 82, 85, 85, 85, 85, 87, 89, 90, 91, 95, 97, 100, 100, ...}