Claim. Given a positive integer n,
let Sn={a1,a2,a3,…,am} be the set
of all positive integers less than n and relatively prime to n.
Then ∑k=1mak is divisible by n.
Proof. Using the fact that if k is relatively prime to n, then so is n−k, we can compute twice the sum with the following.
k=1∑m(ak+(n−ak)).
The desired sum is half of the above equation, which simplifies as follows.
21k=1∑m(ak+(n−ak))=21k=1∑mn=2mn.
Thus the sum is 2mn, which is divible by n.
□