How to prove that $n\mid {a_1}^2+\cdots +{a}^2_{\phi (n)}$? If $n\in \Bbb N $ such that $\gcd(n,6)=1$ and $a_1,\ldots,a_{\phi( n)}$ are relatively prime with $n$ and smaller than $n$, how to prove : $$n\mid {a_1}^2+\cdots +{a}^2_{\phi (n)}$$
 A: My guess would be that the correct statement is the following.
Let $n \in \Bbb{N}$ such that $\gcd(n, 6) = 1$. Show that in $\Bbb{Z} / n \Bbb{Z}$ we have
$$
\sum_{a \in \Bbb{Z} / n \Bbb{Z}^{*}} a^{2} = 0.
$$
It suffices to prove that the sum is zero modulo each $p^{e}$ in the prime decomposition $n = \prod p_i^{e_i}$.
$$
\sum_{a \in \Bbb{Z} / n \Bbb{Z}^{*}} a^{2}
=
\dfrac{\varphi(n)}{\varphi(p^e)} \sum_{a \in \Bbb{Z} / p^e \Bbb{Z}^{*}} a^{2}
=
2 \dfrac{\varphi(n)}{\varphi(p^e)} \sum_{b \in Q} b,
$$
where $Q$ is the set of  squares in $\Bbb{Z} / p^e \Bbb{Z}^{*}$, which has cardinality $(p^{e} -1)/2$, as $n$ is odd.
If $c$ is a fixed non-square in $\Bbb{Z} / p^e \Bbb{Z}^{*}$, then 
$$
\sum_{a \in \Bbb{Z} / p^e \Bbb{Z}^{*}} a
=
\sum_{b \in Q} b + \sum_{b \in Q} c b = (1+c) \sum_{b \in Q} b.\tag{1}
$$
Now the sum in (1) is zero in $\Bbb{Z} / p^e \Bbb{Z}^{*}$, because it does not change when multiplied by $1 \ne a \in \Bbb{Z} / p^e \Bbb{Z}^{*}$. And since $n$ is not $3$, there is a non-square $c \ne -1$, so $Q = 0$ modulo $p^{e}$.
A: $\gcd(n,6)=1 $ so $\gcd(n,2)=1,\gcd(n,3)=1$, also $\gcd(a_i,n)=1$ so $\gcd(2a_i,n)=1$
$$\{a_1,...,a_{\phi (n)}\}=\{2a_1,...,2a_{\phi (n)}\} $$ 
$a_1^2+...+a_{\phi (n)}^2\equiv 4a_1^2+...+4a_{\phi (n)}^2 \pmod n $ finally:
$n|3(a_1^2+...+a_{\phi (n)}^2)$ ,$\gcd(n,3)=1$ so $$n|a_1^2+...+a_{\phi (n)}^2$$
