A Pythagorean triple is a triple of positive integers satisfying
By the Pythagorean theorem and its converse, these numbers are precisely the possible integer side lengths of a right triangle, with legs and hypotenuse . The simplest example is , since . Pythagorean triples connect geometry with number theory and provide a classical example of a Diophantine equation: an equation whose solutions are required to be integers.
Basic examples and primitive triples
Interchanging the legs does not change the underlying triangle, so and are usually treated as equivalent. The hypotenuse is always the largest entry.
A triple is primitive if
where denotes the greatest common divisor. Otherwise, it is nonprimitive.
Examples include:
| Triple | Type |
|---|---|
| Primitive | |
| Primitive | |
| Primitive | |
| Primitive | |
| Primitive | |
| Nonprimitive: twice | |
| Nonprimitive: three times |
Multiplying every entry of a triple by a positive integer produces another triple:
Conversely, dividing all three entries by their greatest common divisor produces a primitive triple. Thus every Pythagorean triple is a positive integer multiple of a unique primitive triple, apart from the order of its legs.
In a primitive triple, the entries are also pairwise coprime. If a prime divided any two entries, the defining equation would force it to divide the third.
Euclid’s parametrization
All primitive Pythagorean triples are generated, up to interchanging the legs, by
where are positive integers satisfying
and have opposite parity: one is even and the other odd.
This construction is commonly called Euclid’s formula. Its underlying identity is
For example:
| Triple | ||
|---|---|---|
| 2 | 1 | |
| 3 | 2 | |
| 4 | 1 | |
| 4 | 3 | |
| 5 | 2 |
The restrictions on ensure primitivity. A common divisor of would give a common factor in all three generated entries. If were both odd, all three entries would be even.
Every Pythagorean triple therefore has the form
possibly with the first two entries interchanged, where is a positive integer and satisfy the primitive conditions.
Why every primitive triple has this form
The completeness of the formula follows from parity and factorization.
The square of an integer is congruent to either or modulo . Consequently, the two legs of a primitive triple cannot both be odd, because their squared sum would be congruent to modulo , which is not a square. They cannot both be even either. Thus exactly one leg is even, and the hypotenuse is odd.
Write for the odd leg and for the even leg. Then
so
The two factors on the right are positive, coprime integers: any common divisor would divide both their sum and their difference . By the fundamental theorem of arithmetic, coprime positive integers whose product is a square must each be squares. Hence
Adding and subtracting gives and ; the equation for then gives .
With the odd leg designated as , these equations also show that are uniquely determined by a primitive triple.
Divisibility properties
Pythagorean triples have several useful restrictions, many of which follow from modular arithmetic.
For a primitive triple:
- Exactly one leg is even, and that leg is divisible by . In Euclid’s formula, one of is even, so is a multiple of .
- The hypotenuse is odd and satisfies .
- Exactly one leg is divisible by . If neither leg were divisible by , their squares would sum to modulo , which is impossible for a square.
- Exactly one of the three entries is divisible by . If neither leg were divisible by , their squared residues would have to be and , making the hypotenuse divisible by .
- The area is an integer divisible by , because the product of the legs is divisible by .
The restrictions to primitive triples matter. For example, the nonprimitive triple has all three entries divisible by .
These divisibility conditions are necessary but not sufficient: numbers may satisfy them without satisfying the Pythagorean equation.
Connection with rational points on a circle
Dividing a Pythagorean equation by gives
Thus each triple determines a point with rational coordinates on the unit circle. Conversely, clearing denominators in a rational point with positive coordinates produces a Pythagorean triple.
A geometric construction explains the parametrization. Consider the line through with rational slope :
Its second intersection with is
Setting , with , gives
This is Euclid’s formula after clearing denominators. It illustrates a general method in analytic geometry: using lines through a known rational point to parametrize rational points on a conic section.
Infinite families and generation
There are infinitely many primitive Pythagorean triples. Setting and taking any even integer gives
with no common divisor.
Another useful family begins with any odd integer :
The last two entries differ by , and
This yields , , , and infinitely many others.
For computational enumeration, Euclid’s formula is more efficient than testing every possible triple of integers. To list triples with , it is enough to consider
under the coprimality and parity conditions, then include multiples whose hypotenuses remain within the bound. The Euclidean algorithm supplies an efficient coprimality test.
Historical background
Integer right-triangle relations were known long before the surviving Greek mathematical texts. Old Babylonian mathematical documents contain numerical examples and systematic work involving such relations. The tablet commonly called Plimpton 322 records numbers associated with Pythagorean triples, although its precise purpose and methods of construction remain subjects of scholarly interpretation.
Greek mathematics developed geometric and arithmetic treatments of these relationships. Euclid’s Elements, Book X, Proposition 29, includes a construction of square numbers whose sum is a square, closely related to the parametrization now bearing his name.
The conventional name “Pythagorean triple” reflects the association with the Pythagorean theorem; it does not imply that Pythagoras was the first person to know or generate such triples.
Applications and related problems
Pythagorean triples provide exact integer dimensions for right triangles and rectangles with integer diagonals. The familiar -- triangle can be used to lay out a right angle, though any physical construction remains limited by measurement accuracy.
In mathematics, triples serve as examples in factorization, rational parametrization, congruences, and Diophantine analysis. They also distinguish integer geometry from unrestricted Euclidean geometry: most right triangles do not have three integer side lengths, even after rescaling.
The equation
has infinitely many positive integer solutions, whereas Fermat’s Last Theorem states that
has none when is an integer. Pythagorean triples therefore mark a fundamental contrast between equations involving squares and their higher-power analogues.