This question is taken from "A first course in Abstract Algebra" by Fraleigh 7th edition, section 11 question 18:
Are the groups $\mathbb{Z}_8 \times \mathbb{Z}_{10} \times \mathbb{Z}_{24}$ and $\mathbb{Z}_4 \times \mathbb{Z}_{12} \times \mathbb{Z}_{40}$ isomorphic?
The solution manual says no. My question is why not?
We have $$\mathbb{Z}_8 \approx \mathbb{Z}_{2} \times \mathbb{Z}_{2} \times \mathbb{Z}_{2},$$
and $$\mathbb{Z}_{10} \approx \mathbb{Z}_{5} \times \mathbb{Z}_{2},$$
and $$\mathbb{Z}_{24} \approx \mathbb{Z}_{2} \times \mathbb{Z}_{2} \times \mathbb{Z}_{2} \times \mathbb{Z}_{3}.$$
Thus $$\mathbb{Z}_8 \times \mathbb{Z}_{10} \times \mathbb{Z}_{24} \approx \mathbb{Z}_{2} \times \mathbb{Z}_{2} \times \mathbb{Z}_{2} \times \mathbb{Z}_{5} \times \mathbb{Z}_{2} \times \mathbb{Z}_{2} \times \mathbb{Z}_{2} \times \mathbb{Z}_{2} \times \mathbb{Z}_{3}$$
Similiarly, $$\mathbb{Z}_4 \times \mathbb{Z}_{12} \times \mathbb{Z}_{40} \approx \mathbb{Z}_{2} \times \mathbb{Z}_{2} \times \mathbb{Z}_{2} \times \mathbb{Z}_{2} \times \mathbb{Z}_{3} \times \mathbb{Z}_{2} \times \mathbb{Z}_{2} \times \mathbb{Z}_{2} \times \mathbb{Z}_{5}$$
These last 2 expressions are the same except for a reordering. Where is the mistake in my reasoning?
Let's focus on a very simple case, comparing $\mathbb{Z}_{4}$ and $\mathbb{Z}_{2} \times \mathbb{Z}_{2}$. Are these the same? They have the same order, but they are actually not isomorphic! To see why, note that $1$ has order $4$ in $\mathbb{Z}_{4}$ (you need to add it to itself $4$ times to get to $0$). However, every element of $\mathbb{Z}_{2} \times \mathbb{Z}_{2}$ has order at most $2$. For example, $(1,0) + (1,0) = (2,0) = (0,0)$, or $(1,1) + (1,1) = (2,2) = (0,0)$.
What IS true is that $\mathbb{Z}_{pq} = \mathbb{Z}_{p} \times \mathbb{Z}_{q}$ for distinct primes $p$ and $q$. The same thing holds if you replace $p$ with $p^n$ and $q$ with $q^k$. This actually encapsulates the entire pattern: you can split up $\mathbb{Z}_{ab}$ into $\mathbb{Z}_{a} \times\mathbb{Z}_{b}$ if and only if $a$ and $b$ are coprime, i.e. having no prime factors in common.