☖ Home Units Converter Geometry Σ Math Physics Electricity

Pythagorean triples numbers generator

Print pythagoras triples
Max value of the hypotenuse c:
Primitive triples
Complete triples
m
n
k
a =
b =
c =
Note: All triple pythagorian numbers that containes values of k > 1 are not primitive.
Euclid's formula verification

Pythagoras triples summary

Print pythagoras triples summary
The Pythagorean theorem states that in a right triangle, the lengths of the sides are related by the equation:
(1)
A Pythagorean triple is a set of three integer numbers that satisfies this equation.

For example, the set   a = 3,  b = 4,  c = 5   are a Pythagorean triple.

One method to find these triple values is by using Euclid's formula. This formula expresses the sides  a,  b, and  c  in terms of two integers, m and n , where   m > n > 0   (see example bellow)..

a=m^2-n^2  b=2mn  c=m^2+n^2

Where k is a positive integer (k=2,3,4,…). If m − n is odd, k=1, and m and n are coprime (meaning they have no common factors other than 1), then the generated Pythagorean triple is primitive.

a=k(m^2-n^2 )  b=k2mn  c=k(m^2+n^2 )

Verification of Euclid's formula

Print pythagoras triples summary
Pythagorean right angle triangle sides equation
After arranging terms we get
Left side can be written by algebra laws as
Dividing both sides by (c − a) we obtain
Dividing both sides by  b  we obtain
(1)
We can now determine the relationship between the ratios c/b and a/b. To do so, let  (c − a) = n  and  b = m Substituting these definitions into the reciprocal of the right-hand side of Equation (1) gives:
c/b=n/m+a/b
(2)
Substitute equation (2) into the left side of equation (1) gives:
(c-a)/b=n/m
c/b-a/b=n/m
(3)
Substitute equation (3) into equation (2) to get the value of (c/b):
c/b=n/m+(m^2-n^2)/2mn
(4)
From equations (3) and (4) we have the values of a, b and c:

Notice that the values of m and n should be:   m > n > 0
a=m^2-n^2  b=2mn  c=m^2+n^2
(5)

Euclid's formula with n = 1

Print pythagoras triples summary
A simplified form of Euclid's formula is obtained by setting (n = 1). Under this condition, the expressions for (a), (b), and (c) reduce to the following simple equations:
a = 2 * m
b = m2 − 1
c = m2 + 1
The Pythagorean triples generated by these equations do not represent the complete set of Pythagorean triples. Furthermore, the resulting triples include both primitive and non-primitive cases. Specifically, when (m) is even, the generated triple is primitive; when (m) is odd, the generated triple is non-primitive.

Example 1 - Right triangle sides calculation

Print line example 3
If one side of a right triangle is equal to 8. Find the other sides b and c. Assume that all the sides are integers.
Notic that all sides must be integer values otherwise there are infinite number of solutions.

The solution of this question is a Pythagorean triple number, the development of the resulting numbers can be found in equation (5).

We can assume that n is equal to 1, this case yields the shorten Pythagorean triple numbers, see the equations above.

The sides are defined by the integer number m, and is equal to:

a = 2 * m = 8
hence
m = 4
Once m is found the side b is equal to:
b = m2 − 1 = 42 − 1 = 15
And the third side c is equal to:
b = m2 + 1 = 42 + 1 = 17

And the sides of the triangle will be 8, 15 and 17 (these numbers are Pythagorean triple numbers).