Page 1 of 4
feature
Complete Family of
Pythagorean Triples
From Random to Systematic Generation
In Part I of this article we presented a few methods for generating Primitive
Pythagorean Triples (PPTs). You will recall that they were all ‘piece meal’ in
character. Now we present two more approaches which offer complete
solutions to the PPT problem. Both are based on straightforward reasoning
and simple algebra. And no PPT is left out: we capture the complete family in
each case.
C ⊗ MαC
At the start we recall the definition: a Pythagorean triple is
a triple (a, b, c) of positive integers such that a2 + b2 = c2.
The triple is called ‘primitive’ if a, b, c have no common
divisor exceeding 1; we call such a triple a ‘Primitive
Pythagorean Triple’ (PPT for short). For example, (5, 12, 13) is a
PPT, while (6, 8, 10) is a Pythagorean triple which is not a PPT.
Remark. We make the following number theoretic observation
about PTs which are not PPTs. If two numbers in a PT share a
common factor exceeding 1, this factor divides the third number as
well. For example, (9, 12, 15) is a PT, and its numbers 12 and 15
share the factor 3; this factor divides 9 as well. To see why this
claim of divisibility will always be true, suppose that in the PT
(a, b, c), both b and c are divisible by some integer k. Then k2
divides both b2 and c2, hence k2 divides a2, since c2 − b2 = a2;
hence k divides a as well. This logic works no matter which two
of a, b, c are divisible by a common factor. Hence, to check that a
27 At Right Angles | Vol. 1, No. 2, December 2012
Page 2 of 4
PT is a PPT, it is enough to pick any two of its entries
and check that they are coprime; the nice thing is
that it does not matter which two entries we
pick!
Generating the Full Family of PPTs By
Solving Equations
Let (a, b, c) represent a PPT. We write its defining
relation a2 + b2 = c2 in the form
a
c
2
+
b
c
2
= 1. (1)
Let u = a/c and v = b/c. Then u and v are positive
rational numbers, and they have the same
denominator (because no ‘cancellation’ can take
place in either of the two fractions). Also, they lie
between 0 and 1, and they satisfy the equation
u2 + v2 = 1.
To solve this equation we transpose the terms and
write it in the form u2 = 1 − v2. In this form it
immediately looks more familiar, because we are
able to make use of the well known ‘difference of
two squares’ factor formula. Write the equation
u2 = 1 − v2 as
u · u = (1 − v) · (1 + v), ∴
u
1 − v = 1 + v
u . (2)
Denote the common value of u/(1 − v) and
(1 + v)/u by t (in terms of the original quantities
a, b, c we have t = a/(c − b); note that t is a
positive rational number, for it is the ratio of two
positive rational numbers):
u
1 − v = t, 1 + v
u = t. (3)
By cross-multiplication and transposing terms, we
obtain a pair of simultaneous equations in u and v:
u + tv = t,
tu − v = 1. (4)
Treating t as a fixed quantity, we solve for u and v
in the usual way (we do not give the steps here;
please check the answer we have given); we obtain:
u = 2t
t2 + 1
, v = t
2 − 1
t2 + 1
. (5)
Recall that t is a positive rational number. Let
t = m/n where m and n are positive, coprime
integers. Since u = a/c and v = b/c we get, by
substitution:
a
c = 2 · m/n
m2/n2
+ 1 = 2m n
m2 + n2 ,
b
c =
m2/n2
− 1
m2/n2
+ 1 = m2 − n2
m2 + n2 .
Hence:
a : b : c = 2m n : m2 − n2 : m2 + n2. (6)
It is easy to verify that if a, b, c satisfy these ratios
then they satisfy the Pythagorean relation, because
of the identity (2m n)2 + (m2 − n2)2 = (m2 + n2)2.
So: (2m n, m2 − n2, m2 + n2) is a PT for every pair
of coprime integers m, n with m > n.
Note that we only said ‘PT’, not ‘PPT’ — it could
happen that the triple is a PT but not a PPT. Here
are some examples of both kinds:
• (m, n) = (8, 3) yields the triple (48, 55, 73)
which is a PPT.
• (m, n) = (7, 3) yields the triple (42, 40, 58)
which is not a PPT as all its numbers are even.
But note that we can recover a PPT from it by
dividing all the numbers by their gcd which
happens to be 2; we get the PPT (21, 20, 29).
• (m, n) = (5, 3) yields the triple (30, 16, 34)
which is not a PPT but yields the PPT
(15, 8, 17) on division by 2.
So (m, n) = (8, 3) yields a PPT whereas
(m, n) = (7, 3) or (5, 3) do not. If you experiment
with various coprime pairs (m, n), and we urge
you to do so, you will find that you get a PPT
precisely when m and n have opposite parity (i.e.,
when one of them is odd, and the other one even;
this may be expressed compactly by writing:
m + n is odd). Please experiment on your own and
confirm this finding.
How do we prove this? The condition is clearly
needed; for, if m, n have the same parity (which
means in our context that they are both odd, as
they are supposed to be coprime and so cannot
both be even), then 2m n, m2 − n2 and m2 + n2 will
all be even numbers.
We now prove that if m and n are coprime and
have opposite parity, then 2m n, m2 − n2 and
m2 + n2 are coprime. For this, it is enough if we
Vol. 1, No. 2, December 2012 | At Right Angles 28
Page 3 of 4
show that m2 − n2 and m2 + n2 are coprime.
(Recall the remark made at the start to see why.)
Let k denote the gcd of m2 − n2 and m2 + n2. We
present the proof that k = 1 as follows.
• Since m and n are coprime, so too are m2 and n2.
• Since k divides both the numbers m2 − n2 and
m2 + n2, it divides their sum (which is 2m2) as
well as their difference (which is 2n2); so k
divides both 2m2 and 2n2.
• Since m and n have opposite parity, m2 and n2
have opposite parity. Hence m2 + n2 and
m2 − n2 are odd, and k, being their gcd, is odd.
• Since k divides 2m2 and 2n2, and k is odd, it
must be that k divides both m2 and n2.
• But m2 and n2 are coprime. Hence k = 1.
Thus m2 − n2 and m2 + n2 are coprime, as claimed,
and the PT is a PPT. We conclude: If m, n are
positive coprime integers of opposite parity, and
a = 2m n, b = m2 − n2, c = m2 + n2, (7)
then (a, b, c) is a PPT. Table 1 lists some PPTs
along with their (m, n) pairs.
A stronger claim
We can make a stronger statement: The above
scheme generates every possible PPT (a, b, c) in
which a is even and b, c are odd. Let us show why.
Let (a, b, c) be a PPT in which a is even, and b, c
are odd. Let the fraction t = a/(c − b) be written
in its simplest form as m/n (so m, n are coprime).
Working as shown above, we find that
a : b : c = 2m n : m2 − n2 : m2 + n2. We now show
that m, n have opposite parity. Suppose that m, n
are both odd (obviously, they cannot both be
even). Then 2m n and m2 + n2 are both of the form
2 × an odd number, whereas m2 − n2 is a multiple
of 4. Dividing through by 2 we find that it is b rather
than a which is an even number. However we had
supposed that a is even and not b. Hence it cannot
be that m, n are both odd. So they must have
opposite parity. But if m, n are coprime and have
opposite parity, then 2m n, m2 − n2 and m2 + n2
are coprime; we had shown this earlier. Now from
the equalities a : b : c = 2m n : m2 − n2 : m2 + n2
and the fact that a, b, c are coprime as well as
2m n, m2 − n2, m2 + n2, we can conclude that
(a, b, c) = (2m n, m2 − n2, m2 + n2), as required.
Example: Consider the PPT
(a, b, c) = (48, 55, 73). Here
t = a/(c − b) = 48/18 = 8/3; so we take m = 8
and n = 3. Now check that (m, n) = (8, 3)
generates the PPT (48, 55, 73).
A number theoretic approach
To round off this discussion we shall derive the
formula (7) in a completely different way, number
theoretic in flavour. The key principle we use is
the following proposition.
Proposition. If r and s are coprime positive
integers such that rs is a perfect square, then both r
and s are perfect squares.
For example, the product of the coprime numbers
4 and 9 is a perfect square, and each of these
numbers is a perfect square. We invite you to
prove the proposition.
Let (a, b, c) be a PPT in which a is even (and
therefore both b and c are odd). From the relation
a2 + b2 = c2 we get a2 = c2 − b2 = (c + b)(c − b).
We write this relation as follows:
a
2
2
= c + b
2 ·
c − b
2 . (8)
Since a, c + b and c − b are even numbers, the
quantities 1
2 a, 1
2 (c + b) and 1
2 (c − b) are integers.
We claim that 1
2 (c + b) and 1
2 (c − b) are coprime.
To see why, suppose that d is a common divisor of
1
2 (c + b) and 1
2 (c − b); then d must divide their
sum ( = c) as well their difference ( = b). Hence d
divides c as well as b. But we know that b and c are
coprime. Hence d = 1, and 1
2 (c + b) and 1
2 (c − b)
too are coprime.
From (8) we see that the product of the coprime
numbers 1
2 (c + b) and 1
2 (c − b) is a perfect square.
Hence each of them is a perfect square! Let
1
2 (c + b) = m2 and 1
2 (c − b) = n2. By addition and
subtraction we get c = m2 + n2 and b = m2 − n2.
From (8) we get a = 2m n. Hence there exist
coprime integers m and n such that
(a, b, c) = (2m n, m2 − n2, m2 + n2).
We illustrate this step with an example. Take the
PPT (a, b, c) = (48, 55, 73) in which a is even, and
b and c are odd, as required. For this PPT we have:
1
2 (c + b) = 1
2 (73 + 55) = 64 and
1
2 (c − b) = 1
2 (73 − 55) = 9. Observe that 1
2 (c + b)
29 At Right Angles | Vol. 1, No. 2, December 2012