Pythagorean triple


A Pythagorean triple consists of three positive integers,, and, such that. Such a triple is commonly written, a well-known example is. If is a Pythagorean triple, then so is for any positive integer. A triangle whose side lengths are a Pythagorean triple is a right triangle and called a Pythagorean triangle.
A primitive Pythagorean triple is one in which, and are coprime. For example, is a primitive Pythagorean triple whereas is not. Every Pythagorean triple can be scaled to a unique primitive Pythagorean triple by dividing by their greatest common divisor. Conversely, every Pythagorean triple can be obtained by multiplying the elements of a primitive Pythagorean triple by a positive integer.
The name is derived from the Pythagorean theorem, stating that every right triangle has side lengths satisfying the formula ; thus, Pythagorean triples describe the three integer side lengths of a right triangle. However, right triangles with non-integer sides do not form Pythagorean triples. For instance, the triangle with sides and is a right triangle, but is not a Pythagorean triple because the square root of 2 is not an integer. Moreover, and do not have an integer common multiple because is irrational.
Pythagorean triples have been known since ancient times. The oldest known record comes from Plimpton 322, a Babylonian clay tablet from about 1800 BC, written in a sexagesimal number system.
When searching for integer solutions, the equation is a Diophantine equation. Thus Pythagorean triples are among the oldest known solutions of a nonlinear Diophantine equation.

Examples

There are 16 primitive Pythagorean triples of numbers up to 100:
Other small Pythagorean triples such as are not listed because they are not primitive; for instance is a multiple of.
Each of these points forms a radiating line in the scatter plot to the right.
These are the remaining primitive Pythagorean triples of numbers up to 300:

Generating a triple

=
=:
a =
b =
c =

Image:PrimitivePythagoreanTriplesRev08.svg|thumb|300px|alt=Primitive Pythagorean triples shown as triangles on a graph|The primitive Pythagorean triples. The odd leg is plotted on the horizontal axis, the even leg on the vertical. The curvilinear grid is composed of curves of constant and of constant in Euclid's formula.
Image:Pythagorean Triples from Grapher.png|300px|thumb|A plot of triples generated by Euclid's formula maps out part of the cone. A constant or traces out part of a parabola on the cone.
Euclid's formula is a fundamental formula for generating Pythagorean triples given an arbitrary pair of integers and with. The formula states that the integers
form a Pythagorean triple. For example, the integers
generate the primitive triple :
The triple generated by Euclid's formula is primitive if and only if and are coprime and exactly one of them is even. When both and are odd, then,, and will be even, and the triple will not be primitive; however, dividing,, and by 2 will yield a primitive triple when and are coprime.
Every primitive triple arises from a unique pair of coprime numbers,, one of which is even. It follows that there are infinitely many primitive Pythagorean triples. This relationship of, and to and from Euclid's formula is referenced throughout the rest of this article.
Despite generating all primitive triples, Euclid's formula does not produce all triples—for example, cannot be generated using integer and. This can be remedied by inserting an additional parameter to the formula: every Pythagorean triple is generated uniquely by
where,, and are positive integers with, and with and coprime and not both odd.
That these formulas generate Pythagorean triples can be verified by expanding using elementary algebra and verifying that the result equals. Since every Pythagorean triple can be divided through by some integer to obtain a primitive triple, every triple can be generated uniquely by using the formula with and to generate its primitive counterpart and then multiplying through by as in the last equation.
Choosing and from certain integer sequences gives interesting results. For example, if and are consecutive Pell numbers, and will differ by 1.
Many formulas for generating triples with particular properties have been developed since the time of Euclid.

Proof of Euclid's formula

That satisfaction of Euclid's formula by a, b, c is sufficient for the triangle to be Pythagorean is apparent from the fact that for positive integers and,, the,, and given by the formula are all positive integers, and from the fact that
A proof of the necessity that a, b, c be expressed by Euclid's formula for any primitive Pythagorean triple is as follows. All such primitive triples can be written as where and,, are coprime. Thus,, are pairwise coprime. As and are coprime, at least one of them is odd. If we suppose that is odd, then is even and is odd.
From assume is odd. We obtain and hence Then Since is rational, we set it equal to in lowest terms. Thus being the reciprocal of Then solving
for and gives
As is fully reduced, and are coprime, and they cannot both be even. If they were both odd, the numerator of would be a multiple of 4, and the denominator 2mn would not be a multiple of 4. Since 4 would be the minimum possible even factor in the numerator and 2 would be the maximum possible even factor in the denominator, this would imply to be even despite defining it as odd. Thus one of and is odd and the other is even, and the numerators of the two fractions with denominator 2mn are odd. Thus these fractions are fully reduced. One may thus equate numerators with numerators and denominators with denominators, giving Euclid's formula
A longer but more commonplace proof is given in Maor and Sierpiński. Another proof is given in, as an instance of a general method that applies to every homogeneous Diophantine equation of degree two.

Interpretation of parameters in Euclid's formula

Suppose the sides of a Pythagorean triangle have lengths,, and, and suppose the angle between the leg of length and the hypotenuse of length is denoted as. Then and the full-angle trigonometric values are,, and.

A variant

The following variant of Euclid's formula is sometimes more convenient, as being more symmetric in and .
If and are two odd integers such that, then
are three integers that form a Pythagorean triple, which is primitive if and only if and are coprime. Conversely, every primitive Pythagorean triple arises from a unique pair of coprime odd integers.

Not exchanging ''a'' and ''b''

In the presentation above, it is said that all Pythagorean triples are uniquely obtained from Euclid's formula "after the exchange of a and b, if a is even". Euclid's formula and the variant above can be merged as follows to avoid this exchange, leading to the following result.
Every primitive Pythagorean triple can be uniquely written
where and are positive coprime integers, and if and are both odd, and otherwise. Equivalently, if is odd, and if is even.

Elementary properties of primitive Pythagorean triples

General properties

The properties of a primitive Pythagorean triple with include:
  • is always a perfect square; in fact it is equal to the square of the inradius of the associated right triangle.
  • At most one of,, is a square.
  • The area of a Pythagorean triangle cannot be the square or twice the square of an integer.
  • Exactly one of, is divisible by 2, and the hypotenuse is always odd.
  • Exactly one of, is divisible by 3, but never.
  • Exactly one of, is divisible by 4, but never .
  • Exactly one of,, is divisible by 5.
  • The largest number that always divides abc is 60.
  • Any odd number of the form, where is an integer and, can be the odd leg of a primitive Pythagorean triple. See almost-isosceles primitive Pythagorean triples section below. However, only even numbers divisible by 4 can be the even leg of a primitive Pythagorean triple. This is because Euclid's formula for the even leg given above is and one of or must be even.
  • The hypotenuse is the sum of two squares. This requires all of its prime factors to be primes of the form. Therefore, c is of the form. A sequence of possible hypotenuse numbers for a primitive Pythagorean triple can be found at.
  • The area is a congruent number divisible by 6.
  • In every Pythagorean triangle, the radius of the incircle and the radii of the three excircles are positive integers. Specifically, for a primitive triple the radius of the incircle is, and the radii of the excircles opposite the sides, 2mn, and the hypotenuse are respectively,, and.
  • As for any right triangle, the converse of Thales' theorem says that the diameter of the circumcircle equals the hypotenuse; hence for primitive triples the circumdiameter is, and the circumradius is half of this and thus is rational but non-integer.
  • When the area of a Pythagorean triangle is multiplied by the curvatures of its incircle and 3 excircles, the result is four positive integers, respectively. Integers satisfy Descartes's Circle Equation. Equivalently, the radius of the outer Soddy circle of any right triangle is equal to its semiperimeter. The outer Soddy center is located at, where is a rectangle, the right triangle and its hypotenuse.
  • Only two sides of a primitive Pythagorean triple can be simultaneously prime because by Euclid's formula for generating a primitive Pythagorean triple, one of the legs must be composite and even. However, only one side can be an integer of perfect power because if two sides were integers of perfect powers with equal exponent it would contradict the fact that there are no integer solutions to the Diophantine equation, with, and being pairwise coprime.
  • There are no Pythagorean triangles in which the hypotenuse and one leg are the legs of another Pythagorean triangle; this is one of the equivalent forms of Fermat's right triangle theorem.
  • Each primitive Pythagorean triangle has a ratio of area,, to squared semiperimeter,, that is unique to itself and is given by
  • No primitive Pythagorean triangle has an integer altitude from the hypotenuse; that is, every primitive Pythagorean triangle is indecomposable.
  • The set of all primitive Pythagorean triples forms a rooted ternary tree in a natural way; see Tree of primitive Pythagorean triples.
  • Neither of the acute angles of a Pythagorean triangle can be a rational number of degrees.