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!
Note that $|G\times H|=|G||H|=nm$; so $G\times H$ is cyclic if and only if there is an element of order $nm$ in $G\times H$.
In any group $A$, if $a,b\in A$ commute with one another, $a$ has order $k$, and $b$ has order $\ell$ then the order of $ab$ will divide lcm$(k,\ell)$ (prove it).
Now take an element of $G\times H$, written as $(g^a,h^b)$, where $G=\langle g\rangle$, $H=\langle h\rangle$, $0\leq a\lt n$, $0\leq b\lt m$. Then $(g^a,h^b)=(g^a,1)(1,h^b)$. In this case, what is the order? Under what conditions can you get an element of order exactly $nm$, which is what you need?