
4. How many 6-tuples $\left(a_{1}, a_{2}, a_{3}, a_{4}, a_{5}, a_{6}\right)$ are there such that each of $a_{1}, a_{2}, a_{3}, a_{4}, a_{5}, a_{6}$ is from the set $\{1,2,3,4\}$ and the six expressions

$$
a_{j}^{2}-a_{j} a_{j+1}+a_{j+1}^{2}
$$

for $j=1,2,3,4,5,6$ (where $a_{7}$ is to be taken as $a_{1}$ ) are all equal to one another?


Solution: Without loss of generality, we may assume that $a_{1}$ is the largest among $a_{1}, a_{2}, a_{3}, a_{4}, a_{5}, a_{6}$. Consider the relation

$$
a_{1}^{2}-a_{1} a_{2}+a_{2}^{2}=a_{2}^{2}-a_{2} a_{3}+a_{3}^{2}
$$

This leads to

$$
\left(a_{1}-a_{3}\right)\left(a_{1}+a_{3}-a_{2}\right)=0
$$

Observe that $a_{1} \geq a_{2}$ and $a_{3}>0$ together imply that the second factor on the left side is positive. Thus $a_{1}=a_{3}=\max \left\{a_{1}, a_{2}, a_{3}, a_{4}, a_{5}, a_{6}\right\}$. Using this and the relation

$$
a_{3}^{2}-a_{3} a_{4}+a_{4}^{2}=a_{4}^{2}-a_{4} a_{5}+a_{5}^{2}
$$

we conclude that $a_{3}=a_{5}$ as above. Thus we have

$$
a_{1}=a_{3}=a_{5}=\max \left\{a_{1}, a_{2}, a_{3}, a_{4}, a_{5}, a_{6}\right\}
$$

Let us consider the other relations. Using

$$
a_{2}^{2}-a_{2} a_{3}+a_{3}^{2}=a_{3}^{2}-a_{3} a_{4}+a_{4}^{2}
$$

we get $a_{2}=a_{4}$ or $a_{2}+a_{4}=a_{3}=a_{1}$. Similarly, two more relations give either $a_{4}=a_{6}$ or $a_{4}+a_{6}=a_{5}=a_{1}$; and either $a_{6}=a_{2}$ or $a_{6}+a_{2}=a_{1}$. Let us give values to $a_{1}$ and count the number of six-tuples in each case.

(A) Suppose $a_{1}=1$. In this case all $a_{j}$ 's are equal and we get only one six-tuple $(1,1,1,1,1,1)$.

(B) If $a_{1}=2$, we have $a_{3}=a_{5}=2$. We observe that $a_{2}=a_{4}=a_{6}=1$ or $a_{2}=a_{4}=$ $a_{6}=2$. We get two more six-tuples: $(2,1,2,1,2,1),(2,2,2,2,2,2)$.

(C) Taking $a_{1}=3$, we see that $a_{3}=a_{5}=3$. In this case we get nine possibilities for $\left(a_{2}, a_{4}, a_{6}\right)$

$$
(1,1,1),(2,2,2),(3,3,3),(1,1,2),(1,2,1),(2,1,1),(1,2,2),(2,1,2),(2,2,1)
$$

(D) In the case $a_{1}=4$, we have $a_{3}=a_{5}=4$ and

$$
\begin{aligned}
\left(a_{2}, a_{4}, a_{6}\right)=(2,2,2),(4,4,4) & ,(1,1,1),(3,3,3) \\
& (1,1,3),(1,3,1),(3,1,1),(1,3,3),(3,1,3),(3,3,1)
\end{aligned}
$$

Thus we get $1+2+9+10=22$ solutions. Since $\left(a_{1}, a_{3}, a_{5}\right)$ and $\left(a_{2}, a_{4}, a_{6}\right)$ may be interchanged, we get 22 more six-tuples. However there are 4 common among these, namely, $(1,1,1,1,1,1),(2,2,2,2,2,2),(3,3,3,3,3,3)$ and $(4,4,4,4,4,4)$. Hence the total number of six-tuples is $22+22-4=40$.
