Simple proof that n divides $\sum_{1\le k<n, \gcd(k,n)=1} k$ [duplicate]

Let postive integer $n$ is not a power of a prime. Prove that $$\sum_{1\le k\le n-1,\gcd{(k,n)}=1}k=\dfrac{1}{2}n\varphi{(n)}\tag{1}$$ where $\varphi{(n)}$ is the Euler totient function

I kown $$\sum_{1\le k\le n-1,\gcd{(k,n)}=1}=\varphi{(n)}$$But I can't prove question $(1)$


Solution 1:

Hint. We have that $$2\sum_{1\le k\le n-1,\gcd{(k,n)}=1}k=\sum_{1\le k\le n-1,\gcd{(k,n)}=1}k+\sum_{1\le (n-k)\le n-1,\gcd{((n-k),n)}=1}(n-k).$$