Find the number of homomorphisms between $\mathbb{Z}_m$ and $\mathbb{Z}_n$ [duplicate]

Although there are many attempts to the problem but I wasn't really able to understand those so I took some idea from examples and attempted it. Can someone just go through it please.

My attempt: Let $\sigma:\mathbb{Z}_{m}\to \mathbb{Z}_{n}$. The kernel $\ker(\sigma)$ is a normal subgroup of $\mathbb{Z}_{m}$. So $\ker(\sigma)=\langle\frac{m}{d}\rangle$, where $d|m$. Now $\operatorname{im}(\sigma$) is a subgroup of $\mathbb{Z}_n$. So, now the order of the image should be $d$ so $d|n$. Now the number of homomorphisms when the kernel is of order $d$ will be $\sum_{d|m,d|n}\varphi(d)$. From here we can conclude that the no of homomorphisms should be $\gcd(m,n)$. Is this OK? Where am I making mistakes?


Solution 1:

Yes, there are $\gcd(m,n)$ such homomorphisms.

Another way to see it is that we need $f([1])=[a]$ where $0\le a<n$ and that $m[a]=[ma]=0$ in $\Bbb Z_n$, that is, $n\mid ma$ or $ma\equiv 0\pmod n$. The solution to this congruence is $a\equiv 0\pmod{n/g}$ where $g=\gcd(m,n)$, so that $a=jn/g$ for $0\le j<g$, so there are $g$ solutions.

Solution 2:

There is an article on the same topic, of which I have a photocopy, in an old issue (sorry, don't have the date) of either American Mathematical Monthly or Mathematics Magazine (I cannot tell from my copy), authors Joseph A Gallian and James Van Buskirk. They give the number of group homomorphisms as $\gcd(m,n)$. Your analysis is close, except you formulated the sum incorrectly; the correct sum is over the set of divisors of the $\gcd$. [They also give the corresponding number of ring homomorphisms.]