info prev up next book cdrom email home

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

\begin{displaymath}
a^2+b^2=c^2.
\end{displaymath} (1)

The smallest and best-known Pythagorean triple is $(a,b,c)=(3, 4, 5)$.


It is usual to consider only ``reduced'' (or ``primitive'') solutions in which $a$ and $b$ are Relatively Prime, since other solutions can be generated trivially from the primitive ones. 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, in every Pythagorean triple, one side is always Divisible by 3 and one by 5.


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

$\displaystyle (a_1, b_1, c_1)$ $\textstyle =$ $\displaystyle (a_0, b_0, c_0){\hbox{\sf U}}$ (2)
$\displaystyle (a_2, b_2, c_2)$ $\textstyle =$ $\displaystyle (a_0, b_0, c_0){\hbox{\sf A}}$ (3)
$\displaystyle (a_3, b_3, c_3)$ $\textstyle =$ $\displaystyle (a_0, b_0, c_0){\hbox{\sf D}},$ (4)

where
$\displaystyle {\hbox{\sf U}}$ $\textstyle \equiv$ $\displaystyle \left[\begin{array}{ccc}1 & 2 & 2\\  -2 & -1 & -2\\  2 & 2 & 3\end{array}\right]$ (5)
$\displaystyle {\hbox{\sf A}}$ $\textstyle \equiv$ $\displaystyle \left[\begin{array}{ccc}1 & 2 & 2\\  2 & 1 & 2\\  2 & 2 & 3\end{array}\right]$ (6)
$\displaystyle {\hbox{\sf D}}$ $\textstyle \equiv$ $\displaystyle \left[\begin{array}{ccc}-1 & -2 & -2\\  2 & 1 & 2\\  2 & 2 & 3\end{array}\right].$ (7)

Roberts (1977) proves that $(a, b, c)$ is a primitive Pythagorean triple Iff
\begin{displaymath}
(a,b,c)=(3,4,5){\hbox{\sf M}},
\end{displaymath} (8)

where ${\hbox{\sf M}}$ is a Finite Product of the Matrices ${\hbox{\sf U}}$, ${\hbox{\sf A}}$, ${\hbox{\sf D}}$. It therefore follows that every primitive Pythagorean triple must be a member of the Infinite array
\begin{displaymath}
\matrix{
& & & & & & (\hfill 7, & \hfill 24, & \hfill 25)\c...
...97)\cr
& & & & & & (\hfill 35, & \hfill 12, & \hfill 37)\cr}.
\end{displaymath} (9)


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

\begin{displaymath}
xy(x^4-y^4)=zw(z^4-w^4)
\end{displaymath} (10)

(Guy 1994, p. 188).


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

\begin{displaymath}
(2m, (m^2-1), (m^2+1)),
\end{displaymath} (11)

and Plato gave
\begin{displaymath}
(2m^2, (m^2-1)^2, (m^2+1)^2).
\end{displaymath} (12)

A general reduced solution (known to the early Greeks) is
\begin{displaymath}
(v^2-u^2, 2uv, u^2+v^2),
\end{displaymath} (13)

where $u$ and $v$ are Relatively Prime (Shanks 1993, p. 141). Let $F_n$ be a Fibonacci Number. Then
\begin{displaymath}
(F_nF_{n+3}, 2F_{n+1}F_{n+2}, {F_{n+1}}^2+{F_{n+2}}^2)
\end{displaymath} (14)

is also a Pythagorean triple.


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

\begin{displaymath}
P_3(a)+P_3(b)=P_3(c),
\end{displaymath} (15)

where $P_3$ is the Partition Function P (Garfunkel 1981, 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
$\displaystyle r$ $\textstyle =$ $\displaystyle X-Y$ (16)
$\displaystyle s$ $\textstyle =$ $\displaystyle Z$ (17)
$\displaystyle t$ $\textstyle =$ $\displaystyle X+Y$ (18)

(Robertson 1996).


The Area of a Triangle corresponding to the Pythagorean triple $(u^2-v^2, 2uv, u^2+v^2)$ is

\begin{displaymath}
A={\textstyle{1\over 2}}(u^2-v^2)(2uv) = uv(u^2-v^2).
\end{displaymath} (19)

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

\begin{displaymath}
s=p_1^{\alpha_1}\cdots p_n^{\alpha_n}.
\end{displaymath} (20)

The number of such Triangles is then
\begin{displaymath}
L_p(s)=\cases{
0 & for $s\equiv 2\ \left({{\rm mod\ } {4}}\right)$\cr
2^{n-1} & otherwise,\cr}
\end{displaymath} (21)

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, ... (Sloane's 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
\begin{displaymath}
s=2^{a_0}{p_1}^{\alpha_1}\cdots {p_n}^{\alpha_n}.
\end{displaymath} (22)

Then


\begin{displaymath}
L(s)=\cases{
{\textstyle{1\over 2}}[(2a_1+1)(2a_2+1)\cdots(...
...cdots(2a_n+1)-1]\hfil\cr
\quad {\rm for\ }a_0\geq 2\hfill\cr}
\end{displaymath} (23)

(Beiler 1966, p. 116). The first few numbers for $s=1$, 2, ... are 0, 0, 1, 1, 1, 1, 1, 2, 2, 1, 1, 4, 1, ... (Sloane's 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

\begin{displaymath}
s=2^{a_0}({p_1}^{a_1}\cdots {p_n}^{a_n})({q_1}^{b_1}\cdots{q_r}^{b_r}),
\end{displaymath} (24)

where the $p$s are of the form $4x-1$ and the $q$s are of the form $4x+1$. The number of possible primitive Right Triangles is then
\begin{displaymath}
H_p(s)=\cases{
2^{r-1} & for $n=0$\ and $a_0=0$\cr
0 & otherwise,\cr}.
\end{displaymath} (25)

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, ... (Sloane's 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, ... (Sloane's A006278). The number of possible primitive or nonprimitive Right Triangles having $s$ as a Hypotenuse is
\begin{displaymath}
H(s)={\textstyle{1\over 2}}[(2b_1+1)(2b_2+1)\cdots (2b_r+1)-1]
\end{displaymath} (26)

(Beiler 1966, p. 117). 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, ... (Sloane's A046080).


Therefore, the total number of ways in which $s$ may be either a Leg or Hypotenuse of a Right Triangle is given by

\begin{displaymath}
T(s)=L(s)+H(s).
\end{displaymath} (27)

The values for $s=1$, 2, ... are 0, 0, 1, 1, 2, 1, 1, 2, 2, 2, 1, 4, 2, 1, 5, 3, ... (Sloane's 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, ... (Sloane's 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)$, ... (Sloane's A046083, A046084, and A046085). 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)$ (Sloane's A046086, A046087, and A046088). Of these 16 primitive triplets, seven are twin triplets (defined as triplets for which two members are consecutive integers). The first few twin triplets, sorted by increasing $c$, are $(3,4,5)$, $(5,12,13)$, $(7,24,25)$, $(20,21,29)$, $(9,40,41)$, $(11,60,61)$, $(13,84,85)$, $(15, 112, 113)$, ....


Let the number of triples with Hypotenuse less than $N$ be denoted $\Delta(N)$, and the number of twin triplets with Hypotenuse less than $N$ be denoted $\Delta_2(N)$. Then, as the following table suggests and Lehmer (1900) proved, the number of primitive solutions with Hypotenuse less than $N$ satisfies

\begin{displaymath}
\lim_{N\to\infty} {\Delta(N)\over N} = {1\over 2\pi} = 0.1591549\ldots.
\end{displaymath} (28)

$N$ $\Delta(N)$ $\Delta(N)/N$ $\Delta_2(N)$
100 16 0.1600 7
500 80 0.1600 17
1000 158 0.1580 24
2000 319 0.1595 34
3000 477 0.1590 41
4000 639 0.1598 47
5000 792 0.1584 52
10000 1593 0.1593 74


Considering twin triplets in which the Legs are consecutive, a closed form is available for the $r$th such pair. Consider the general reduced solution $(u^2-v^2, 2uv, u^2+v^2)$, then the requirement that the Legs be consecutive integers is

\begin{displaymath}
u^2-v^2=2uv\pm 1.
\end{displaymath} (29)

Rearranging gives
\begin{displaymath}
(u-v)^2-2v^2=\pm 1.
\end{displaymath} (30)

Defining
$\displaystyle u$ $\textstyle =$ $\displaystyle x+y$ (31)
$\displaystyle v$ $\textstyle =$ $\displaystyle y$ (32)

then gives the Pell Equation
\begin{displaymath}
x^2-2y^2=1.
\end{displaymath} (33)

Solutions to the Pell Equation are given by
$\displaystyle x$ $\textstyle =$ $\displaystyle {(1+\sqrt{2}\,)^r+(1-\sqrt{2}\,)^r\over 2}$ (34)
$\displaystyle y$ $\textstyle =$ $\displaystyle {(1+\sqrt{2}\,)^r-(1-\sqrt{2}\,)^r\over 2\sqrt{2}},$ (35)

so the lengths of the legs $X_r$ and $Y_r$ and the Hypotenuse $Z_r$ are
$\displaystyle X_r$ $\textstyle =$ $\displaystyle u^2-v^2=x^2+2xy$  
  $\textstyle =$ $\displaystyle {(\sqrt{2}\,+1)^{2r+1}-(\sqrt{2}\,-1)^{2r+1}\over 4} +{\textstyle{1\over 2}}(-1)^r$ (36)
$\displaystyle Y_r$ $\textstyle =$ $\displaystyle 2uv=2xy+2y^2$  
  $\textstyle =$ $\displaystyle {(\sqrt{2}\,+1)^{2r+1}-(\sqrt{2}\,-1)^{2r+1}\over 4} -{\textstyle{1\over 2}}(-1)^r$ (37)
$\displaystyle Z_r$ $\textstyle =$ $\displaystyle u^2+v^2=x^2+2xy+2y^2$  
  $\textstyle =$ $\displaystyle {(\sqrt{2}\,+1)^{2r+1}+(\sqrt{2}\,-1)^{2r+1}\over 2\sqrt{2}}.$ (38)

Denoting the length of the shortest Leg by $A_r$ then gives
$\displaystyle A_r$ $\textstyle =$ $\displaystyle {(\sqrt{2}+1)^{2r+1}-(\sqrt{2}-1)^{2r+1}\over 4}-{1\over 2}$ (39)
$\displaystyle Z_r$ $\textstyle =$ $\displaystyle {(\sqrt{2}+1)^{2r+1}+(\sqrt{2}-1)^{2r+1}\over 2\sqrt{2}}$ (40)

(Beiler 1966, pp. 124-125 and 256-257), which cannot be solved exactly to give $r$ as a function of $Z_r$. However, the approximate number of leg-leg twin triplets $\Delta_2^L(N)=r$ less than a given value of $Z_r=N$ can be found by noting that the second term in the Denominator of $Z_r$ is a small number to the power $1+2r$ and can therefore be dropped, leaving
\begin{displaymath}
N=Z_r > {(\sqrt{2}+1)^{1+2r}\over 2\sqrt{2}}
\end{displaymath} (41)


\begin{displaymath}
N>(1+2r)\ln(\sqrt{2}+1)-\ln(2\sqrt{2}\,).
\end{displaymath} (42)

Solving for $r=\Delta_2^L(n)$ gives
$\displaystyle \Delta_2^L(N)$ $\textstyle <$ $\displaystyle {\ln N+\ln(2\sqrt{2}\,)-\ln(\sqrt{2}+1)\over 2\ln(\sqrt{2}+1)}$  
  $\textstyle <$ $\displaystyle \left\lfloor{\ln N\over 2\ln(1+\sqrt{2}\,)}\right\rfloor$ (43)
  $\textstyle \approx$ $\displaystyle 0.567\ln N.$ (44)

The first few Leg-Leg triplets are (3, 4, 5), (20, 21, 29), (119, 120, 169), (696, 697, 985), ... (Sloane's A046089, A046090, and A046091).


Leg-Hypotenuse twin triples $(a,b,c)=(v^2-u^2,2uv,u^2+v^2)$ occur whenever

\begin{displaymath}
u^2+v^2=2uv+1
\end{displaymath} (45)


\begin{displaymath}
(u-v)^2=1,
\end{displaymath} (46)

that is to say when $v=u+1$, in which case the Hypotenuse exceeds the Even Leg by unity and the twin triplet is given by $(1+2u,2u(1+u),1+2u(1+u))$. The number of leg-hypotenuse triplets with hypotenuse less than $N$ is therefore given by
\begin{displaymath}
\Delta_2^L(N)=\left\lfloor{{\textstyle{1\over 2}}(\sqrt{2N-1}-1)}\right\rfloor ,
\end{displaymath} (47)

where $\left\lfloor{x}\right\rfloor $ is the Floor Function. The first few Leg-Hypotenuse triples are (3, 4, 5), (5, 12, 13), (7, 24, 25), (9, 40, 41), (11, 60, 61), (13, 84, 85), ... (Sloane's A005408, A046092, and A046093).


The total number of twin triples $\Delta_2(N)$ less than $N$ is therefore approximately given by

$\displaystyle \Delta_2(N)$ $\textstyle =$ $\displaystyle \Delta_2^H(N)+\Delta_2^L(N)-1$ (48)
  $\textstyle \approx$ $\displaystyle \left\lfloor{{\textstyle{1\over 2}}\sqrt{2N-1}+0.567\ln N-1.5}\right\rfloor ,$ (49)

where one has been subtracted to avoid double counting of the leg-leg-hypotenuse double-twin (3,4,5).


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

$\displaystyle m_1$ $\textstyle =$ $\displaystyle r^2+rs+s^2$ (50)
$\displaystyle n_1$ $\textstyle =$ $\displaystyle r^2-s^2$ (51)


$\displaystyle m_2$ $\textstyle =$ $\displaystyle r^2+rs+s^2$ (52)
$\displaystyle n_2$ $\textstyle =$ $\displaystyle 2rs+s^2$ (53)


$\displaystyle m_3$ $\textstyle =$ $\displaystyle r^2+2rs$ (54)
$\displaystyle n_3$ $\textstyle =$ $\displaystyle r^2+rs+s^2.$ (55)

Then the Right Triangle generated by each triple ( ${m_i}^2-{n_i}^2,2m_i n_i,{m_i}^2+{n_i}^2$) has common Area
\begin{displaymath}
A=rs(2r+s)(r+2s)(r+s)(r-s)(r^2+rs+s^2)
\end{displaymath} (56)

(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). The smallest Area shared by three primitive Right Triangles is 13123110, corresponding to the triples (4485, 5852, 7373), (1380, 19019, 19069), and (3059, 8580, 9109) (Beiler 1966, p. 127).


One can also find quartets of Right Triangles with the same Area. The Quartet having smallest known area is (111, 6160, 6161), (231, 2960, 2969), (518, 1320, 1418), (280, 2442, 2458), with Area 341,880 (Beiler 1966, p. 127). Guy (1994) gives additional information.


It is also possible to find sets of three and four Pythagorean triplets having the same Perimeter (Beiler 1966, pp. 131-132). Lehmer (1900) showed that the number of primitive triples $N(p)$ with Perimeter less than $p$ is

\begin{displaymath}
\lim_{p\to\infty} N(p) = {p\ln 2\over\pi^2} =0.070230\ldots.
\end{displaymath} (57)


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:

$\displaystyle X$ $\textstyle =$ $\displaystyle 4565486027761$ (58)
$\displaystyle Y$ $\textstyle =$ $\displaystyle 1061652293520$ (59)
$\displaystyle Z$ $\textstyle =$ $\displaystyle 4687298610289,$ (60)

with
$\displaystyle Z$ $\textstyle =$ $\displaystyle 2165017^2$ (61)
$\displaystyle X+Y$ $\textstyle =$ $\displaystyle 2372159^2.$ (62)


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

\begin{displaymath}
y^2=x^3-N^2x.
\end{displaymath} (63)

A solution ($a$, $b$, $c$) exists if (63) has a Rational solution, in which case
$\displaystyle x$ $\textstyle =$ $\displaystyle {\textstyle{1\over 4}}c^2$ (64)
$\displaystyle y$ $\textstyle =$ $\displaystyle {\textstyle{1\over 8}} (a^2-b^2)c$ (65)

(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 Heronian Triangle, Pythagorean Quadruple, Right Triangle


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: Chelsea, pp. 165-190, 1952.

Dixon, R. Mathographics. New York: Dover, p. 94, 1991.

Garfunkel, J. Pi Mu Epsilon J., p. 31, 1981.

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.

Hindin, H. ``Stars, Hexes, Triangular Numbers, and Pythagorean Triples.'' J. Recr. Math. 16, 191-193, 1983-1984.

Honsberger, R. Mathematical Gems III. Washington, DC: Math. Assoc. Amer., p. 47, 1985.

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.

Sloane, N. J. A. SequencesA002144/M3823, A005408/M2400, A006278, A006593/M2499, A020882, A024361, A046079, A046080, A046081, A046083, A046084, A046085, A046086, A046087, A046089, A046090, A046091, A046092, and A046093 in ``An On-Line Version of the Encyclopedia of Integer Sequences.'' http://www.research.att.com/~njas/sequences/eisonline.html..

Taussky-Todd, O. ``The Many Aspects of the Pythagorean Triangles.'' Linear Algebra and Appl. 43, 285-295, 1982.


info prev up next book cdrom email home

© 1996-9 Eric W. Weisstein
1999-05-26