Lecture 34: Pythagorean Triples

## Pythagorean Theorem

The the square of the length of the hypotenuse of a right triangle is equal to the sum of the square of the lengths of the other two sides. If c denotes the hyponuse & a and b denote the other two sides, then $a^{2}+b^{2}=c^{2}$

## Proof Source: Image from wikipedia.com

$(a+b)^{2}=4(\frac{1}{2}ab)+c^{2}$
$a^{2}+2ab+b^{2}=2ab+c^{2}$
$a^{2}+b^{2}=c^{2}$.

## Def’n

Let a,b,c be positive integers which satisfies the equation
$a^{2}+b^{2}=c^{2}$ then a - b - c is called a Pythagorean triple.

## List of Pythagorean triples

(3, 4, 5) (9, 12, 15)
( 5, 12, 13) ( 15, 36, 39)
( 7, 24, 25) ( 21, 72, 75)

The list on the left are primitive triples and the list on the right are imprimitive triples.

Primitive triple: A Pythagorean triple where a, b, and c are pairwise relative prime.

## Properties of Primitive triples

Let’s assume that a – b – c is a primitive Pythagorean triple.

## Prove that a and b cannot both be even or odd.

Assume a and b are even. We have that a = 2x, b = 2y. Then
$a^{2} + b^{2} = c^{2}$
$(2x)^{2} + (2y)^{2}= c^{2}$
$4x^{2} + 4y^{2} = c^{2}$
$(4x^{2} + 4y^{2})^{1/2} = (c^{2})^{1/2}$
$2(x^{2} + y^{2})^{1/2} = c$
=> 2 l c this means c even therefore a – b – c are not pairwise relative prime. Contradiction.

Assume a and b are odd. We have that a = 2x + 1, b = 2y + 1. Then
$a^{2}+b^{2}=c^{2}$
$(2x+1)^{2} + (2y+1)^{2} = c^{2}$
$4x^{2} + 4x + 1 + 4y^{2} +4y + 1 = c^{2}$
$4(x^{2} + x + y^{2} + y) + 2 = c^{2}$
$2(2(x^{2} + x + y^{2} + y) +1) = c^{2}$
$2*(2k + 1) = c^{2}$
=> 2 l $c^{2}$ => 2 l c by Euclid’s lemma. Then c = 2*q so then
$c^{2} = 4q^{2} = 2*2q^{2}$ but we have 2*(2k + 1) so we have a contradiction.

=> That a or b is even and the other odd.

## Proof that c is always odd.

Let a = (2x+1) and b = (2y). Then we have
$a^{2} + b^{2} = c^{2}$
$(2x+1)^{2} + (2y)^{2} = c^{2}$
$(2x+1)^{2} + (2y)^{2} = c^{2}$
$4x^{2} + 4x + 1 + 4y^{2} = c^{2}$
$4(x^{2} + x + y^{2}) + 1 = c^{2}$
$4k+1 = c^{2}$
=> c l 4K + 1, this is true if c is odd.

## Can a Pythagorean triple be all even or odd?

Case 1 (all odd)

Let a = 2x + 1, b = 2y + 1, c = 2z + 1. We have that:
$a^{2} + b^{2} = c^{2}$
$(2x+1)^{2} + (2y+1)^{2} = (2z+1)^{2}$
$4x^{2} + 4x + 1 + 4y^{2} +4y + 1 = 4z + 1$
$4x^{2} + 4x + 4y^{2} +4y + 4z + 2= 1$
$4(x^{2} + x + y^{2} +y + z) = -1$
$4k = -1$, but there is no positive integer k that satisfies the equation.

Case 2 (all even)

We know that the triple 3 – 4 – 5 is pair wise relative prime thus a primitive triple. If we multiply 3 – 4 – 5 by a positive integer d >= 1 then 3d – 4d – 5d is also a triple, which is called an imprimitive Pythagorean triple. So we have that $da^{2} + db^{2} = dc^{2}$ iff $a^{2} + b^{2} = c^{2}$. Hence da – db – dc is a Pythagorean triple iff a – b – c is a Pythagorean triple.

## Ex.

We have Pythagorean triple 3 – 4 – 5 then multiply by d=4. So we have:
$(3*4)^{2} + (4*4)^{2} = (5*4)^{2}$
$(12)^{2} + (16)^{2} = (20)^{2}$
144 + 256 = 400, which is true.
Hence (12, 16, 20) is a Pythagorean triple. So we can have an all even Pythagorean triple.

## Proof:

Let a = 2x, b = 2y, c = 2z. Then
$a^{2} + b^{2} = c^{2}$
$(2x)^{2} + (2y)^{2} = (2z)^{2}$
$4x^{2} + 4y^{2} = 4z^{2}$
$x^{2} + y^{2} = z^{2}$ this is true iff x – y – z is a triple.

## Conclusion:

We have infinitely many triples by multiplying a known triple by a constant
d >= 1.

## Theorem:

a,b,c is a primitive Pythagorean triple with b even <=> There exists $m,n \in \mathbb{Z}$ with m>n>0, (m,n)=1, and exactly one of m,n even s.t. $a=m^{2}-n^{2}, b=2mn, c=m^{2}+n^{2}$

## Example

m=2 and n=1

$a=2^{2}-1^{2}=3$
$b=2(2)(1)=4$
$c=2^{2}+1^{2}$

## Proof

### Left to right

Since a,b,c is a primitive Pythagorean triple, we know (a,b,c)=1. Furthermore, we know (a,b)=1, (a,c)=1, and (b,c)=1. (If you're still skeptical, assume there is a divisor d that divides two of the numbers but not the third.)

So,
$a^{2}+b^{2}=c^{2}$
$b^{2}=c^{2}-a^{2}=(c+a)(c-a)$

If we divide by 4 we get
$(\frac{b}{2})^{2}=(\frac{c+a}{2})(\frac{c-a}{2})$
Now note, $(\frac{c+a}{2},\frac{c-a}{2})=d$. The d divides both numbers and divides their sum and difference. Thus,
$d \mid \frac{c+a}{2}+\frac{c-a}{2} => d \mid c$
$d \mid \frac{c+a}{2}-\frac{c-a}{2} => d \mid a$
Since we established (a,c)=1, d=1.

Also note, this means $\frac{c+a}{2}$ and $\frac{c-a}{2}$ are perfect squares. (Again, skeptics can consider how prime factors of $(\frac{b}{2})^{2}$ are grouped into these two numbers.)

Let $m,n \in \mathbb{Z}$ be s.t.
$\frac{c+a}{2}=m^{2}$ and $\frac{c-a}{2}=n^{2}$

We see right away that m>n>0 and (m,n)=1. Also, we see that $m^{2}-n^{2}=a, 2mn=b,$ and $m^{2}+n^{2}=c$. Since m,n are relatively prime, m and n are not both even. They also can't both be odd because then a and c become even, which contradicts (a,c)=1.

### Right to left:

Show that any such $m,n \in \mathbb{Z}$ that satisfy our three conditions generates a Pythagorean triple that is primitive. First, we see if it satisfies the Pythagorean Theorem.

Left side: $a^{2}+b^{2}=(m^{2}-n^{2})^{2}+(2mn)^{2}=m^{4}+2m^{2}n^{2}+n^{4}$
Right side: $c^{2}=(m^{2}+n^{2})^{2}=m^{4}+2m^{2}n^{2}+n^{4}$

Now to show that it is primitive.
Let's find d=(a,b,c). Since exactly one of m,n is even, this tells us a and c are both odd. Thus, d i odd, which gives us two choices. Either d=1 or d is divisible by some odd primpe p. Let's assume the latter. The p|a and p|c, so p divides their sum and difference. Plugging in for a and c in terms of m and n, we get

$p \mid (m^{2}+n^{2})+(m^{2}-n^{2})$ and $p \mid (m^{2}+n^{2})-(m^{2}-n^{2})$
=> $p \mid 2m^{2}$ and $p \mid 2n^{2}$
=> $p \mid m^{2}$ and $p \mid n^{2}$ (since p is odd)
=> $p \mid m$ and $p \mid n$ (By Euclid's Lemma)
This is a contradiction of our assumption that (m,n)=1. Thus, d=1 and a,b,c is a primitive Pythagorean triple.

## Finding sibling triples

We will define sibling triples and then use the following three definitions/theorems/identities to find them. First, primitive Pythagorean triples are called sibling triples if they have the same hypotenuse number.

## Hypotenuse constraints

For a given hypotenuse number c, we know that c must be congruent to 1 modulo 4. Also, every prime divisor of c must be congruent to 1 modulo 4.

## Fermat's Theorem on sums of two squares

An odd prime p is expressible as $p=x^{2}+y^{2}$ with $x,y \in \bbmath{Z}$ if and only if $p\equiv 1 \mod 4$

There is a proof of this on page 170 in the textbook.

## Brahmagupta-Fibonacci identity

The product of two sums of two squares is itself a sum of two squares.

For $a,b,c,d \in \bbmath{Z},$
$(a^{2}+b^{2})(c^{2}+d^{2})=(ac-bd)^{2}+(ad+bc)^{2}=(ac+bd)^{2}+(ad-bc)^{2}$

The proof for this is fairly simple and requires just algebra and adding a 0 disguised as (2abcd-2abcd).

## Example

So, we want to find sibling triples for c=65=(5)(13). 65 is a valid hypotenuse because 5 and 13 are both congruent to 1 modulo 4. Now, we find the Gaussian integer representation of 5 and 13.

$5=1^{2}+2^{2}=(1+2i)(1-2i)$
$13=2^{2}+3^{2}=(2+3i)(2-3i)$

Now we must consider the Gaussian "halves" that, when multiplied together, will give us our primes. In order to do this, consider all possible halves that can be generated by picking one factor from each prime to multiple together.

In our case here, we get
$(1+2i)(2+3i)=-4+7i$
$(1+2i)(2-3i)=8+i$

The other combinations of factors from the primes will just yield conjugates to "halves" we already have. Now we know that,
$65=4^{2}+7^{2}=8^{2}+1^{2}$

Using the Brahmagupta-Fibonacci identity, we can generate the sums of squares for $65^{2}$.

$(4^{2}+7^{2})(4^{2}+7^{2})=(4*4-7*7)^{2}+(4*7+4*7)^{2}=33^{2}+56^{2}$
$(8^{2}+1^{2})(8^{2}+1^{2})=(8*8-1*1)^{2}+(8*1+8*1)^{2}=63^{2}+16^{2}$

In fact, if there are k-distinct prime divisors of a hypotenuse c, then there are $2^{k-1}$ sibling triples for that hypotenuse.

page revision: 14, last edited: 02 Dec 2008 20:09