# On the existence of non-abelian finite groups

Is it true that for any $n\in \mathbb{Z}$ with $n\geq 6$ and $n$ not a prime there exists a non abelian group of order $n$? How can we prove it?

If the answer to the above is negative is it maybe true that there are for any $p$ prime and $n$ positive integer grower than $3$ a non abelian group of order $p^n$?

-
A silly comment: 9 is a counterexample to the first, but you seem to know that already based on your second question. The criteria for $n$ is explained at math.stackexchange.com/a/67469/583 – Jack Schmidt May 9 '14 at 0:18
Every group of order $p^2$ is abelian! I forgot it! – W4cc0 May 9 '14 at 8:53

Every group of order $15$ is cyclic, and you can see a proof here. In fact, more generally, it's a relatively easy exercise applying Sylow's theorems to show that if $|G| = pq$ with $p < q$ distinct primes for which $p \nmid q - 1$, then $G$ is cyclic.
To address the second question, note that the Heisenberg group gives a way to construct a non-abelian group of order $p^3$ for any prime $p$. Then for order $p^n$, just take a direct product with any group (abelian or not) of order $p^{n - 3}$.
The answer to the $p^{n }$ part of the question is positive. If $p$ is a prime number, and $n$ is an integer greater than $2,$ then there is a non-Abelian $p$-group of order $p^{n}.$ The easiest way to see this is to do the case $n = 3$ and then take the direct product of a cyclic group of order $p^{n-3}$ with a non-Abelian group of order $p^{3}.$ If $p =2,$ we can take a dihedral or quaternion group of order $8.$ If $p$ is odd, we can take the group $P = \langle x,y : x^{p} = y^{p} = [x,y,x] = [x,y,y] = 1 \rangle,$ which is non-Abelian of order $p^{3}.$