Pythagorean triple

Definition
A Pythagorean triple is a solution $$(x,y,z)$$ of the equation $$x^2+y^2=z^2$$, in which $$x$$, $$y$$ and $$z$$ are positive integers.

A Pythagorean triple is called primitive, if $$\gcd(x,y,z)=1$$.

Properties
All primitive Pythagorean triples are given by:

$$x=2mn, \quad y=m^2-n^2, \quad z=m^2+n^2$$

where $$m$$ and $$n$$ are relatively-prime positive integers, and $$m > n$$.

Every non-primitive Pythagorean triple a positive integer multiple of a primitive triple. These may also be generated by including relatively-prime integers for $$m$$ and $$n$$.

External references

 * MathWorld's article
 * Cut-the-knot's article