Q:

Finding homomorphisms $f: \mathbb{Z}_{12} \to \mathbb{Z}_{18}$ with image of size $3$

I'm looking at the number of group homomorphisms $f:\mathbb{Z}_{12} \to\mathbb{Z}_{18}$ whose image is of size 3. 
I read from another post that the total number of group homomorphisms is $1 +$ the number of elements of order $12$ in $\mathbb{Z}_{18}$. I hadn't seen this before, but if this is true, then isn't there no element of order $12$ in $\mathbb{Z}_{18}$ which means there is only one group homomorphism? 
Also, from the corollary: if $G$ is finite, then $|im (f)|$ divides both $|H|$ and $|G|$, 3 clearly divides $|f:\mathbb{Z}_{12}|=12$ and $|\mathbb{Z}_{18}|=18$, so I know that there must be at least one homomorphism, right?

A:

The image of a group is a subgroup. What are the subgroups of $\mathbb{Z}_{18}$ of size $3$? There is exactly one, and it is $\{ 0, 6, 12\}$, and it is generated by either $6$ or by $12$.
The group $\mathbb{Z}_{18}$ is generated by $1$, and so a group homomorphism $\phi$ is determined entirely by $\phi(1)$. The image of $1$ must be one of the two generators of $\mathbb{Z}_3 \cong \{0, 6, 12\} \subset \mathbb{Z}_{18}$.
So there are two homomorphisms, given by $\phi(1) = 6$ and $\phi'(1) = 12$. 

