# $\mathbb{Z}_m \times \mathbb Z_n$ is cyclic if and only if $\gcd(m,n)=1$ [closed]

Let $m,n$ be positive integers bigger than $1$. Show that $\mathbb{Z}_m \times \mathbb Z_n$ is cyclic if and only if $\gcd(m,n)=1$.

I have no idea on how to start. Anyone hints are much helpful.

Hint 1: Suppose $d = \gcd(m,n) > 1$. Then $k = \frac{mn}{d}$ is an integer (why?) and every element of $\mathbb{Z}_m \times \mathbb{Z}_n$ has order dividing $k$ (why?). Conclude that $\mathbb{Z}_m \times \mathbb{Z}_n$ cannot be cyclic in this case.
Hint 2: Suppose $d = \gcd(m,n) = 1$. Consider the element $(1,1) \in \mathbb{Z}_m \times \mathbb{Z}_n$ and compute its order. Conlcude that $\mathbb{Z}_m \times \mathbb{Z}_n$ is cyclic in this case.
• @Math_QED: It is an easy calculation $k (a,b) = (0,0)$ for $(a,b) \in \mathbb{Z}_m \times \mathbb{Z}_n$, since $k = m \cdot \frac{n}{d} = n \cdot \frac{m}{d}$, with each of $\frac{n}{d}$ and $\frac{m}{d}$ being integers. Then it follows that $\text{ord}(a,b) \mid k$. – Michael Joyce Jun 22 '17 at 1:25