Given the following arrangement of circles:
Each of the numbers $1,2, \ldots, 9$ is to be written into one of these circles, so that each circle contains exactly one of these numbers and
(i) the sums of the four numbers on each side of the triangle are equal;
(ii) the sums of squares of the four numbers on each side of the triangle are equal.

Find all ways in which this can be done.
Answer: The only solutions are
and the ones generated by permuting the vertices, adjusting sides and exchanging the two middle numbers on each side.
Solution
Let $a, b$, and $c$ be the numbers in the vertices of the triangular arrangement. Let $s$ be the sum of the numbers on each side and $t$ be the sum of the squares of the numbers on each side. Summing the numbers (or their squares) on the three sides repeats each once the numbers on the vertices (or their squares):
$$
\begin{array}{c}
3 s=a+b+c+(1+2+\cdots+9)=a+b+c+45 \\
3 t=a^{2}+b^{2}+c^{2}+\left(1^{2}+2^{2}+\cdots+9^{2}\right)=a^{2}+b^{2}+c^{2}+285
\end{array}
$$

At any rate, $a+b+c$ and $a^{2}+b^{2}+c^{2}$ are both multiples of 3 . Since $x^{2} \equiv 0,1(\bmod 3)$, either $a, b, c$ are all multiples of 3 or none is a multiple of 3 . If two of them are $1,2 \bmod 3$ then $a+b+c \equiv 0(\bmod 3)$ implies that the other should be a multiple of 3 , which is not possible. Thus $a, b, c$ are all congruent modulo 3 , that is,
$$
\{a, b, c\}=\{3,6,9\}, \quad\{1,4,7\}, \quad \text { or } \quad\{2,5,8\} .
$$

Case 1: $\{a, b, c\}=\{3,6,9\}$. Then $3 t=3^{2}+6^{2}+9^{2}+285 \Longleftrightarrow t=137$.
In this case $x^{2}+y^{2}+3^{2}+9^{2}=137 \Longleftrightarrow x^{2}+y^{2}=47$. However, 47 cannot be written as the sum of two squares. One can check manually, or realize that $47 \equiv 3(\bmod 4)$, and since $x^{2}, y^{2} \equiv 0,1(\bmod 4), x^{2}+y^{2} \equiv 0,1,2(\bmod 4)$ cannot be 47 . Hence there are no solutions in this case.
Case 2: $\{a, b, c\}=\{1,4,7\}$. Then $3 t=1^{2}+4^{2}+7^{2}+285 \Longleftrightarrow t=117$.
In this case $x^{2}+y^{2}+1^{2}+7^{2}=117 \Longleftrightarrow x^{2}+y^{2}=67 \equiv 3(\bmod 4)$, and as in the previous case there are no solutions.
Case 3: $\{a, b, c\}=\{2,5,8\}$. Then $3 t=2^{2}+5^{2}+8^{2}+285 \Longleftrightarrow t=126$.
Then
$$
\left\{\begin{array} { c } 
{ x ^ { 2 } + y ^ { 2 } + 2 ^ { 2 } + 8 ^ { 2 } = 1 2 6 } \\
{ t ^ { 2 } + u ^ { 2 } + 2 ^ { 2 } + 5 ^ { 2 } = 1 2 6 } \\
{ m ^ { 2 } + n ^ { 2 } + 5 ^ { 2 } + 8 ^ { 2 } = 1 2 6 }
\end{array} \Longleftrightarrow \left\{\begin{array}{c}
x^{2}+y^{2}=58 \\
t^{2}+u^{2}=97 \\
m^{2}+n^{2}=37
\end{array}\right.\right.
$$

The only solutions to $t^{2}+u^{2}=97$ and $m^{2}+n^{2}=37$ are $\{t, u\}=\{4,9\}$ and $\{m, n\}=\{1,6\}$, respectively (again, one can check manually.) Then $\{x, y\}=\{3,7\}$, and the solutions are and the ones generated by permuting the vertices, adjusting sides and exchanging the two middle numbers on each side. There are $3!\cdot 2^{3}=48$ such solutions.