# Pairwise prime triples of integers satisfying $x^2+y^2=z^2$

The following property has been stated without proof in a problem solving book (not as a problem, hence no solution). I also looked at the number theory text I have, and I cannot find it.

All pairwise prime triples of integers satisfying $x^2+y^2=z^2$ are given by $$x=|u^2-v^2|\;,\;y=2uv\;,\; z=u^2+v^2\;,\;\text{gcd}(u,v)=1\;,\; u\neq v \;\text{mod} \;2$$

Particularly, why $u,v$ should be coprime and $u\neq v\; \bmod \;2$ as otherwise this is trivial algebra. A reference or an intuitive explanation of this result would be appreciated.

-
Just wondering, is "relatively prime" a more common term or "pairwise prime"? had never seen "pairwise prime" before, but it is clear that what it means. Tx – Arjang Jun 28 '11 at 23:46
Google "Pythagorean triple" an you'll find many proofs. – Bill Dubuque Jun 28 '11 at 23:48
@Bill the only proofs I see in the wikipedia page is under the section "relation to gaussian integers" and "wiles' proof of fermat's last theorem". Could you point me to the relevant section. – kuch nahi Jun 28 '11 at 23:53
$\gcd(u, v) = 1$ is clearly a necessary condition. Are you asking why it is sufficient together with $u \neq v \bmod 2$? This is not too difficult an exercise; start thinking about $\gcd(x, y)$. – Qiaochu Yuan Jun 28 '11 at 23:58
For lots of information about Pythagorean Triples consult this web page: maths.surrey.ac.uk/hosted-sites/R.Knott/Pythag/pythag.html – Joseph Malkevitch Jun 28 '11 at 23:59

The reason for the $u$ and $v$ coprime and opposite parity is that you have the expression for primitive Pythagorean triples, i.e. those where $x$, $y$ and $z$ have no common factor apart from $1$. If $u$ and $v$ have a common factor $k$ then $x$, $y$ and $z$ have a common factor $k^2$, while if $u$ and $v$ are both odd then $x$, $y$ and $z$ have a common factor $2$.
To extend these to capture all Pythagorean triples, merely multiply the expressions for $x$, $y$ and $z$ terms by an arbitrary positive integer.