Pythagorean Triples Calculator
Generate Pythagorean triples up to any limit, verify three numbers, or apply Euclid's formula to build a triple from two integers.
📐 What is a Pythagorean Triple?
A Pythagorean triple is a set of three positive integers (a, b, c) that satisfy the Pythagorean theorem: a² + b² = c². These three integers represent the side lengths of a right triangle, where c is always the hypotenuse (the longest side, opposite the right angle). The most famous triple is 3-4-5 because 9 + 16 = 25. Other well-known examples include 5-12-13, 8-15-17, 7-24-25, and 20-21-29.
Pythagorean triples appear across a remarkable range of practical contexts. Builders and surveyors use the 3-4-5 rule to verify perfect right angles at corners. Architects use them to design staircases and roof pitches with exact integer dimensions. Computer graphics programmers use Pythagorean triples to represent diagonal distances without floating-point rounding. Number theorists study them because they are the integer solutions to a Diophantine equation with a beautifully complete structure.
There are two kinds of Pythagorean triples. A primitive triple has gcd(a, b, c) = 1, meaning the three numbers share no common factor greater than 1. Examples include 3-4-5 and 5-12-13. A non-primitive triple is any integer multiple of a primitive triple, such as 6-8-10 (which is 2 times 3-4-5) or 9-12-15 (which is 3 times 3-4-5). Every Pythagorean triple is either primitive or can be reduced to a primitive triple by dividing by the GCF.
Euclid proved around 300 BCE that every primitive Pythagorean triple can be generated by two coprime integers of opposite parity. Specifically, for m greater than n greater than 0, with gcd(m, n) = 1 and exactly one of m or n even, the formulas a = m² − n², b = 2mn, and c = m² + n² produce every primitive triple exactly once. For example, m = 2, n = 1 gives 3-4-5; m = 3, n = 2 gives 5-12-13; m = 4, n = 1 gives 15-8-17.
📐 Formula
📖 How to Use This Calculator
Steps
💡 Example Calculations
Example 1 - Generate all triples up to hypotenuse 50
Find all Pythagorean triples with hypotenuse at most 50
Example 2 - Check whether 9-40-41 is a Pythagorean triple
Verify: Does 9² + 40² = 41²?
Example 3 - Use Euclid's formula with m = 5, n = 2
Generate the triple from m = 5, n = 2
❓ Frequently Asked Questions
🔗 Related Calculators
What is a Pythagorean triple?
A Pythagorean triple is a set of three positive integers a, b, c that satisfy the Pythagorean theorem: a squared plus b squared equals c squared. The integers represent the three sides of a right triangle. The most famous example is 3-4-5 because 9 + 16 = 25. Other common examples are 5-12-13, 8-15-17, and 7-24-25.
What is a primitive Pythagorean triple?
A primitive Pythagorean triple has no common factor other than 1 (gcd = 1). Examples include 3-4-5, 5-12-13, and 8-15-17. Non-primitive triples are integer multiples of a primitive triple, such as 6-8-10 (which is 2 times 3-4-5). This calculator labels each triple as primitive or non-primitive in the output table.
How does Euclid's formula generate Pythagorean triples?
Euclid's formula states that for any two positive integers m and n with m greater than n, the numbers a = m squared minus n squared, b = 2mn, and c = m squared plus n squared form a Pythagorean triple. When gcd(m, n) = 1 and m and n have opposite parity, the result is a primitive triple. Example: m = 2, n = 1 gives a = 3, b = 4, c = 5.
How many Pythagorean triples are there?
There are infinitely many Pythagorean triples. For any integer k and any primitive triple (a, b, c), the scaled triple (ka, kb, kc) is also a valid Pythagorean triple. The count of primitive triples with hypotenuse up to a limit N grows roughly as N divided by (2 pi). For example, there are 16 primitive triples with hypotenuse up to 100.
Is 6-8-10 a Pythagorean triple?
Yes. 6 squared plus 8 squared = 36 + 64 = 100 = 10 squared. However, 6-8-10 is not primitive because gcd(6, 8, 10) = 2. It is the 3-4-5 triple scaled by a factor of 2. The generator will list it as a non-primitive triple in the output table when the limit is at least 10.
What is the largest Pythagorean triple?
There is no largest Pythagorean triple since they are infinite. For any triple (a, b, c), multiplying by any integer k gives another valid triple (ka, kb, kc). The largest triple in any finite list depends on the upper limit you set. With a hypotenuse limit of 100, the largest is 60-80-100 (= 20 times 3-4-5).
How do you check if three numbers form a Pythagorean triple?
Sort the three numbers from smallest to largest. Call them a, b, c where c is largest. Compute a squared plus b squared. If the result equals c squared, the three numbers form a Pythagorean triple. Example: check 9-40-41: 81 + 1600 = 1681 = 41 squared. Yes, it is a triple. Use the Check mode in this calculator for instant verification with full arithmetic shown.
Are all Pythagorean triples generated by Euclid's formula?
Every primitive Pythagorean triple can be generated by Euclid's formula with exactly one unique pair (m, n) where m greater than n, gcd(m, n) = 1, and m and n have opposite parity. Every non-primitive triple is an integer multiple of a primitive one. So combining Euclid's formula with integer scaling covers all Pythagorean triples.
What is the 3-4-5 rule in construction?
The 3-4-5 rule is a practical method for ensuring a right angle in construction. Mark 3 units along one wall, 4 units along the adjacent wall, and verify the diagonal measures exactly 5 units. If it does, the corner is a perfect 90 degree angle. Larger multiples like 6-8-10 or 9-12-15 work equally well for bigger layouts.
Can a Pythagorean triple include non-integer values?
By strict definition, Pythagorean triples consist only of positive integers. However, any right triangle with rational side lengths can be scaled to a triple with integer sides. Irrational sides (such as 1, 1, root 2) cannot form a Pythagorean triple.
What is the pattern for Pythagorean triples with consecutive integers?
Consecutive-integer triples have the form (n, n+1, hypotenuse) or consecutive legs like (3, 4, 5) and (20, 21, 29). For odd n, the triple is (n, (n squared minus 1) divided by 2, (n squared plus 1) divided by 2). Example: n = 7 gives 7, 24, 25. These come from Euclid's formula with n = 1 and m varying.
How does the Generate mode work in this calculator?
The Generate mode uses a combination of Euclid's formula and integer scaling to find all Pythagorean triples whose hypotenuse is at most the chosen limit. It iterates over all coprime, opposite-parity pairs (m, n) to find primitive triples, then generates all multiples that stay within the limit. The results are sorted by hypotenuse, then by the smaller leg.