Find the smallest $n \in \mathbb{N}$ such that the group is isomorphic to the direct product of $n$ cyclic groups Find the smallest $n \in \mathbb{N}$ such that the group $\mathbb{Z}_{6} \times \mathbb{Z}_{20} \times \mathbb{Z}_{45}$ is isomorphic to the direct product of $n$ cyclic groups.
I'm not sure but if I understand correctly,
$\mathbb{Z}_{6} \times \mathbb{Z}_{20} \times \mathbb{Z}_{45}$ is isomorphic to $\mathbb{Z}_{2} \times \mathbb{Z}_{3} \times \mathbb{Z}_{4} \times \mathbb{Z}_{5} \times \mathbb{Z}_{5} \times \mathbb{Z}_{9}$, 
$\mathbb{Z}_{2} \times \mathbb{Z}_{5} \times \mathbb{Z}_{9}$ is isomorphic to
$\mathbb{Z}_{90}$,
$\mathbb{Z}_{3} \times \mathbb{Z}_{4} \times \mathbb{Z}_{5}$ is isomorphic to
$\mathbb{Z}_{60}$, 
and therefore, 
$\mathbb{Z}_{6} \times \mathbb{Z}_{20} \times \mathbb{Z}_{45}$ is isomorphic to $\mathbb{Z}_{60} \times \mathbb{Z}_{90}$ and the answer is $n = 2$. Is this 
a correct solution?
 A: You may find the invariant factors.
Actually $\mathbb{Z}_6\times \mathbb{Z}_{20}\times \mathbb{Z}_{45}\cong (\mathbb{Z}_2\times\mathbb{Z}_4)\times(\mathbb{Z}_3\times\mathbb{Z}_9)\times(\mathbb{Z}_5\times\mathbb{Z}_5)$. Now we can pick the largest ones in each bracket to form $\mathbb{Z}_4\times\mathbb{Z}_9\times\mathbb{Z}_5\cong\mathbb{Z}_{180}$. Then we pick the largest ones of the remaining, which is $\mathbb{Z}_2\times\mathbb{Z}_3\times\mathbb{Z}_5\cong\mathbb{Z}_{30}$, and nothing remain. Hence the group is isomorphic to $\mathbb{Z}_{180}\times\mathbb{Z}_{30}$ and so $n\le 2$. Since the group is obviously not cyclic, we have $n = 2$.
I think we can always get $n$ for any abelian group by finding the invariant factors.
A: According to GAP, the group is $$\Bbb Z_{180}\times \Bbb Z_{30}$$ and, of course, not cyclic.
gap> G:=DirectProduct(CyclicGroup(6) , DirectProduct(CyclicGroup(20), CyclicGroup(45)));
<pc group of size 5400 with 8 generators>
gap> StructureDescription(G);
"C180 x C30"
gap> IsCyclic(G);
false
gap>

