Pythagorean triple

Definition

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

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

Properties

All primitive Pythagorean triples are given by:

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

where ${\displaystyle m}$ and ${\displaystyle n}$ are relatively-prime positive integers, and ${\displaystyle 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 ${\displaystyle m}$ and ${\displaystyle n}$.