
5. Let $S$ denote the set of all 6-tuples $(a, b, c, d, e, f)$ of positive integers such that $a^{2}+b^{2}+c^{2}+d^{2}+e^{2}=$ $f^{2}$. Consider the set

$$
T=\{a b c d e f:(a, b, c, d, e, f) \in S\}
$$

Find the greatest common divisor of all the members of $T$.


Solution: We show that the required gcd is 24 . Consider an element $(a, d, c, d, e, f) \in S$. We have

$$
a^{2}+b^{2}+c^{2}+d^{2}+e^{2}=f^{2}
$$

We first observe that not all $a, b, c, d, e$ can be odd. Otherwise, we have $a^{2} \equiv b^{2} \equiv c^{2} \equiv d^{2} \equiv e^{2} \equiv 1$ $(\bmod 8)$ and hence $f^{2} \equiv 5(\bmod 8)$, which is impossible because no square can be congruent to 5 modulo 8. Thus at least one of $a, b, c, d, e$ is even.

Similarly if none of $a, b, c, d, e$ is divisible by 3 , then $a^{2} \equiv b^{2} \equiv c^{2} \equiv d^{2} \equiv e^{2} \equiv 1(\bmod 3)$ and hence $f^{2} \equiv 2(\bmod 3)$ which again is impossible because no square is congruent to 2 modulo 3 . Thus 3 divides $a b c d e f$.

There are several possibilities for $a, b, c, d, e$.

Case 1: Suppose one of them is even and the other four are odd; say $a$ is even, $b, c, d, e$ are odd. Then $b^{2}+c^{2}+d^{2}+e^{2} \equiv 4(\bmod 8)$. If $a^{2} \equiv 4(\bmod 8)$, then $f^{2} \equiv 0(\bmod 8)$ and hence $2|a, 4| f$ giving $8 \mid a f$. If $a^{2} \equiv 0(\bmod 8)$, then $f^{2} \equiv 4(\bmod 8)$ which again gives that $4 \mid a$ and $2 \mid f$ so that $8 \mid a f$. It follows that $8 \mid a b c d e f$ and hence $24 \mid a b c d e f$.

Case 2: Suppose $a, b$ are even and $c, d, e$ are odd. Then $c^{2}+d^{2}+e^{2} \equiv 3(\bmod 8)$. Since $a^{2}+b^{2} \equiv 0$ or 4 modulo 8 , it follows that $f^{2} \equiv 3$ or $7(\bmod 8)$ which is impossible. Hence this case does not arise.

Case 3: If three of $a, b, c, d, e$ are even and two odd, then $8 \mid a b c d e f$ and hence 24|abcdef.

Case 4: If four of $a, b, c, d, e$ are even, then again $8 \mid a b c d e f$ and 24|abcdef. Here again for any six tuple $(a, b, c, d, e, f)$ in $S$, we observe that $24 \mid a b c d e f$. Since

$$
1^{2}+1^{2}+1^{2}+2^{2}+3^{2}=4^{2}
$$

We see that $(1,1,1,2,3,4) \in S$ and hence $24 \in T$. Thus 24 is the gcd of $T$.
