Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|cite|improve this question
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: – Joseph Malkevitch Jun 28 '11 at 23:59
up vote 7 down vote accepted

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.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.