
3. Let $X$ denote the set of all triples $(a, b, c)$ of integers. Define a function $f: X \rightarrow X$ by

$$
f(a, b, c)=(a+b+c, a b+b c+c a, a b c)
$$

Find all triples $(a, b, c)$ in $X$ such that $f(f(a, b, c))=(a, b, c)$.


Solution: We show that the solutionset consists of $\{(t, 0,0) ; t \in \mathbb{Z}\} \cup\{(-1,-1,1)\}$. Let us put $a+b+c=d, a b+b c+c a=e$ and $a b c=f$. The given condition $f(f(a, b, c))=(a, b, c)$ implies that

$$
d+e+f=a, \quad d e+e f+f d=b, d e f=c
$$

Thus $a b c d e f=f c$ and hence either $c f=0$ or $a b d e=1$.

Case I: Suppose $c f=0$. Then either $c=0$ or $f=0$. However $c=0$ implies $f=0$ and vice-versa. Thus we obtain $a+b=d, d+e=a, a b=e$ and $d e=b$. The first two relations give $b=-e$. Thus $e=a b=-a e$ and $d e=b=-e$. We get either $e=0$ or $a=d=-1$.

If $e=0$, then $b=0$ and $a=d=t$, say. We get the triple $(a, b, c)=(t, 0,0)$, where $t \in \mathbb{Z}$. If $e \neq 0$, then $a=d=-1$. But then $d+e+f=a$ implies that $-1+e+0=-1$ forcing $e=0$. Thus we get the solution family $(a, b, c)=(t, 0,0)$, where $t \in \mathbb{Z}$.

Case II: Suppose $c f \neq 0$. In this case $a b d e=1$. Hence either all are equal to 1 ; or two equal to 1 and the other two equal to -1 ; or all equal to -1 .

Suppose $a=b=d=e=1$. Then $a+b+c=d$ shows that $c=-1$. Similarly $f=-1$. Hence $e=a b+b c+c a=1-1-1=-1$ contradicting $e=1$.

Suppose $a=b=1$ and $d=e=-1$. Then $a+b+c=d$ gives $c=-3$ and $d+e+f=a$ gives $f=3$. But then $f=a b c=1 \cdot 1 \cdot(-3)=-3$, a contradiction. Similarly $a=b=-1$ and $d=e=1$ is not possible.

If $a=1, b=-1, d=1$, $e=-1$, then $a+b+c=d$ gives $c=1$. Similarly $f=1$. But then $f=a b c=1 \cdot 1 \cdot(-1)=-1$ a contradiction. If $a=1, b=-1, d=-1, e=1$, then $c=-1$ and $e=a b+b c+c a=-1+1-1=-1$ and a contradiction to $e=1$. The symmetry between $(a, b, c)$ and $(d, e, f)$ shows that $a=-1, b=1, d=1, e=-1$ is not possible. Finally if $a=-1, b=1, d=-1$ and $e=1$, then $c=-1$ and $f=-1$. But then $f=a b c$ is not satisfied.

The only case left is that of $a, b, d, e$ being all equal to -1 . Then $c=1$ and $f=1$. It is easy to check that $(-1,-1,1)$ is indeed a solution.

## Alternatively

$c f \neq 0$ implies that $|c| \geq 1$ and $|f| \geq 1$. Observe that

$$
d^{2}-2 e=a^{2}+b^{2}+c^{2}, \quad a^{2}-2 b=d^{2}+e^{2}+f^{2}
$$

Adding these two, we get $-2(b+e)=b^{2}+c^{2}+e^{2}+f^{2}$. This may be written in the form

$$
(b+1)^{2}+(e+1)^{2}+c^{2}+f^{2}-2=0
$$

We conclude that $c^{2}+f^{2} \leq 2$. Using $|c| \geq 1$ and $|f| \geq 1$, we obtain $|c|=1$ and $|f|=1$, $b+1=0$ and $e+1=0$. Thus $b=e=-1$. Now $a+d=d+e+f+a+b+c$ and this gives $b+c+e+f=0$. It follows that $c=f=1$ and finally $a=d=-1$.
