When is Hom(G,H) cyclic? Let $G$ and $H$ be two finitely generated groups, where $H$ is abelian. I'm curious in which cases $Hom(G,H)$ turns out to be cyclic or virtually cyclic.
 A: If $H$ is abelian, any homomorphism $G \to H$ factors through the abelianization $G/[G, G] \to H$, so we may assume WLOG that $G$ is also abelian, so we can apply the structure theorem to both $G$ and $H$. Then $\text{Hom}(G, H)$ is virtually cyclic if and only if it has rank at most $1$, hence if and only if both $G$ and $H$ themselves have rank at most $1$, and this is easy to test (it reduces to linear algebra over $\mathbb{Q}$ given a presentation of $G$ and $H$). 
To see when $\text{Hom}(G, H)$ is cyclic, write $G_p, H_p$ for the $p$-parts of $G, H$ respectively and $\mathbb{Z}^a, \mathbb{Z}^b$ for the torsion-free parts. Then
$$\text{Hom}(G, H) \cong H^a \oplus \bigoplus_p \text{Hom}(G_p, H_p).$$
In particular, it has rank $ab \le 1$. If $ab = 1$, then $H \cong \mathbb{Z}$ and $G$ has rank $1$ so that $\text{Hom}(G, H) \cong \mathbb{Z}$.
If $ab = 0$, then $\text{Hom}(G, H)$ is finite, so it is cyclic if and only if its $p$-parts
$$\text{Hom}(G, H)_p \cong H_p^a \oplus \text{Hom}(G_p, H_p)$$
are cyclic. This can occur in a few different ways; either $\text{Hom}(G_p, H_p) = 0, a = 1$, and $H_p$ is cyclic, or $H_p = 0$, or $a = 0$ and $G_p, H_p$ are both cyclic. 
