## 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.

PeteHH 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 Anonymous said...