6

How to show that $$\gcd(a,b)=\sum_{k\mid a\text{ and }k\mid b}\varphi(k).$$

$\varphi$ is the Euler's totient function.

I was trying to prove the number of homomorphisms from a cyclic group of order $m$ and $n$ is $\gcd(n,m)$.
Every cyclic group of order $n$ is isomorphic to $Z_n$. Hence a homomorphism from $Z_n$ to $Z_m$ is completely determined by the image of $1 \in Z_n$. If $1$ maps to $a$, I know that $|a|$ should divide both $n$ and $m$. So $|a|$ are common divisors of $n$ and $m$. Let $d$ be any positive common divisor of $n$ and $m$, then the number of elements of order $d$ in a cyclic group of order $n$ is $\phi(d)$. Then the number of candidates for $a$ is $\sum_{d|n\,and\,d|m}\varphi(d)$. If I am able to show the above relation, I'm done.

Bijesh K.S
  • 2,704
  • 1
    Would the downvoter care to comment? – Bijesh K.S Jun 01 '16 at 03:56
  • 1
    Can you share what you've tried, and what you're having trouble with? You've just copy-pasted a problem here without any thoughts or efforts shown, hence my downvote and vote for closure. –  Jun 01 '16 at 03:57
  • Ohk Thanks! I'll look to it@T.Bongers – Bijesh K.S Jun 01 '16 at 04:01
  • Your question was put on hold, the message above (and possibly comments) should give an explanation why. (In particular, this link might be useful.) You might try to edit your question to address these issues. Note that the next edit puts your post in the review queue, where users can vote to reopen this. (Therefore it would be good to avoid minor edits and improve your question as much as possible with the next edit.) – Martin Sleziak Jun 01 '16 at 07:30
  • IIRC inline tags edit do not count for this purpose - so my edit did not enqueue your question. – Martin Sleziak Jun 01 '16 at 07:31
  • 1
    I have edited, thanks @MartinSleziak – Bijesh K.S Jun 01 '16 at 07:48
  • 2
    You really described your motivation for asking this very nicely, so it is not that surprising that the post was indeed reopened. – Martin Sleziak Jun 01 '16 at 09:18

2 Answers2

7

It is an immediate consequence of

$$n=\sum_{k|n}\varphi(k)$$

Because $k|a \text{ and } k|b\iff k|\gcd(a,b)$

Consider the set

$$D=\left\lbrace{1\over n},\ldots,{n\over n}\right\rbrace$$

$|D|=n$. Now consider the family of sets

$$D_d=\left\lbrace{k\over d}|\gcd(k,d)=1\text{ and }1\leq k\leq d\right\rbrace$$

The existence and unicity of the representation of a rational by an irreducible fraction allows to say that the sets $D_d$ for $d|n$ form a partition of $D$. And this gives

$$n=|D|=\sum_{d|n}|D_d|=\sum_{d|n}\varphi(d)$$

marwalix
  • 17,045
0

Gauß gave a very nice proof that $$\sum_{k|n}\varphi(k)=n$$. You can find his proof on Wikipedia.

My memory of it goes as follows: every element of the cyclic group $C_n$ generates a cyclic subgroup; and there are $\varphi(k)$ such elements for each divisor $k$ of $n$.