How can one know how many possible abelian and non abelian group be formed from a given number of elements Suppose that $G=\{a_1,a_2,...,a_n\}$ and how many abelian and non abelian group can be formed from this $n$ element?
Attempts : I have tried consider the simple case. when n=2, there is only 1 possible which is abilean. For n=3, there are also only 1 abilean group exist. But when $n$ come to a bigger integer like $10$ or even $n$ in general, is there any way to determine the possible group can be formed from a given number of $n$
 A: For abelian groups, we know that the group must be the product of cyclic groups, and this allows us to obtain a fairly explicit formula.  If $n=p_1^{a_1}\ldots p_m^{a_m}$ is the prime factorization of $n$, and if $p(a)$ is the number of partitions of $a$, then the number of abelian groups of order $n$ is
$$\prod_{i=1}^mp(a_i)$$
In general, if we try to count all groups of a specific order, this is a very difficult question, although there are results for specific $n$.  For example, if $n$ is prime, there is only one group, or if $n$ is the square of a prime there are only $2$ groups, and both are abelian.  If $n=2^k$, then the number of groups of order $k$ is roughly
$$2^{\frac{2}{27}k^3+O(k^{\frac{8}{3}})}$$
For example, there are $49487365422$ groups of order $1024$.  If $n=pq$, with $p<q$ and $p\not\mid q-1$, then there is only one group of order $n$.
So there is no explicit formula for the number of groups of order $n$, and there is not much hope of obtaining one unless we specify something about the prime factorization of $n$.  Even in that case, the problem is very difficult.
