Fundamental Theorem of Finite Abelian Groups indicates that $\mathbb{Z}_{n}$ is isomorphic to $\mathbb{Z}_{p_1^{k_1}} \times \mathbb{Z}_{p_2^{k_2}}\times$ ... $\times\mathbb{Z}_{p_n^{k_n}}$ where $p_i$ are prime and not necessarily distinct.
But I know that $\mathbb{Z}_4$ is not isomorphic to $\mathbb{Z}_2 \times\mathbb{Z}_2$ because $\mathbb{Z}_{mn}$ is only isomorphic to $\mathbb{Z}_m\times\mathbb{Z}_n$ only if $m$ and $n$ are relatively prime.
Can anyone clarify and correct my misunderstanding on this subject.
Thanks