18 February 2008

A thing I didn't know about Pythagorean triples

For my class, I needed some examples of Gaussian integers (i. e. numbers of the form a + bi where a, b are both integers) which have Gaussian integers as square roots. Of course, the easiest way to generate such examples is to start squaring Gaussian integers, which gives, for example,

(2+i)2 = 3 + 4i
(3+2i)2 = 5 + 12i
(7+4i)2 = 33 + 56i

etc. -- and you may notice that (3, 4), (5, 12), and (33, 56) are the legs of right triangles with hypotenuses 5, 13, and 65 respectively. In other words, (3, 4, 5), (5, 12, 13), and (33, 56, 65) are Pythagorean triples. (Okay, so you probably don't recognize (33, 56) as such a pair. But it is.)

Now, I've long known that Pythagorean triples -- that is, triples of integers (a, b, c) such that a2 + b2 = c2 -- can be written in the form (r2 - s2, 2rs, r2 + s2), and all primitive Pythaogrean triples can be written in this form for suitable integer choices of r and s. (r and s have to be relatively prime and not both odd.) When I first saw this -- I don't remember when, it may have been in a number theory course -- it seemed kind of strange. Sure, it's easy to check that any r and s give rise to a Pythagorean triple in this way, but where does it come from? But notice that

(r+si)2 = (r2 - s2) + 2rsi

and the absolute value of the right-hand side is

((r2-s2)2 + (2rs)2)1/2 = r2 + s2.

So Pythagorean triples fall naturally out of the arithmetic of the Gaussian integers... which I didn't know.

2 comments:

PhilG said...

You can also generalise to show that if you multiply numbers which are the sum of two squares you get a number which is the sum of two squares in two different ways.

a = x.x + y.y
b = s.s + t.t

z = x + iy => a = zz*
u = s + it => b = uu*

c = ab = z(z*)u(u*) = (zu)(zu)* = p.p + q.q

with p = Re(zu) = xs - yt
q = Im(zu) = xt + sy

but also

c = ab = z(z*)u(u*) = (zu*)(zu*)* = p'.p' + q'.q'

with p' = Re(zu*) = xs - yt
q' = Im(zu*) = xt + sy

and you can do similar tricks with quarternions and octonions. A lot of number theory is based on further generalisations of these formulae to other rings

dzaia-bs said...

what about these?

for (3,4,5)=> 3^2 = 9 = 4 + 5
(5,12,13)=> 5^2 = 25 = 12 + 13
(7,24,25)=> 7^2 = 49 = 24 + 25
...
(a,b,c)=> a^2 = b + c
a = odd numbers
b = (((a^2)-1)/2)
c = (((a^2)+1)/2)