TITLE: Product of two cyclic groups is cyclic iff their orders are co-prime
QUESTION [32 upvotes]: Say you have two groups $G = \langle g \rangle$ with order $n$ and $H = \langle h \rangle$ with order $m$. Then the product $G \times H$ is a cyclic group if and only if $\gcd(n,m)=1$.
I can't seem to figure out how to start proving this. I have tried with some examples, where I pick $(g,h)$ as a candidate generator of $G \times H$. I see that what we want is for the cycles of $g$ and $h$, as we take powers of $(g,h)$, to interleave such that we do not get $(1,1)$ until the $(mn)$-th power. However, I am having a hard time formalizing this and relating it to the greatest common divisor.
Any hints are much appreciated!

REPLY [34 votes]: $\begin{align}{\bf Hint}\ \ \  
      & \Bbb Z_m \times \mathbb Z_n\ \text{is noncyclic}\\[.2em]
\iff\ & \Bbb Z_m \times \Bbb Z_n\ \text{has all elts of order} < mn\\[.2em]
\iff\ &  {\rm lcm}(m,n) < mn\\[.2em]
\iff\ & \!\gcd(m,n) > 1
\end{align}$