# Calculating Pythagorean triples

If $x$ and $y$ are even, then of course $z$ is too, and $\left(\frac{x}{2}, \frac{y}{2}, \frac{z}{2} \right)$ is also a Pythagorean triple. For this question we assume that $(x, y, z)$ is a Pythagorean triple in which $x$ is odd, so that $y$ is even and $z$ is odd. For similar reasons, we assume that $p$ and $q$ are coprime. The theory of Pythagorean triples then tells us that there are nonzero integers $p$ and $q$ such that

$$x + iy = (p + iq)^2 \hspace{1.5cm} z = |p + iq|^2 = p^2 + q^2.$$

If $x$ is odd then one of $p$ and $q$ must be even and the other is odd. Otherwise all possibilities occur. Write down the Pythagorean triples for such $p$ and $q$, where $1 \leq q < p \leq 8.$

I'm not really sure how to calculate these triples. I first decided to start by picking say $q = 1, p = 2$, which then I then get $z = 1^2 + 2^2 = 5$. How would I then use this to calculate $x$ and $y$?

$(p+iq)^2=(2+i)^2=2^2+2\cdot 2i+i^2=4+4i-1=3+4i$, so $x=3$, $y=4$.
• OHHHHH!!!! Ok! And then I try this for all $p,q$ in that interval? Does this always work? – Kaish Apr 13 '13 at 19:41