As has been mentioned already, a Pythagorean triple is a triple (a,b,c) of positive integers with c2=a2+b2. 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 (x2-y2,2xy,x2+y2) is a primitive Pythagorean triple and all such triples arise this way.

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