Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

how do I prove The second formula from Euler's totient function ?

$$\sum_{\substack{1\le k\le n\\(k,n)=1}} k=\frac 12 n \varphi(n)$$ for $n>1$.


share|cite|improve this question
up vote 1 down vote accepted

We know that there are exactly $\phi(m)$ integers less than $m$ and relatively prime to $m$. Also if $a<m$ and $(m,a)=1$ then clearly $m-a<m$ and $(m,m-a)=1.$ Thus there are exactly $\phi(m)$ integers $a_{1},a_{2},...,m-a_{2},m-a_{1}$ less than $m$ and relatively prime to $m$. Let $$S=a_{1}+a_{2}+...+(m-a_{3})+(m-a_{2})+(m-a_{1})$$ Now writing the above term in reverse order, we get, $$ S=(m-a_{1})+(m-a_{2})+...+a_{2}+a_{1}$$ Adding above two results, $$2S=m+m+...+m(\phi(m)\text{ terms})$$ $$\therefore S=\frac{m\phi(m)}{2}$$ It implies that the sum of $\phi(m)$ positive integers which are less than $m$ and relatively prime to $m$ is $\frac{m\phi(m)}{2}$.

share|cite|improve this answer
I hope my answer useful. @Rami – Kns Apr 16 '12 at 16:49

If $0<k<n$ and $\gcd(k,n)=1$ then $\gcd(n-k,n)=1$ and $k+(n-k)=n$.

share|cite|improve this answer
I fail to see how the equality follows from this. I know that $\sum_{1\leq k\leq n}k=\frac{n(n+1)}{2}$, but it seems that for this case, the $n+1$ term is replaced by $\varphi(n)$. – EsX_Raptor Apr 16 '12 at 15:21
It is a summation over φ(n)/2 pairs, each of which sum to n. – Wonder Apr 16 '12 at 15:22
I see it now. That makes perfect sense. Thanks. :) And +1 to the OP for this question. – EsX_Raptor Apr 16 '12 at 15:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.