Pythagorean triple
A Pythagorean triple is a triple of positive integers a, b, and c such that a2 + b2 = c2, corresponding to the side lengths of a right-angled triangle with integer sides.[1] The most famous example is the primitive triple (3, 4, 5), where the numbers are pairwise coprime and satisfy the equation 32 + 42 = 9 + 16 = 25 = 52.[1] Other notable primitive triples include (5, 12, 13) and (8, 15, 17).[2] A primitive Pythagorean triple is defined as one in which a, b, and c share no common divisor greater than 1, meaning gcd(a, b, c) = 1.[3] Every non-primitive Pythagorean triple is a scalar multiple k times a primitive triple, where k > 1 is an integer, so if (a, b, c) is primitive, then (ka*, kb*, kc*) is also a Pythagorean triple.[2] Primitive Pythagorean triples can be systematically generated using Euclid's formula, which states that for positive integers m > n > 0 such that m and n are coprime and of opposite parity (one even, one odd), the values a = m2 - n2, b = 2mn*, c = m2 + n2 form a primitive triple.[4] This parametrization, dating back to Euclid's Elements around 300 BCE, produces all primitive triples without repetition under the given conditions.[4]Definition and Examples
Definition
A Pythagorean triple is a set of three positive integers a, b, and c that satisfy the equation a^2 + b^2 = c^2, where c represents the longest side, or hypotenuse.[5] These integers correspond to the side lengths of a right-angled triangle, with the relationship rooted in the Pythagorean theorem, which asserts that the square of the hypotenuse equals the sum of the squares of the other two sides.[2] The variables a and b are interchangeable in the equation due to its symmetry, so triples are often considered without regard to their order.[6] Pythagorean triples are classified into primitive and non-primitive forms. A primitive Pythagorean triple is one where a, b, and c are pairwise coprime, meaning their greatest common divisor is 1 (i.e., \gcd(a, b, c) = 1).[2] In contrast, a non-primitive Pythagorean triple is any integer multiple of a primitive triple, expressed as k(a, b, c) for some integer k > 1, where the common divisor k scales all sides proportionally.[7] Although named after the ancient Greek philosopher Pythagoras (c. 570–495 BCE), such triples were documented much earlier in Babylonian mathematics, with the Plimpton 322 clay tablet from around 1800 BCE listing values related to them.[8] This artifact demonstrates that the Babylonians systematically generated and recorded these integer solutions long before the theorem's formal attribution to Pythagoras.[9]Examples
The most well-known primitive Pythagorean triple is (3, 4, 5), satisfying $3^2 + 4^2 = 9 + 16 = 25 = 5^2.[2] Other common primitive triples include (5, 12, 13), where $5^2 + 12^2 = 25 + 144 = 169 = 13^2; (7, 24, 25), where $7^2 + 24^2 = 49 + 576 = 625 = 25^2; and (8, 15, 17), where $8^2 + 15^2 = 64 + 225 = 289 = 17^2.[10] These triples represent the side lengths of right-angled triangles with integer sides and no common divisor greater than 1 among the three numbers. Non-primitive Pythagorean triples are integer multiples of primitive ones. For instance, (6, 8, 10) is $2 \times (3, 4, 5), verifying $6^2 + 8^2 = 36 + 64 = 100 = 10^2, and (9, 12, 15) is $3 \times (3, 4, 5), verifying $9^2 + 12^2 = 81 + 144 = 225 = 15^2.[6] These triples visualize right triangles, such as the (3, 4, 5) triangle with legs of length 3 and 4 units, hypotenuse 5 units, area \frac{1}{2} \times 3 \times 4 = 6 square units, and perimeter $3 + 4 + 5 = 12 units.[11] Similarly, the (5, 12, 13) triangle has area \frac{1}{2} \times 5 \times 12 = 30 square units and perimeter $5 + 12 + 13 = 30 units, illustrating how such proportions scale for practical geometric constructions.[10] Historically, Pythagorean triples appear in the Babylonian clay tablet Plimpton 322, dating to around 1800 BC, which lists 15 such triples (with short legs ranging from 45 to 12,709) likely used for astronomical calculations involving right-angled geometry.[12]Generation Methods
Euclid's Formula
Euclid's formula provides a systematic method to generate Pythagorean triples, originating from a construction in Book X of Euclid's Elements for finding numbers whose squares sum to another square.[13] In its standard modern form, the formula produces all primitive Pythagorean triples using two positive integers m and n where m > n > 0, \gcd(m, n) = 1, and m and n are not both odd. The sides are given by a = m^2 - n^2, \quad b = 2mn, \quad c = m^2 + n^2. These expressions satisfy a^2 + b^2 = c^2 and ensure \gcd(a, b, c) = 1, making the triple primitive.[2] The parameters m and n must satisfy the specified conditions to guarantee primitivity: coprimality prevents a common divisor greater than 1 from dividing all three terms, while the restriction against both being odd ensures that a and c are odd and b is even, avoiding evenness in all components that would imply a factor of 2.[2] For non-primitive triples, any such primitive triple can be scaled by a positive integer k \geq 1 to yield (ka, kb, kc), which remains a Pythagorean triple but with \gcd(ka, kb, kc) = k.[2] This parametrization is complete: every primitive Pythagorean triple arises in this form for some suitable m and n, up to interchanging a and b.[2] By convention, a is taken as the odd leg and b as the even leg, though the labels are interchangeable since the formula symmetrically generates triples where either leg could be even. For instance, taking m=2 and n=1 yields the primitive triple (3, 4, 5).[2]Proof of Euclid's Formula
To derive Euclid's formula for generating primitive Pythagorean triples, begin with the equation a^2 + b^2 = c^2 where a, b, and c are positive integers forming a primitive triple, meaning \gcd(a, b, c) = 1. Without loss of generality, assume b is even (as exactly one of a or b must be even in a primitive triple, since if both were odd, c^2 would be even, implying c even and contradicting primitivity). Thus, a and c are odd.[2] Rearranging gives c^2 - a^2 = b^2, or (c - a)(c + a) = b^2. Since a and c are odd, both c - a and c + a are even. Let d = \gcd(c - a, c + a); then d divides $2c and $2a, and since \gcd(a, c) = 1, it follows that d = 2. Therefore, c - a = 2m and c + a = 2n for some positive integers m < n with \gcd(m, n) = 1 and m, n of opposite parity (not both odd, to ensure primitivity). Moreover, since (c - a)(c + a) = 4mn = b^2 and b is even, b = 2\sqrt{mn}, implying mn is a perfect square; given \gcd(m, n) = 1, both m and n must be perfect squares. Set m = u^2 and n = v^2 where u, v are positive integers with v > u > 0, \gcd(u, v) = 1, and u, v not both odd.[2][14] Solving the system c - a = 2u^2 and c + a = 2v^2 yields: c = u^2 + v^2, \quad a = v^2 - u^2, \quad b = 2uv. These satisfy a^2 + b^2 = c^2 by direct substitution: (v^2 - u^2)^2 + (2uv)^2 = v^4 - 2u^2 v^2 + u^4 + 4u^2 v^2 = u^4 + 2u^2 v^2 + v^4 = (u^2 + v^2)^2. The conditions on u and v ensure the triple is primitive: \gcd(a, b, c) = 1.[2][15] To generate all non-primitive Pythagorean triples, scale the primitive ones by a positive integer k \geq 1, yielding ka = k(v^2 - u^2), kb = k(2uv), kc = k(u^2 + v^2). Every Pythagorean triple arises this way for some k, u, and v satisfying the above conditions.[2][14]Variants of Euclid's Formula
One common variant of Euclid's formula ensures a fixed ordering where the even leg is designated as the first component a, avoiding the need to swap a and b post-generation. In this form, for integers m > n > 0 with gcd(m, n) = 1 and m and n of opposite parity (one even, one odd), the triple is given by \begin{align*} a &= 2mn, \\ b &= m^2 - n^2, \\ c &= m^2 + n^2. \end{align*} This parameterization generates all primitive Pythagorean triples with the even leg as a.[2] Another parametric form, known as Dickson's method, provides an alternative generation of Pythagorean triples using three positive integers r, s, t satisfying r^2 = 2st. The sides are then \begin{align*} a &= r + s, \\ b &= r + t, \\ c &= r + s + t. \end{align*} This method produces both primitive and non-primitive triples depending on the choice of r, s, t, and it relates to Euclid's formula through algebraic rearrangements but offers a distinct parameterization focused on additive combinations.[16] In Euclid's formula, the parameters admit an interpretation in terms of factors of the difference of squares. Specifically, the odd leg b = m^2 - n^2 factors as (m - n)(m + n), while the even leg a = 2mn can be viewed through the lens of m - n and 2n as complementary factors: setting u = m - n (odd, positive) and v = 2n (even, positive) with gcd(u, v) = 1 and u + v/2 > v/2 > 0, one recovers m = (u + v)/2 and n = v/2, yielding the triple components as products involving these factors, which highlights the arithmetic structure underlying the generation.[2] To generate non-primitive triples directly without introducing a separate scaling factor k, Euclid's formula can be applied without the coprimality or opposite-parity restrictions on m and n. In this generalized use, for any integers m > n > 0, the resulting triple (2mn, m^2 - n^2, m^2 + n^2) is a (possibly scaled) Pythagorean triple, where the common divisor arises naturally from d = gcd(m - n, n) or related common factors in m and n; for instance, if gcd(m, n) = d > 1, the triple is d times a primitive one, and if both m and n are odd, it is even (divisible by 2) and corresponds to twice a primitive triple. This approach embeds multiples intrinsically in the parameter choices.[2]Properties of Primitive Triples
General Properties
In a primitive Pythagorean triple (a, b, c) with a^2 + b^2 = c^2 and \gcd(a, b, c) = 1, exactly one leg is even and the other is odd, while the hypotenuse c is odd.[17] Conventionally, the even leg is taken as b = 2mn for coprime integers m > n > 0 of opposite parity from Euclid's formula, leaving a = m^2 - n^2 odd and c = m^2 + n^2 odd.[18] Consequently, a and c are coprime, as any common prime divisor would contradict the primitivity condition.[2] The hypotenuse c divides a^2 + b^2 by the defining equation, a trivial property of all Pythagorean triples. More notably, since c = m^2 + n^2, its prime factorization consists only of the prime 2 (though c is odd, so not) and primes congruent to 1 modulo 4; no prime congruent to 3 modulo 4 divides c.[19] The perimeter a + b + c is even, as the parities yield odd + even + odd = even.[17] Using parameters from Euclid's formula, the absolute difference between the legs is |(m^2 - n^2) - 2mn|, which simplifies to | (m - n)^2 - 2n^2 |.[18] Every Pythagorean triple is a positive integer multiple k \geq 1 of a primitive Pythagorean triple, obtained by scaling all three components by k.[2]Special Cases
The smallest primitive Pythagorean triple is (3, 4, 5), with legs of lengths 3 and 4, hypotenuse 5, and area 6.[1] This triple is fundamental, as it represents the minimal integer solution to the Pythagorean theorem where the sides share no common divisor greater than 1.[1] A distinctive family of primitive triples consists of those with legs differing by 1, known as nearly isosceles primitives; an example is (20, 21, 29), where the close leg lengths highlight the near-equality possible in such configurations. These triples arise from specific parameter choices in generation formulas and demonstrate how primitive solutions can approximate isosceles right triangles without achieving exact equality, which is impossible for integer sides. A parametric subfamily of primitives emerges when the parameters in Euclid's formula satisfy m = n + 1, producing the odd leg a = 2n + 1, even leg b = 2n(n + 1), and hypotenuse c = 2n² + 2n + 1 for positive integers n.[2] For instance, n = 1 yields (3, 4, 5), n = 2 yields (5, 12, 13), and n = 10 yields (21, 220, 221), illustrating an infinite sequence where the differences between legs and hypotenuse grow quadratically.[2] Primitive Pythagorean triples exhibit specific modular properties, such as the hypotenuse always being congruent to 1 modulo 4; moreover, every prime factor of the hypotenuse is congruent to 1 modulo 4, reflecting the representation of such primes as sums of two squares.[2] The odd leg can be congruent to either 1 or 3 modulo 4, as seen in examples like (5, 12, 13) where it is 1 modulo 4, versus (3, 4, 5) where it is 3 modulo 4.[20]Geometric Interpretations
Rational Points on the Unit Circle
A primitive Pythagorean triple (a, b, c) corresponds to a rational point on the unit circle x^2 + y^2 = 1 via the coordinates \left( \frac{a}{c}, \frac{b}{c} \right), where both coordinates are positive rationals.[2] This follows directly from the defining relation a^2 + b^2 = c^2; dividing through by c^2 yields \left( \frac{a}{c} \right)^2 + \left( \frac{b}{c} \right)^2 = 1.[15] Since a, b, and c are coprime positive integers, the fractions \frac{a}{c} and \frac{b}{c} are in lowest terms, establishing a one-to-one association between such triples and rational points in the first quadrant.[21] These rational points admit a complete parametrization derived from Euclid's formula for primitive triples. Let m > n > 0 be coprime positive integers not both odd; then x = \frac{m^2 - n^2}{m^2 + n^2}, \quad y = \frac{2mn}{m^2 + n^2} parametrizes all such points, with the associated triple given by a = m^2 - n^2, b = 2mn, c = m^2 + n^2.[2] This form arises by normalizing the triple's components to lie on the unit circle.[15] The parametrization exhausts all rational points in the first quadrant accessible via lines of rational slope from the point (-1, 0) on the circle. Any rational point (x, y) determines a unique rational slope t = \frac{y}{x + 1} from (-1, 0), and substituting this slope into the circle equation yields the point with rational coordinates if and only if t is rational; the resulting expressions match the m/n form upon clearing denominators.[22] Thus, every primitive triple emerges from this geometric construction, providing a bijection between the two sets.[21] This connection between Pythagorean triples and rational points on the unit circle was recognized by ancient Greek mathematicians, with the generating formula attributed to Euclid in his Elements around 300 BCE, though the explicit circle interpretation gained prominence in later algebraic geometry.Stereographic Projection
Stereographic projection offers a geometric approach to generating rational points on the unit circle x^2 + y^2 = 1, which directly correspond to Pythagorean triples. The method involves projecting from a fixed point on the circle to a line, ensuring that rational parameters yield rational coordinates on the circle.[17] Consider the unit circle in the plane and the point P = (-1, 0) on it. The line passing through P with rational slope t \in \mathbb{Q} intersects the circle again at a point Q = (x, y), given by the formulas x = \frac{1 - t^2}{1 + t^2}, \quad y = \frac{2t}{1 + t^2}. This parametrization arises from solving for the second intersection of the line y = t(x + 1) with the circle equation. Since t is rational, both x and y are rational.[23] To obtain a Pythagorean triple from Q, interpret x = a/c and y = b/c where a, b, c are integers satisfying a^2 + b^2 = c^2. If t = n/m in lowest terms with m, n coprime integers of opposite parity, clearing the common denominator m^2 + n^2 yields the primitive triple a = |m^2 - n^2|, b = 2mn, c = m^2 + n^2. More generally, for any rational t, scaling by the denominator produces integer sides. In unscaled form, the expressions simplify to a = |1 - t^2| \cdot d, b = 2|t| \cdot d, c = (1 + t^2) \cdot d where d clears denominators.[17] This projection maps the rational points on the line x=0 (the y-axis, where the parameter t is the y-coordinate) bijectively to the rational points on the circle excluding P, providing a complete enumeration. The geometric visualization aids in understanding infinite descent arguments, such as those proving the infinitude of primes or the irrationality of \sqrt{2}, by showing how smaller rational approximations generate larger triples. Additionally, it connects to continued fraction expansions, where convergents to irrational slopes approximate points on the circle, yielding triples with small relative errors in the hypotenuse.[23]Triples in a 2D Lattice
Pythagorean triples can be interpreted geometrically as lattice points in the 2D integer lattice \mathbb{Z}^2. Specifically, a triple (a, b, c) with a > 0, b > 0, and a^2 + b^2 = c^2 corresponds to the vector (a, b) from the origin, where c is the integer Euclidean length of this vector.[1] A triple is primitive if \gcd(a, b) = 1, which ensures that the lattice point (a, b) is visible from the origin—meaning no other lattice point lies on the line segment connecting (0, 0) to (a, b).[24] This visibility condition aligns with the requirement for primitivity in Pythagorean triples, where \gcd(a, b, c) = 1.[2] Geometrically, such a lattice point (a, b) defines an angle \theta from the positive x-axis where \tan \theta = b/a is a rational number, and the distance from the origin is the integer hypotenuse c. The number of primitive Pythagorean triples with hypotenuse at most N corresponds to the number of visible lattice points in the first quadrant at distance at most N from the origin.[24] For example, the primitive triple (3, 4, 5) arises from the visible lattice point (3, 4), as \gcd(3, 4) = 1 and no intermediate lattice points obstruct visibility. In contrast, the non-primitive triple (6, 8, 10) corresponds to (6, 8), where \gcd(6, 8) = 2 > 1, and the point (3, 4) lies midway on the segment to the origin, rendering it invisible.[2]Enumeration and Relationships
Enumeration of Primitives
Primitive Pythagorean triples can be systematically enumerated using Euclid's parametrization, where each triple (a, b, c) with a = m² - n², b = 2mn, c = m² + n² arises from integers m > n > 0 that are coprime and of opposite parity (one even, one odd).[1] The exact number of such primitives with hypotenuse c ≤ X is the count of qualifying pairs (m, n) satisfying m² + n² ≤ X. This can be computed by iterating over possible m starting from 2 upward until m² > X, and for each m, summing over n from 1 to m-1 where gcd(m, n) = 1, m and n have opposite parity, and m² + n² ≤ X. Equivalently, for each odd integer c ≤ X, determine if c is expressible as m² + n² with m > n > 0, gcd(m, n) = 1, and m, n of opposite parity; each such representation yields a unique primitive triple (up to swapping legs).[1] Asymptotically, the number of primitive Pythagorean triples with c ≤ X grows as X / (2π). This result follows from evaluating certain sums involving the Euler totient function, as established by Lehmer in his analysis of totient sums related to representations as sums of squares. For enumeration up to a given perimeter P ≤ X, note that the perimeter is P = a + b + c = 2m(m + n), so the count is the number of qualifying (m, n) pairs with m(m + n) ≤ X/2. This can be computed analogously by bounding the sums over m and n.[1] The generating function for the hypotenuses of primitive triples is connected to the theta function θ(z) = ∑_{k=-∞}^∞ q^{k²} (with q = e^{2π i z}), since the number of representations of c as a sum of two squares is captured by coefficients in θ(z)² / 4, adjusted for the primitive conditions via Möbius inversion over the divisors. However, practical enumeration typically relies on the direct summation over parameters rather than extracting coefficients.[1] The following table lists the first 16 primitive Pythagorean triples, ordered by increasing hypotenuse c (with legs a ≤ b), all with c < 100:| a | b | c |
|---|---|---|
| 3 | 4 | 5 |
| 5 | 12 | 13 |
| 8 | 15 | 17 |
| 7 | 24 | 25 |
| 20 | 21 | 29 |
| 12 | 35 | 37 |
| 9 | 40 | 41 |
| 28 | 45 | 53 |
| 11 | 60 | 61 |
| 16 | 63 | 65 |
| 33 | 56 | 65 |
| 48 | 55 | 73 |
| 13 | 84 | 85 |
| 36 | 77 | 85 |
| 39 | 80 | 89 |
| 65 | 72 | 97 |