Primitive Pythagorean Triples, or PPT’s, are non-trivial integer solutions to the Pythagorean equation z^{2} = x^{2} + y^{2}, where we assume that 0<x<y<z and that x, y and z are co-prime.

Euclid’s formulae allow PPT’s to be generated using 2 (positive integer) parameters, usually denoted by m and n. The PPT’s (usually) take the form ( m^{2}– n^{2}, 2mn, m^{2}+n^{2}) or ( 2mn, m^{2}-n^{2}, m^{2}+n^{2}), where m>n≥1, m and n are co-prime, and m-n is odd. Clearly, m^{2}+n^{2 }is the largest number in each triple.

**Note:** It is easier to spot patterns in generated triples if these are **ordered** as in (x, y, z) where x<y<z.

There are 2 cases that can occur, i.e. ( m^{2}– n^{2}, 2mn, m^{2}+n^{2}) where m^{2}-n^{2}< 2mn and

( 2mn, m^{2}-n^{2}, m^{2}+n^{2}) where 2mn < m^{2}-n^{2}. If m^{2}-n^{2}< 2mn then it is easy to show that

n < m < (1+√2)n. Hence if we wished to write a program to generate such triples we would first have to choose n from 1,2,3, … and then choose m from (n+1), …, int((1+√2)n).

Any proofs that I have seen that establish the above formulae for x, y and z make use of parity, factorisability and co-primeness, but interestingly **do not make use of geometry**.

**It cannot be assumed of course that x, y, and z form the sides of a triangle. That has to be proved.**

However the consequences of proving that x, y, and z form the sides of a triangle lead to a simple method of generating PPT’s which is also simply proved.

**New Method**

**Returning **to the equation z^{2}= x^{2}+ y^{2}, it is easy to show that z<x+y, since x^{2}+ y^{2 }< (x+y)^{2 }and so, since 0<x<y<z, x, y, and z do form the sides of a triangle. It follows, from z<x+y and x<y, that z<2y. Hence y<z<2y, and so there is an integer **a**, where 0<**a**<y, such that z=y+**a**. Also, since 0<x<y, there is an integer **b**, where 0<**b**<y, such that x=y-**b**.

So, z^{2}= x^{2}+ y^{2 }becomes (y+a)^{2} = (y-b)^{2}+ y^{2}, where 0<a<y and 0<b<y.

After multiplying out and re-arranging (y+a)^{2} = (y-b)^{2}+ y^{2 }we get, 2a(a+b) = (y – (a+b))^{2}.

Hence 2|(y-(a+b)) and so y-(a+b) = 2c, where **c** is an integer and it is easy to show that c>0.

**Note:** [2c = y – (a+b) = y – (z-y + y-x) = y + x – z > 0]

So, x = a+2c, y = a + b + 2c = (x+b) and z = 2a + b + 2c = (y+a), where a(a+b)= 2c^{2}.

**Note:** it is easy to show that a<√2 c.

To generate PPT’s, first choose any integral c, **c≥1**; then choose integral **a** in the range **1≤a<√2c **so that a|2c^{2}; then finally choose integral **b** , b≥1, using a(a+b)= 2c^{2}, or b=(2c²)/a – a, making sure that the resulting x, y and z have no common factors.

For example:

If c=1 then a=1 and b = 1. Hence we get the PPT (3,4,5).

If c=2 then a=1 and b=7, and this gives the PPT (5,12,13)

If c=3 then a=1 and b=17 **or** a=2 and b=7, giving PPT’s (7,24,25) and (8,15,17).

If c=4 then a=1 and b=31 giving PPT (9,40,41).

If c=5 then a=1 and b=49 **or** a=2 and b= 23 giving PPT’s ( 11, 60, 61) and ( 12, 35, 37).

If c=6 then a = 1 and b = 71 and we get the PPT (13,84,85).

Etc.

The following is a short Python program to generate PPT’s using this method.

import math #Generating primitive Pythagorean Triples # def hcf(x,y): #assume y!=x while y!=x: if y>x: y=y-x else: x=x-y #endif #endwhile return x #enddef # def generate_triples(): for c in range(1,60): for a in range(1,int(math.sqrt(2)*c)+1): if int(2*c*c/a)==2*c*c/a: b=int(2*c*c/a)-a x=a+2*c y=a+b+2*c z=2*a+b+2*c if hcf(x,y)==1: print ("c = ",c) print ("x = ",x) print ("y = ",y) print ("z = ",z) print () #endif #endif #endfor #endfor #enddef # generate_triples()

**all**of the information from the equation z

^{2}= x

^{2}+ y

^{2}, together with the inequalities, and not just some of it. Also, the need to look at parity is removed and co-primeness only comes into play when choosing the values of

**a**and

**b**. The method is clearly exhaustive since

**c**can range over all positive integers.It is rather mind-blowing to think that the simple triangle property of x, y and z has lain in plain view since 300 BC? and yet no-one has noticed, or used it, until now.

^{3}= x

^{3}+ y

^{3}we assume that a non-trivial solution exists and then try to arrive at a contradiction. So we can assume that there are x, y, z (positive integers) satisfying the equation where 0<x<y<z and gcd(x,y,z)=1. Clearly then z<x+y and so x, y and z form the sides of a triangle (actually an acute angled triangle). However, since x<y<z it follows that y<z<2y and so there is an integer

**a**such that 0<a<y where z = y + a. Also since 0<x<y there is an integer

**b**such that 0<b<y where x = y – b. Substituting into the Fermat equation we get (y+a)

^{3}= (y-b)

^{3}+ y

^{3}.

**It is easily shown that a≠b.**

**a=b**, and so (y+a)

^{3}= (y-a)

^{3}+ y

^{3}and therefore (y+a)

^{3}– (y-a)

^{3}= y

^{3}. Hence 2a((y+a)

^{2}+ (y+a)(y-a) + (y-a)

^{2}) = y

^{3}. It follows from this that 2|y, and so y=2y

_{1}. Substituting for y, and dividing the result by 2, we get … a((2y

_{1}+a)

^{2}+ (2y

_{1}+a)(2y

_{1}-a) + (2y

_{1}-a)

^{2}) = 4y

_{1}

^{3}

_{.}If 2|a then that contradicts gcd(x,y,z)=1, so 2|(2y

_{1}+a)

^{2}+ (2y

_{1}+a)(2y

_{1}-a) + (2y

_{1}-a)

^{2 }but, if that is true, then 2|a

^{2}and so either way we have a contradiction. Hence

**a≠b**.

^{3}= (y-b)

^{3}+ y

^{3 }it follows that y+a ≡ y-b + y mod 2 or 2| y-a-b. It is easily shown then that y = a+b+2c, where c>0.

^{3 }= (y-b)

^{3}+ y

^{3 }it follows that y+a ≡ y-b + y mod 3 or 3| y-a-b. So 3|2c and therefore 3|c. Hence c = 3d where d is an integer>0.

**(2a+b+6d)**…………………..*

^{3}= (a+6d)^{3}+ (a+b+6d)^{3}**3a(a+b)(2a+b+12d) = (6d)³**………………..**

**Some estimates involving a, b and d.**

**a<3d**.

Hence **3d<2a+b**.

These estimates can be refined a little. For example, if m is the positive root of the equation 36 = m³ + 6m² then a<md<a+b/2.

Suppose that md≤a, then from ** we have 3a(a+b)(2a+b)+36a²d<(6d)³ and so

3a(a+b)(2a+b)<36d(6d² – a²). Now md≤a implies that d≤a/m and so,

3a(a+b)(2a+b)<36d(6(a/m)² – a²) = 36a²d(6/m² – 1) = 6a²dm ≤ 6a³.

So, 3a(a+b)(2a+b) < 6a³ and therefore 3ab(3a+b)<0 and so 3a+b<0 which is not possible.

Hence** a<md**.

**md<a +b/2**.

**Note:**It is easy to show that

**6d≠b**, otherwise if 6d=b, * becomes 7(a+b)³ = (a+2b)³ implying that ³√7 is rational which is obviously not true. It is also easy to show that

**6d≠a.**

**Hence, if it can be shown that ³√((λ+2)³ – (λ+1)³ ) is irrational for all λ≠0, λ∈Q, we have a contradiction.**

**Lemma 1**

^{p-1}+ xy

^{p-2}+ … + x

^{p-2}y + x

^{p-1}. Assume that p|y-x.

**Proof**

^{p-1}+ (x-y)y

^{p-2}+ y

^{p-1 }… + (x

^{p-2}– y

^{p-2})y + y

^{p-1}+ x

^{p-1}

^{p-1}+(x-y)y

^{p-2}+ (x

^{2}-y

^{2})y

^{p-3}+… + (x

^{p-2}– y

^{p-2})y + x

^{p-1}

^{p-1}≡ 1 mod p as is y

^{p-1}≡ 1 mod p, since neither x nor y is divisible by p.

**Lemma 2**

^{p-1}+ xy

^{p-2}+ … + x

^{p-2}y + x

^{p-1}. If q|∑ then it must follow that q|y as the following proof shows.

**Proof**

^{p-1}+ xy

^{p-2}+ … + x

^{p-2}y + x

^{p-1}+ x

^{p-2}y -x

^{p-1 }or,

^{p-1}+ xy

^{p-2}+ … + 2x

^{p-2}y. Similarly, q|y

^{p-1}+ xy

^{p-2}+ … + 3x

^{p-3}y

^{2 }. Continuing that theme we arrive at q|py

^{p-1}and since q can’t divide p it follows that q|y.

^{n}= x

^{n}+ y

^{n}, where n is an odd prime ≥5, we assume again that a non-trivial solution exists and then try to arrive at a contradiction. So we can assume that there are x, y, z (positive integers) satisfying the equation and where 0<x<y<z and gcd(x,y,z)=1.

**a**such that 0<a<y where z = y + a. Also since 0<x<y there is an integer

**b**such that 0<b<y where x = y – b. Substituting into the Fermat equation we get (y+a)

^{n}= (y-b)

^{n}+ y

^{n}. It follows easily using an argument applied in the case n=3 that a≠b.

^{n}= (y-b)

^{n}+ y

^{n }it follows that y+a ≡ y-b + y mod 2 or 2| y-a-b. Hence y=a+b+2c where c>0. Since n is odd and ≥ 5, n=2k+1 where k≥2.

^{n}– x = x(x

^{n-1}– 1) = x(x

^{2k}– 1) = x(x

^{2}– 1)(x

^{2k-2}+ … + ) and so the presence of the factor(s) x(x

^{2}– 1) means that 3|x

^{n}-x. So, using arithmetic modulo 3 on (y+a)

^{n}= (y-b)

^{n}+ y

^{n }it follows that y+a ≡ y-b + y mod 3 or 3| y-a-b in which case 3|2c and so there is an integer d>0 such that d=3c. It now follows that y = a + b + 6d.

^{n}= (a+6ne)

^{n}+ (a+b+6ne)

^{n}where n is prime ≥ 5 and a, b and e are integers ≥ 1.We now rearrange this equation as (2a+b+6ne)

^{n}– (a+6ne)

^{n }= (a+b+6ne)

^{n }and then factorise the left-hand side as …(a+b)((2a+b+6ne)

^{n-1}+ (a+6ne)(2a+b+6ne)

^{n-2}+ … + (a+6ne)

^{n-1}) = (a+b+6ne)

^{n}. Again if we expand the RHS as a binomial in a+b and 6ne, it must follow that a+b|(6ne)

^{n}. A similar argument shows that a|(6ne)

^{n}.Now a+b ≥ 3, since a≠b, and so a+b must have a prime factor. Let q be any prime factor of a+b other than 2, 3 or n.It is clear then that q|e. If q|(2a+b+6ne)

^{n-1}+ (a+6ne)(2a+b+6ne)

^{n-2}+ … + (a+6ne)

^{n-1}then by Lemma 2, q|2a+b+6ne and so q|a. It follows then that q|b and so q is a common factor of x, y and z, which contradicts gcd(x,y,z)=1.Hence if a+b has a prime factor a+b can only be divided by 2, 3 or n.

## Leave a Reply