0

Prove that the sum of all positive integers $k$ with $1 \le k < n$ and $gcd(k,n)=1$ is $1 \over {2}$$n\phi(n)$

I know that there's a duplicate of this question out there, but only hints were given. Any help with a formal proof would be much appreciated.

DERPYPENGUIN
  • 491
  • 7
  • 24

1 Answers1

3

Claim: If $k$ is co-prime to $n$, so is $n-k$.

Proof: By Bezout's theorem, there exist integers $x,y$ such that $xn+yk=1$. Now, note that $$xn+yk = xn+yn-yn+yk = (x+y)n+(-y)(n-k) = 1$$

Therefore, since a linear combination of $n-k$ and $n$ sums to $1$, it follows that these are also co-prime.

Hence, it follows that these numbers come in pairs, and distinct pairs, because if $k=n-k$, then $2k=n$, so $k,n$ won't be co-prime (unless $k=1$, but the claim is true for $k=1$ anyway). Furthermore, the sum of these pairs is $n-k+k=n$.

How many are the number of pairs? Well, there are precisely $\phi(n)$ co-prime numbers to $n$, which are less than $n$. Hence the number of pairs formed is $\frac{\phi(n)}{2}$, and the sum of each pair is $n$, so it follows that the total sum of all the co-prime numbers is $\frac{n\phi(n)}{2}$.

Example: For $9$, the co-prime numbers are $1,2,4,5,7,8$. They form pairs, $(1,8), (2,7),(4,5)$. Each pair sums to $9$, so the total is 27. Also, $\phi(9)=6$, and $\frac{9 \times \phi(9)}{2}=27$.