TOPICS
Search

Pythagorean Triple


A Pythagorean triple is a triple of positive integers a, b, and c such that a right triangle exists with legs a,b and hypotenuse c. By the Pythagorean theorem, this is equivalent to finding positive integers a, b, and c satisfying

 a^2+b^2=c^2.
(1)

The smallest and best-known Pythagorean triple is (a,b,c)=(3,4,5). The right triangle having these side lengths is sometimes called the 3, 4, 5 triangle.

PythagoreanTriples

Plots of points in the (a,b)-plane such that (a,b,sqrt(a^2+b^2)) is a Pythagorean triple are shown above for successively larger bounds. These plots include negative values of a and b, and are therefore symmetric about both the x- and y-axes.

PythagoreanTriplesAC

Similarly, plots of points in the (a,c)-plane such that (a,sqrt(c^2-a^2),c) is a Pythagorean triple are shown above for successively larger bounds.

PrimitivePythagoreanTriple

It is usual to consider only primitive Pythagorean triples (also called "reduced"triples) in which a and b are relatively prime, since other solutions can be generated trivially from the primitive ones. The primitive triples are illustrated above, and it can be seen immediately that the radial lines corresponding to imprimitive triples in the original plot are absent in this figure. For primitive solutions, one of a or b must be even, and the other odd (Shanks 1993, p. 141), with c always odd.

In addition, one side of every Pythagorean triple is divisible by 3, another by 4, and another by 5. One side may have two of these divisors, as in (8, 15, 17), (7, 24, 25), and (20, 21, 29), or even all three, as in (11, 60, 61).

Given a primitive triple (a_0,b_0,c_0), three new primitive triples are obtained from

(a_1,b_1,c_1)=(a_0,b_0,c_0)U
(2)
(a_2,b_2,c_2)=(a_0,b_0,c_0)A
(3)
(a_3,b_3,c_3)=(a_0,b_0,c_0)D,
(4)

where

U=[ 1  2  2; -2 -1 -2;  2  2  3]
(5)
A=[ 1  2  2;  2  1  2;  2  2  3]
(6)
D=[-1 -2 -2;  2  1  2;  2  2  3].
(7)

Hall (1970) and Roberts (1977) prove that (a,b,c) is a primitive Pythagorean triple iff

 (a,b,c)=(3,4,5)M,
(8)

where M is a finite product of the matrices U, A, D. It therefore follows that every primitive Pythagorean triple must be a member of the infinite array

       ( 7,  24,  25);    ( 5,  12,  13) ( 55,  48,  73);       ( 45,  28,  53);       ( 39,  80,  89); (3, 4, 5) ( 21,  20,  29) ( 119,  120,  169);       ( 77,  36,  85);       ( 33,  56,  65);    ( 15,  8,  17) ( 65,  72,  97);       ( 35,  12,  37).
(9)

Pythagoras and the Babylonians gave a formula for generating (not necessarily primitive) triples as

 (2m,m^2-1,m^2+1),
(10)

for m>1, which generates a set of distinct triples containing neither all primitive nor all imprimitive triples (and where in the special case m=2, m^2-1<2m).

The early Greeks gave

 (v^2-u^2,2uv,u^2+v^2),
(11)

where u and v>u are relatively prime and of opposite parity (Shanks 1993, p. 141), which generates a set of distinct triples containing precisely the primitive triples (after appropriately sorting v^2-u^2 and 2uv).

Let F_n be a Fibonacci number. Then

 (F_nF_(n+3),2F_(n+1)F_(n+2),F_(n+1)^2+F_(n+2)^2)
(12)

generates distinct Pythagorean triples (Dujella 1995), although not exhaustively for either primitive or imprimitive triples. More generally, starting with positive integers a, b, and constructing the Fibonacci-like sequence {F_n^'} with terms a, b, a+b, a+2b, 2a+3b, ... generates distinct Pythagorean triples

 (F_n^'F_(n+3)^',2F_(n+1)^'F_(n+2)^',F_(n+1)^'^2+F_(n+2)^'^2)
(13)

(Horadam 1961), where

 F_n^'=1/2[(3a-b)F_n+(b-a)L_n,
(14)

where L_n is a Lucas number.

For any Pythagorean triple, the product of the two nonhypotenuse legs (i.e., the two smaller numbers) is always divisible by 12, and the product of all three sides is divisible by 60. It is not known if there are two distinct triples having the same product. The existence of two such triples corresponds to a nonzero solution to the Diophantine equation

 xy(x^4-y^4)=zw(z^4-w^4)
(15)

(Guy 1994, p. 188).

For a Pythagorean triple (a, b, c),

 P_3(a)+P_3(b)=P_3(c),
(16)

where P_3 is the partition function P (Honsberger 1985). Every three-term progression of squares r^2, s^2, t^2 can be associated with a Pythagorean triple (X,Y,Z) by

r=X-Y
(17)
s=Z
(18)
t=X+Y
(19)

(Robertson 1996).

The area of a triangle corresponding to the Pythagorean triple (u^2-v^2,2uv,u^2+v^2) is

 A=1/2(u^2-v^2)(2uv)=uv(u^2-v^2).
(20)

Fermat proved that a number of this form can never be a square number.

To find the number L_p(s) of possible primitive triangles which may have a leg (other than the hypotenuse) of length s, factor s into the form

 s=p_1^(alpha_1)...p_n^(alpha_n).
(21)

The number of such triangles is then

 L_p(s)={0   for s=2 (mod 4); 2^(n-1)   otherwise,
(22)

i.e., 0 for singly even s and 2 to the power one less than the number of distinct prime factors of s otherwise (Beiler 1966, pp. 115-116). The first few numbers for s=1, 2, ..., are 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 2, 1, 0, 2, ... (OEIS A024361). To find the number of ways L(s) in which a number s can be the leg (other than the hypotenuse) of a primitive or nonprimitive right triangle, write the factorization of s as

 s=2^(a_0)p_1^(alpha_1)...p_n^(alpha_n).
(23)

Then

 L(s)={1/2[(2a_1+1)(2a_2+1)...(2a_n+1)-1]   for a_0=0; 1/2[(2a_0-1)(2a_1+1)(2a_2+1)...(2a_n+1)-1]   for a_0>=1
(24)

(Beiler 1966, p. 116). Note that L(s)=1 iff s is prime or twice a prime. The first few numbers for s=1, 2, ... are 0, 0, 1, 1, 1, 1, 1, 2, 2, 1, 1, 4, 1, ... (OEIS A046079).

To find the number of ways H_p(s) in which a number s can be the hypotenuse of a primitive right triangle, write its factorization as

 s=2^(a_0)(p_1^(a_1)...p_n^(a_n))(q_1^(b_1)...q_r^(b_r)),
(25)

where the ps are of the form 4x-1 and the qs are of the form 4x+1. The number of possible primitive right triangles is then

 H_p(s)={2^(r-1)   for n=0 and a_0=0; 0   otherwise,.
(26)

For example, H_p(65)=2 since

65^2=16^2+63^2
(27)
=33^2+56^2.
(28)

The values of H_p(n) for n=1, 2, ... are 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, ... (OEIS A024362). The first few primes of the form 4x+1 are 5, 13, 17, 29, 37, 41, 53, 61, 73, 89, 97, 101, 109, 113, 137, ... (OEIS A002144), so the smallest side lengths which are the hypotenuses of 1, 2, 4, 8, 16, ... primitive right triangles are 5, 65, 1105, 32045, 1185665, 48612265, ... (OEIS A006278).

The number of possible primitive or nonprimitive right triangles having s as a hypotenuse is

H(s)=1/2[(2b_1+1)(2b_2+1)...(2b_r+1)-1]
(29)
=1/8[r_2(s^2)-4]
(30)

(correcting the typo of Beiler 1966, p. 117, which states that this formula gives the number of non-primitive solutions only), where r_k(n) is the sum of squares function. For example, there are four distinct integer triangles with hypotenuse 65, since

 65^2=16^2+63^2=25^2+60^2=33^2+56^2=39^2+52^2.
(31)

The first few numbers for s=1, 2, ... are 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, ... (OEIS A046080). The smallest hypotenuses having n distinct triples are 1, 5, 25, 125, 65, 3125, ... (OEIS A006339). The following table gives the hypotenuses for which there exist exactly n distinct right integer triangles for n=0, 1, ..., 5.

nOEIShypotenuses for which there exist n distinct integer triangles
0A0041441, 2, 3, 4, 6, 7, 8, 9, 11, 12, 14, 16, 18, ...
1A0846455, 10, 13, 15, 17, 20, 26, 29, 30, 34, 35, ...
2A08464625, 50, 75, 100, 150, 169, 175, 200, 225, ...
3A084647125, 250, 375, 500, 750, 875, 1000, 1125, 1375, ...
4A08464865, 85, 130, 145, 170, 185, 195, 205, 221, 255, ...
5A0846493125, 6250, 9375, 12500, 18750, 21875, 25000, ...

Therefore, the total number of ways in which s may be either a leg or hypotenuse of a right triangle is given by

 T(s)=L(s)+H(s).
(32)

The values for s=1, 2, ... are 0, 0, 1, 1, 2, 1, 1, 2, 2, 2, 1, 4, 2, 1, 5, 3, ... (OEIS A046081). The smallest numbers s which may be the sides of T general right triangles for T=1, 2, ... are 3, 5, 16, 12, 15, 125, 24, 40, ... (OEIS A006593; Beiler 1966, p. 114).

There are 50 Pythagorean triples with hypotenuse less than 100, the first few of which, sorted by increasing c, are (3, 4, 5), (6, 8,10), (5, 12, 13), (9, 12, 15), (8, 15, 17), (12, 16, 20), (15, 20, 25), (7, 24, 25), (10, 24, 26), (20, 21, 29), (18, 24, 30), (16, 30, 34), (21, 28, 35), ... (OEIS A046083, A046084, and A009000).

Of these, only 16 are primitive triplets with hypotenuse less than 100: (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), (33, 56, 65), (16, 63, 65), (48, 55, 73), (36, 77, 85), (13, 84, 85), (39, 80, 89), and (65, 72, 97) (OEIS A046086, A046087, and A020882).

Let the number of triples with hypotenuse <N be denoted Delta(N), the number of triples with hypotenuse <=N be denoted Delta^'(N), and the number of primitive triples less than N be denoted Delta_p(N). Then the following table summarizes the values for powers of 10.

DeltaOEISDelta(10), Delta(10^2), ...
Delta(N)A1019291, 50, 878, 12467, ...
Delta^'(N)A1019302, 52, 881, 12471, ...
Delta_p(N)A1019311, 16, 158, 1593, ...

Lehmer (1900) proved that the number of primitive solutions with hypotenuse less than N satisfies

 lim_(N->infty)(Delta_p(N))/N=1/(2pi)=0.1591549...
(33)

(OEIS A086201).

PythagoreanIncircles

The inradii of the first few primitive Pythagorean triangles ordered by increasing c are given by 1, 2, 3, 3, 6, 5, 4, 10, 5, ... (OEIS A014498).

There is a general method for obtaining triplets of Pythagorean triangles with equal areas. Take the three sets of generators as

m_1=r^2+rs+s^2
(34)
n_1=r^2-s^2
(35)
m_2=r^2+rs+s^2
(36)
n_2=2rs+s^2
(37)
m_3=r^2+2rs
(38)
n_3=r^2+rs+s^2.
(39)

Then the right triangle generated by each triple (m_i^2-n_i^2,2m_in_i,m_i^2+n_i^2) has common area

 A=rs(2r+s)(r+2s)(r+s)(r-s)(r^2+rs+s^2)
(40)

(Beiler 1966, pp. 126-127). The only extremum of this function occurs at (r,s)=(0,0). Since A(r,s)=0 for r=s, the smallest area shared by three nonprimitive right triangles is given by (r,s)=(1,2), which results in an area of 840 and corresponds to the triplets (24, 70, 74), (40, 42, 58), and (15, 112, 113) (Beiler 1966, p. 126).

Right triangles whose areas consist of a single digit include (3,4,5) (area of 6) and (693,1924,2045) (area of 666666; Wells 1986, p. 89).

In 1643, Fermat challenged Mersenne to find a Pythagorean triplet whose hypotenuse and sum of the legs were squares. Fermat found the smallest such solution:

X=4565486027761
(41)
Y=1061652293520
(42)
Z=4687298610289,
(43)

with

Z=2165017^2
(44)
X+Y=2372159^2.
(45)

A related problem is to determine if a specified integer N can be the area of a right triangle with rational sides. 1, 2, 3, and 4 are not the areas of any rational-sided right triangles, but 5 is (3/2, 20/3, 41/6), as is 6 (3, 4, 5). The solution to the problem involves the elliptic curve

 y^2=x^3-N^2x.
(46)

A solution (a, b, c) exists if (46) has a rational solution, in which case

x=1/4c^2
(47)
y=1/8(a^2-b^2)c
(48)

(Koblitz 1993). There is no known general method for determining if there is a solution for arbitrary N, but a technique devised by J. Tunnell in 1983 allows certain values to be ruled out (Cipra 1996).


See also

Diophantine Equation--2nd Powers, Heronian Triangle, Primitive Pythagorean Triple, Pythagorean Quadruple, Pythagorean Triangle, Right Triangle, Sum of Squares Function, Twin Pythagorean Triple

Explore with Wolfram|Alpha

References

Ball, W. W. R. and Coxeter, H. S. M. Mathematical Recreations and Essays, 13th ed. New York: Dover, pp. 57-59, 1987.Beiler, A. H. "The Eternal Triangle." Ch. 14 in Recreations in the Theory of Numbers: The Queen of Mathematics Entertains. New York: Dover, 1966.Cipra, B. "A Proof to Please Pythagoras." Science 271, 1669, 1996.Courant, R. and Robbins, H. "Pythagorean Numbers and Fermat's Last Theorem." §2.3 in Supplement to Ch. 1 in What Is Mathematics?: An Elementary Approach to Ideas and Methods, 2nd ed. Oxford, England: Oxford University Press, pp. 40-42, 1996.Dickson, L. E. "Rational Right Triangles." Ch. 4 in History of the Theory of Numbers, Vol. 2: Diophantine Analysis. New York: Dover, pp. 165-190, 2005.Dixon, R. Mathographics. New York: Dover, p. 94, 1991.Dujella, A. "Diophantine Quadruples for Squares of Fibonacci and Lucas Numbers." Portugaliae Math. 52, 305-318, 1995.Dutch, S. "Power Page: Pythagorean Triplets." http://www.uwgb.edu/dutchs/RECMATH/rmpowers.htm#pythtrip.Gardner, M. The Sixth Book of Mathematical Games from Scientific American. Chicago, IL: University of Chicago Press, pp. 158-159, 1984.Guy, R. K. "Triangles with Integer Sides, Medians, and Area." §D21 in Unsolved Problems in Number Theory, 2nd ed. New York: Springer-Verlag, pp. 188-190, 1994.Hall, A. "Classroom Note 232. Genealogy of Pythagorean Triads." Math. Gaz. 54, 377-379, 1970.Hindin, H. "Stars, Hexes, Triangular Numbers, and Pythagorean Triples." J. Recr. Math. 16, 191-193, 1983-1984.Hitotumatu, S. "Pythagorean Pseudocircles." Math. Japonica 51, 387-393, 2000.Honsberger, R. Mathematical Gems III. Washington, DC: Math. Assoc. Amer., p. 47, 1985.Horadam, A. F. "Fibonacci Number Triples." Amer. Math. Monthly 68, 751-753, 1961.Knott, R. "Pythagorean Triples." http://www.mcs.surrey.ac.uk/Personal/R.Knott/Pythag/pythag.html.Koblitz, N. Introduction to Elliptic Curves and Modular Forms, 2nd ed. New York: Springer-Verlag, pp. 1-50, 1993.Kraitchik, M. Mathematical Recreations. New York: W. W. Norton, pp. 95-104, 1942.Kramer, K. and Tunnell, J. "Elliptic Curves and Local Epsilon Factors." Comp. Math. 46, 307-352, 1982.Lehmer, D. N. "Asymptotic Evaluation of Certain Totient Sums." Amer. J. Math. 22, 294-335, 1900.Roberts, J. Elementary Number Theory: A Problem Oriented Approach. Cambridge, MA: MIT Press, 1977.Robertson, J. P. "Magic Squares of Squares." Math. Mag. 69, 289-293, 1996.Shanks, D. Solved and Unsolved Problems in Number Theory, 4th ed. New York: Chelsea, pp. 121 and 141, 1993.Sierpiński, W. Pythagorean Triangles. New York: Dover, 2003.Sloane, N. J. A. Sequences A002144/M3823, A004144/M0542, A006278, A006339, A006593/M2499, A009000, A014498, A020882, A024361, A024362, A046079, A046080, A046081, A046083, A046084, A046086, A046087, A084645, A084646, A084647, A084648, A084649, A086201, A101929, A101930, and A101931 in "The On-Line Encyclopedia of Integer Sequences."Taussky-Todd, O. "The Many Aspects of the Pythagorean Triangles." Linear Algebra and Appl. 43, 285-295, 1982.Wells, D. The Penguin Dictionary of Curious and Interesting Numbers. New York: Penguin Books, 1986.

Referenced on Wolfram|Alpha

Pythagorean Triple

Cite this as:

Weisstein, Eric W. "Pythagorean Triple." From MathWorld--A Wolfram Web Resource. https://mathworld.wolfram.com/PythagoreanTriple.html

Subject classifications