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$?