Theorem. (1) Given any two positive integers m

Theorem.
(1) Given any two positive integers m < n that are coprime and not both odd, (n2 − m2 , 2nm, n2 + m2 )
is a primitive Pythagorean triple.
(2) Conversely, if (a, b, c) is a primitive Pythagorean triple, then either (a, b, c) itself or (b, a, c) can be
written in the form of (1) with coprime positive integers m < n that are not both odd.
Proof of (1). Let m < n be positive integers, coprime (i.e. no common integer divisor other than 1)
and not both odd (i.e. exactly one of them is even and the other one is odd: they can’t both be even
because if they were, they would have 2 as a common divisor, but this is not possible because we are
assuming they are coprime). There are two claims to be verified: (1.1) and (1.2).
(1.1) (n2 − m2 , 2nm, n2 + m2 ) is a Pythagorean triple. This is easy. Observe first of all that all three
numbers are integers (because m, n are, and sums and products of integers are again integers). Next
observe that they are all positive (thanks to our assumption that n > m). It remains to check that
(n2 − m2 )2 + (2nm)2 = (n2 + m2 )2 ,
which is very easy to do using the binomial theorem. Notice: at this point we have not yet used our
assumption that m, n are coprime and not both odd. This will happen only in the proof of (1.2).
(1.2) (n2 − m2 , 2nm, n2 + m2 ) is primitive (i.e. these numbers are coprime, i.e. their greatest common
integer divisor is 1). We will argue by contradiction. Suppose for a contradiction that there was some
integer d 6= 1 dividing n2 − m2 and 2nm and n2 + m2 . Every integer can be written as a product of
prime numbers1 , so in particular d is a product of prime numbers, so there is some prime number p
dividing d (I do not count 1 as a prime number, so p 6= 1). Thus, we have found a prime number p 6= 1
dividing n2 − m2 and 2nm and n2 + m2 (because p divides d and d divides all of these numbers).
Since p divides n2 − m2 and n2 + m2 , it must also divide their sum (n2 − m2 ) + (n2 + m2 ) = 2n2 as
well as their difference (n2 + m2 ) − (n2 − m2 ) = 2m2 . (This is because p dividing integers q, r means
there are other integers s, t such that q = ps and r = pt. But if so, then q + r = ps + pt = p(s + t)
and r − q = pt − ps = p(t − s), so p divides q + r and r − q because s + t and t − s are both integers.
Use this reasoning with q = n2 − m2 and r = n2 + m2 .)
(1.2.1) First case: p = 2. This is not actually possible because p divides n2 −m2 and 2nm and n2 +m2 ,
so if p = 2 then all of these numbers are even (for the middle one, 2nm, this is not a surprise because
2nm is even anyway), whereas on the other hand we are assuming that exactly one of m, n is odd and
the other one is even, which tells us that n2 − m2 and n2 + m2 are odd.2 This contradiction forces us
to conclude that p = 2 is impossible. Hence the second case (1.2.2) must occur.
(1.2.2) Second case: p 6= 2. We saw earlier that p divides 2m2 as well as 2n2 . Since p is a prime and
is not equal to 2, it follows that p divides m2 as well as n2 . From this it follows (again using the fact
that p is prime) that p divides m as well as n.3 But p 6= 1, so m, n do have a common integer divisor
1
This is a theorem that would need to be proved separately. It is one part of the so-called Fundamental Theorem of
Arithmetic. I will skip this (difficult) proof because the result is plausible and widely known.
2
Here I am again skipping a few steps, namely, the proof that ((q even) ⇒ (q 2 even)), that ((r odd) ⇒ (r2 odd)), and
that both the sum and the difference of an even and an odd number are odd. These are all comparatively easy.
3
To prove this rigorously, one needs to know the second part of the Fundamental Theorem of Arithmetic mentioned
in Footnote 1 above: namely, that there is only one way to factor a given integer into prime numbers, up to reordering
the factors. Some examples to illustrate what is going on here: If m = 3 and p = 6 (which is 6= 2 but is not a prime),
then p divides 2m2 = 18 but does not divide m2 = 9. Similarly, if m = 6 and p = 12 (also not a prime), then p divides
m2 = 36 but does not divide m = 6. On the other hand, the only prime numbers dividing m2 = 36 = 6 · 6 = 2 · 2 · 3 · 3
are 2 and 3, which are exactly the same prime numbers that divide m = 6 = 2 · 3.
other than 1 after all, namely, p. This contradicts our assumption that m, n are coprime, so we learn
that case (1.2.2) (i.e. p 6= 2) is not actually possible either.
Summarizing, we have deduced from our overall assumption (i.e. that (n2 − m2 , 2nm, n2 + m2 ) is not
a primitive triple) that there is some prime number p 6= 1 such that neither p = 2 nor p 6= 2, which
is absurd because one of these two possibilities must occur. Thus, our overall assumption was faulty,
and it follows that in reality (n2 − m2 , 2nm, n2 + m2 ) is primitive, as was to be proved in (1.2).
The proof of (1) is now complete.
Proof of (2). In this part, we suppose that (a, b, c) is a primitive Pythagorean triple, i.e. a, b, c are
positive integers that satisfy a2 + b2 = c2 and are coprime, meaning they have no common integer
divisor other than 1. Our goal is to write either (a, b, c) or (b, a, c) in the form of (1). This means we
need to find two suitable positive integers m < n (coprime and not both odd) and verify that either
(a, b, c) = (n2 − m2 , 2nm, n2 + m2 ) or (a, b, c) = (2nm, n2 − m2 , n2 + m2 ).
y
In order to find m and n, let us define x = ac , y = cb , and t = 1+x
. Since a, b, c are positive integers,
it follows that x, y are positive rational numbers. Moreover, t is a rational too (as sums/differences/
products/fractions of rationals are rational), and 0 < t < 1 because: a2 + b2 = c2 , hence x2 + y 2 = 1,
hence 0 < x, y < 1, hence 0 < y < 1 + x (now divide the last two inequalities by 1 + x). For future
reference, let us also note the two equations
x=
1 − t2
2t
, y=
.
1 + t2
1 + t2
(∗)
2
2
2t
t −1
These can be proved by substituting y = t(1 + x) into x2 + y 2 = 1, which yields x2 + 1+t
2 x + 1+t2 = 0
after rearranging, hence the expression for x by applying the quadratic formula (noting that the other
solution, −1, is not positive), and hence the expression for y by substituting x into y = t(1 + x).
Since t is a rational number and 0 < t < 1, it is possible to write t as a fraction t = µν , where µ, ν are
coprime positive integers with µ < ν.4 By substituting this into (∗),
a
ν 2 − µ2 b
2νµ
= 2
,
= 2
.
2
c
ν +µ
c
ν + µ2
(∗∗)
It is tempting to conclude from this that a = ν 2 − µ2 , b = 2νµ, and c = ν 2 + µ2 . However, things are
not so simple and this conclusion is not always justified. For example, 2νµ is always an even number,
while b need not be (consider the primitive Pythagorean triple (a, b, c) = (4, 3, 5)). Since (a, b, c) is
assumed to be primitive, all we are able to say without further work at this point is that there is some
common integer factor k (which may, but cannot always, be equal to 1)5 such that
ν 2 − µ2 = ka, 2νµ = kb, ν 2 + µ2 = kc.
(†)
(2.1) First case: Exactly one of µ, ν is odd. In this case, we can copy the discussion of (1.2) verbatim,
with m, n replaced by µ, ν respectively. This tells us that (ν 2 −µ2 , 2νµ, ν 2 +µ2 ) is a primitive triple, i.e.
its greatest common integer divisor k is actually equal to 1. By (†), (a, b, c) = (ν 2 − µ2 , 2νµ, ν 2 + µ2 ).
The fact that t can be written as t = µν with positive integers µ < ν is clear from the definition of t being a rational
number in (0, 1). The fact that we may take µ, ν to be coprime follows by first writing t as a fraction in some way, and
then reducing this fraction to lowest terms. However, the fact that any fraction can indeed be reduced to lowest terms,
while widely known, is not obvious: it follows from the Fundamental Theorem mentioned in Footnotes 1 and 3.
5
That such a factor k exists is once again very plausible by considering (∗∗) and thinking about reducing fractions to
lowest terms, but a rigorous proof of the existence of k depends on the Fundamental Theorem of Arithmetic.
4
As µ < ν are coprime positive integers and exactly one of them is odd by assumption, this concludes
the proof of (2) in this case (after renaming µ, ν as m, n, respectively).
(2.2) Second case: Both µ and ν are odd. In this case, it is very easy to see that ν 2 − µ2 and ν 2 + µ2
are even (compare Footnote 2), so the triple (ν 2 − µ2 , 2νµ, ν 2 + µ2 ) cannot possibly be primitive. In
particular, its greatest common integer divisor k is some integer multiple of 2.
2
2
2
2
ν +µ
As a first step, let us prove that k = 2. Thus we need to show that ( ν −µ
2 , νµ,
2 ) is a primitive
triple, i.e. its entries (which are integers rather than half-integers because µ, ν are odd) are coprime.
To this end we can mimic the arguments of (1.2) step by step. In fact it will turn out that some steps
that were necessary in (1.2) are no longer necessary here. As in (1.2), it suffices to show that there is
2
2
2
2
no prime number p dividing ν −µ
as well as νµ and ν +µ
. Assuming for a contradiction that p did
2
2
2
2
2
2
2
2
2
ν −µ
ν +µ2
exist, we conclude as in (1.2) that p also divides 2 + 2 = ν 2 and ν +µ
− ν −µ
= µ2 . Continuing
2
2
our argument as in (1.2.2) (but without having to assume p 6= 2 because here we already know that p
divides µ2 , ν 2 rather than 2µ2 , 2ν 2 ), we deduce that p divides µ and ν, which is a contradiction to µ
2
2
2
2
and ν being coprime. Thus, the triple ( ν −µ
, νµ, ν +µ
) is indeed primitive, and k = 2.
2
2
2
2
2
2
ν +µ
ν−µ
ν+µ
By (†) we now know that (a, b, c) = ( ν −µ
2 , νµ,
2 ). Continue by defining m = 2 and n = 2 .
Notice that these are positive integers (rather than half-integers) because µ, ν are both odd. It is clear
that m < n. Moreover, m, n are coprime because if they did have a common integer divisor d > 1, it
would follow that d also divides n + m = ν as well as n − m = µ, which is absurd because µ, ν were
supposed to be coprime. In particular, m, n cannot both be even. If both were odd, then ν = n + m
and µ = n − m would both be even, which is absurd for two reasons: because µ, ν are coprime, and
because µ, ν are odd by assumption. Thus, we conclude that exactly one of m, n is odd.
To finish the proof of (2) in this case, it suffices to check that (a, b, c) = (2nm, n2 − m2 , n2 + m2 ). But
this is an elementary computation:
ν 2 − µ2
ν +µν −µ
=2
= 2nm,
2
2
2
b = νµ = (n + m)(n − m) = n2 − m2 ,
a=
c=
ν 2 + µ2
(n + m)2 + (n − m)2
=
= n2 + m2 .
2
2
So (2) has been proved in case (2.2) as well.
Since µ, ν are coprime, they cannot be both even, so except for (2.1) and (2.2) there are no other cases
to consider. This means that (2) has been proved.
Numerical Examples.
m = 1, n = 2, (a, b, c) = (3, 4, 5) or (4, 3, 5)
m = 1, n = 4, (a, b, c) = (8, 15, 17) or (15, 8, 17)
m = 1, n = 6, (a, b, c) = (12, 35, 37) or (35, 12, 37)
m = 2, n = 3, (a, b, c) = (5, 12, 13) or (12, 5, 13)
m = 2, n = 5, (a, b, c) = (20, 21, 29) or (21, 20, 29)
m = 2, n = 7, (a, b, c) = (28, 45, 53) or (45, 28, 53)
m = 3, n = 4, (a, b, c) = (7, 24, 25) or (24, 7, 25)
m = 3, n = 8, (a, b, c) = (48, 55, 73) or (55, 48, 73)