-Up to-Home/Maths
-Site Map|-Text version

- Primitive Pythagorean Triples

  Fred Curtis - October 2000
These notes are just a defence against my capacity to lose back-of-envelope derivations. As far as I'm aware all the results are well-known, although I hadn't previously seen General Representation (i).

[Synopsis] [Working] [Source code] [Chronology] [References] [Further Reading]


Synopsis

A Pythagorean Triple is a triple of positive integers a,b,c such that a2+b2=c2. The numbers can represent the sides of right-angle triangle - call a,b and c the sides of the triple, a and b the legs, c the hypotenuse. Example: a=6,b=8,c=10.

A Primitive Pythagorean Triple is a Pythagorean triple a,b,c with the constraint that gcd(a,b)=1, which implies gcd(a,c)=1 and gcd(b,c)=1. Example: a=3,b=4,c=5.

Some properties of primitive Pythagorean triples: Let a denote the odd leg, b denote the even leg, c denote the odd hypotenuse of a primitive Pythagorean triple. Then:

Some properties of (not necessarily primitive) Pythagorean triples: These properties follow directly from the properties of primitive triples by considering an arbitrary triple as a (possibly unit) multiple of a primitive triple.

Working

Let a,b,c be a primitive Pythagorean triple, a denote the odd leg, b denote the even leg, c denote the odd hypotenuse.

Write c=b+ð for some ð>0

a2+b2=(b+ð)2
=b2+2bð+ð2
a2=2bð+ð2
ð(2b+ð)

If p is prime and p | ð then p | a2 and p | a. p¬|(2b+ð) since p | (2b+ð) implies p | 2b implies p | b (since p | a, p ¬= 2) and gcd(a,b)>1.

Since a2=ð(2b+ð) and gcd(ð,2b+ð)=1, we can write ð=i2, 2b+ð=j2 for some odd i,j with i<j, gcd(i,j)=1. Substituting, we have:

a=ij
2b=j2
2b=j2-i2
b=(j2-i2)/2
c=b
=(j2-i2)/2+i2
=(j2+i2)/2
--General Representation (i) - a=ij, b=(j2-i2)/2, c=(j2+i2)/2
where gcd(i,j)=1, i<j

Observe that 4 | b since i2=j2=1(mod 8), 2b=j2-i2=0(mod 8), so b=0(mod 8) or b=4(mod 8), i.e. b=0(mod 4)

Observe that c is the product of primes of the form 4k+1, since if n = a2 + b2, prime p = 3 (mod 4), p | n then p | a and p | b, i.e. gcd(a,b> p

This analysis agrees with a statement in [Beiler] page 115 that an odd number s factored as s=p1k1p2k2...pnkn can occur as the odd leg of a primitive Pythagorean triple in Lp(s)=2n-1 ways, since that is the number of ways s can be partitioned into two relatively prime factors (the way a is partitioned into i and j in the formulation above - each partitioning of a leads to a distinct value of b). Lp(s)=2n-1 is also true for the number of ways an even number s=0(mod 4) can occur as the even leg of a primitive Pythagorean triple - the proof of this statement follows from a decomposition of the even leg similar to that above (recall a, b, c form a primitive Pythagorean triple, a the odd leg, b the even leg, write c=a+2µ):

a2+b2=(a+2µ)2
=a2+4aµ+4µ2
b2=4aµ+4µ2
4µ(a+µ)

If p is prime and p | µ then p | b2 and p | b. p¬|(a+µ) since p | (a+µ) implies p | a and gcd(a,b)>1.

Since b2=4µ(a+µ) and gcd(µ,a+µ)=1, we can write µ=u2, a+µ=v2 for some u,v with u<v, gcd(u,v)=1. Substituting, we have:

b=2uv
a=v2
a=v2-u2
c=a+2µ
=v2-u2+2u2
=v2+u2
--General Representation (ii) - a=v2-u2, b=2uv, c=v2+u2
where gcd(u,v)=1, u<v

[Mathworld] cites this general representation as "known to the early Greeks". 4 | b, b=2uv, 2 | uv, therefore uv has the same number of distinct prime factors as b. The number of ways b can appear as the even leg of a primitive Pythagorean triple is the number of ways relatively prime factors u,v of b=2uv can be chosen, i.e. Lp(b)=2n-1 where b is factored as p1k1p2k2...pnkn.

At most one of a,b is a square. Suppose both a and b are squares, say a=r2 and b=s2. The equation a2+b2=c2 becomes r4+s4=c2, and Fermat showed no square can be written as the sum of fourth powers - see [Brown] for a proof.

Table 1 shows that exactly one of a,b is divisible by 3.

Table 1 - Values of a,b,c modulo 3
Summary: Possible
values of a,b,c modulo 3
a
(mod 3)
b
(mod 3)
c
(mod 3)
0±12
±101
 
The values in the table on the right were
obtained by considering possible values
of i,j in General Representation (i)
 
i
(mod 3)
j
(mod 3)
a=ij
(mod 3)
2b=j2-i2
(mod 3)
2c=j2+i2
(mod 3)
00

Invalid, gcd(i,j)=1

0101 (b=2)1 (c=2)
0201 (b=2)1 (c=2)
1002 (b=1)1 (c=2)
1110 (b=0)2 (c=1)
1220 (b=0)2 (c=1)
2002 (b=1)1 (c=2)
2120 (b=0)2 (c=1)
2210 (b=0)2 (c=1)

Table 2 shows that exactly one of a,b,c is divisible by 5.

Table 2 - Values of a,b,c modulo 5
Summary: Possible
values of a,b,c modulo 5
a
(mod 5)
b
(mod 5)
c
(mod 5)
0±2±2
±10±1
±2±10
 

The values in the table on the right were
obtained by considering possible values
of i,j in General Representation (i)

 
i
(mod 5)
j
(mod 5)
a=ij
(mod 5)
2b=j2-i2
(mod 5)
2c=j2+i2
(mod 5)
00

Invalid, gcd(i,j)=1

0101 (b=3)1 (c=3)
0204 (b=2)4 (c=2)
0304 (b=2)4 (c=2)
0401 (b=3)1 (c=3)
1004 (b=2)1 (c=3)
1110 (b=0)2 (c=1)
1223 (b=4)0 (c=0)
1333 (b=4)0 (c=0)
1440 (b=0)2 (c=1)
2001 (b=3)4 (c=2)
2122 (b=1)0 (c=0)
2240 (b=0)3 (c=4)
2310 (b=0)3 (c=4)
2432 (b=1)0 (c=0)
3001 (b=3)4 (c=2)
3132 (b=1)0 (c=0)
3210 (b=0)3 (c=4)
3340 (b=0)3 (c=4)
3422 (b=1)0 (c=0)
4004 (b=2)1 (c=3)
4140 (b=0)2 (c=1)
4233 (b=4)0 (c=0)
4323 (b=4)0 (c=0)
4410 (b=0)2 (c=1)

Table 3 shows that exactly one of a,b,(a+b),(a-b) is divisible by 7

Table 3: Possible
values of a,b,c modulo 7
a
(mod 7)
b
(mod 7)
c
(mod 7)
0±11
0±22
0±34
±101
±1±13
±202
±2±26
±304
±3±35
Table 4: Possible
values of a,b,c modulo 11
a
(mod 11)
b
(mod 11)
c
(mod 11)
0±110
0±22
0±38
0±47
0±56
±101
±1±27
±1±59
±209
±2±14
±2±48
±303
±3±45
±3±510
±404
±4±23
±4±36
±505
±5±12
±5±31
Table 5: Possible
values of a,b,c modulo 13
a
(mod 13)
b
(mod 13)
c
(mod 13)
0±2±2
0±5±5
0±6±6
±10±1
±1±3±6
±2±30
±2±5±4
±30±3
±3±4±5
±40±4
±4±1±2
±5±10
±5±6±3
±6±2±1
±6±40

Source code

The tables of values of a,b,c in larger prime modulii were created with a perl script pptmod-pl.

Chronology

References

Further Reading


-This page
last changed:
20 Feb 2004
[Validate HTML]
-Donate free
food & land
 
-
|Feedback by email
or Web form