Let $p$ denote a (positive) prime number. Determine all triples of integers $(x, y, z)$ such that

$$
(3 x+y+z)(x+2 y+z)(x+y+z)=p
$$
The factors on the left side are integers, so the absolute value of two of them is 1, and the remaining one is $p$. In terms of sign, either two factors are negative (i.e., one is positive) or all three are positive. The absolute value of $p$ can be chosen for each of the three factors, and similarly, the single positive factor can be chosen for each of the three factors. Thus, the left side can result from 3 value systems where all three factors are positive, and $3 \cdot 3=9$ value systems where two factors are negative. Denoting the consecutive bracketed expressions with the letters $A, B, C$, the 12 value systems are as follows:

![](https://cdn.mathpix.com/cropped/2024_05_02_ac7e1e0756871771f6fbg-1.jpg?height=240&width=1167&top_left_y=387&top_left_x=468)

Now, the system

$$
3 x+y+z=A, \quad x+2 y+z=B, \quad x+y+z=C
$$

has a unique solution

$$
x=\frac{A-C}{2}, \quad y=B-C, \quad z=2 C-B-\frac{A-C}{2}
$$

(since subtracting the third equation from the first two results in two single-variable equations). Here, $y$ is always an integer, while $x$ and $z$ are integers if and only if $A$ and $C$ have the same parity. This always holds if $p$ is odd, and if $p=2$, then only in the above cases V.-VIII., when $|B|=2$.

Thus, for $p=2$, 4 triples satisfy (1), and for any other prime number, 12 triples do. These can be written by substituting the value systems of the table into (1).

Tamás Móri (Budapest, Berzsenyi D. Gymnasium, 2nd grade)