Find all of the homomorphisms $ \varphi: \mathbb{Z}_{15} \to \mathbb{Z}_{6} $. I'd like to find all of the homomorphisms $ \varphi: \mathbb{Z}_{15} \to \mathbb{Z}_{6} $.
What I've tried so far:
I know that $ |\text{Im} (\varphi)| $ divides $ \text{gcd}(|\mathbb{Z}_{15}|,|\mathbb{Z}_{6}|) = 3 $. Then, $ |\text{Im} (\varphi)| = 1 $ or $ |\text{Im} (\varphi)| = 3 $.
If $ |\text{Im} (\varphi)| = 1 $ then $ |\text{Ker} (\varphi)| = 15 $, because $ | \mathbb{Z}_{15} | = |\text{Im} (\varphi)|\cdot |\text{Ker} (\varphi)| $. In particular, this is the trivial homomorphism: $ \varphi(a) = \bar{0}, \quad \forall a \in \mathbb{Z}_{15} $
I don't know how could I find the others homomorphisms. :/
 A: First, we need to find $\phi \left ( \overline{1} \right )$. Suppose that $\phi \left ( \overline{1} \right )=\overline{a}$, where $a \in \left \{0, 1, 2, 3, 4, 5 \right \}$. We have $$\overline{0}_6=\phi \left ( \overline{0}_{15}\right )=\phi \left ( \overline{15} \right )=\phi \left ( 15.\overline{1}\right )=15\phi \left (\overline{1}\right )=15\overline{a}$$ (Note that $15.\overline{1}$ means $\overline{1}+\overline{1}+...+\overline{1}$ (15 times) )
Thus we get $15a$ divides by $6$. So $a$ can be $0,2,4$.
Therefore, we have three homomorphisms.
A: More generally, it is easy to prove, for any $m,n$ that
$$\operatorname{Hom}_\mathbf Z(\mathbf Z/m\mathbf Z,\mathbf Z/n\mathbf Z)\simeq \mathbf Z/\gcd(m,n)\mathbf Z.$$
Indeed,$\;\operatorname{Hom}_\mathbf Z(\mathbf Z/m\mathbf Z,\mathbf Z/n\mathbf Z)\simeq \operatorname{Ann}_{\mathbf Z/n\mathbf Z}(m\mathbf Z)=\bigl\{x+n\mathbf Z\mid mx\in n\mathbf Z\bigr\}.$
Write $m=\gcd(m,n)m_1$, $n=\gcd(m,n)n_1$, where $m_1$ and $n_1$ are coprime.  ‘$mx$ is divisible par $n$’  means that ‘$m_1x$ is divisible by $n_1$’ and, since $m_1$ and $n_1$ are coprime, it means ‘$x$ is divible by $n_1$’.
Thus $$\operatorname{Hom}_\mathbf Z(\mathbf Z/m\mathbf Z,\mathbf Z/n\mathbf Z)\simeq \operatorname{Ann}_{\mathbf Z/n\mathbf Z}(m\mathbf Z)=n_1\mathbf Z/n\mathbf Z\simeq \mathbf Z/\gcd(m,n)\mathbf Z.$$
