What are the numbers $n$ such that every group of order $n$ is abelian?
- For every prime $p$, every group of order $p$ or $p^2$ is abelian.
- If there is a prime $p$ such that $p^3\mid n$, then I can take a direct product of a nonabelian group of order $p^3$ with a cyclic group of order $\frac{n}{p}$ and get a nonabelian group.
So, we are left with values of $n$ divisible by more than one prime, but not divisible by $p^3$ for any prime $p$.
For some orders of this type (i.e. $35$) all are abelian, but not for all ofcourse.