4. The positive integers $x, y, z$ satisfy

$$
x+2 y=z, \quad x^{2}-4 y^{2}+z^{2}=310 .
$$

Find all possible values of the product $xyz$.
Solution 1. We can solve for $2y$ from the first equation and substitute it into the second, which must satisfy

$$
310=x^{2}-(z-x)^{2}+z^{2}=2 z x, \quad z x=155=5 \cdot 31
$$

Since 5 and 31 are prime, $z$ must take one of the values $155, 31, 5, 1$, with $x$ taking the respective values $1, 5, 31, 155$. Since $z=x+2y>x$, the last two cases are eliminated. In the first two cases, $y=\frac{z-x}{2}$ takes the values 77 and 13, respectively, resulting in

$$
x y z=1 \cdot 77 \cdot 155=11935, \quad x y z=5 \cdot 13 \cdot 31=2015 .
$$