As has been mentioned already, a Pythagorean triple is a

triple *(a,b,c)* of positive

integers
with

*c*^{2}=a^{2}+b^{2}.
Such a triple corresponds to a
a right angled

triangle with sides of length

*a,b* and

*c* (with

*c* the

hypotenuse) by

Pythagoras's Theorem.

If *(a,b,c)* is such a triple then so is *(na,nb,nc)*
for any positive integer *n*. So we define a Pythagorean
triple to be primitive if *a,b* and *c* have no common
factor. Obviously if we want to compute all Pythagorean triples we
just have to consider the primitive ones.

The Alexandrian Diophantus considered the problem of determining
all such triples some time around 250 AD. Here's the result.

**Theorem** Let *x,y* be coprime positive integers
such that *x-y* is odd. Then *(x*^{2}-y^{2},2xy,x^{2}+y^{2})
is a primitive Pythagorean triple and all such triples arise this way.

See also the proof of Diophantus' theorem on Pythagorean triples.