For some n there is only one group of that order: the cyclic group. For
example, if n is prime or n = 15, 33, 35, ... there is only a cyclic
group of order n. The precise rule for these values is that n is a
product of different primes p_1* p_2* ... etc. such that for each i and
j, p_i does not divide (p_j) - 1. For example, 15 = 3*5 and 3 does not
divide 5-1 and 5 does not divide 3-1.
Moreover if n is a square of prime then all groups of that order are
abelian (but not all cyclic) and there is a general criterion, similar
to the one for cyclic groups but allowing squares of primes to appear,
which determines when all groups of order n are abelian.
On the other hand for some values of n it is easy to wrote down a
nonabelian group. The simplest examples are the dihedral groups of order
2*m where m > 2. These can be generated as permutation groups on {1,2,
..., m} by the two permutations (1, 2 ,... ,m) and (2, m)(3,
m-1)...(k,m-k+2) where k =: <.(1+m)%2. For example, for n = 12 = 2*6 we
have the generators (1 2 3 4 5 6) and (2 6)(3 5).
It is possible to describe nonabelian groups for other classes of n but
I do not know of any general formula which covers all cases.
John Dixon
On 2011-12-16 9:28 AM, Roger Hui wrote:
> Does anyone know a way to generate a non-abelian group with order m?
>
> I can generate non-abelian groups, e.g. multiplication of non-singular
> boolean matrices, or the group generated by a bunch of permutations, but I
> need a group of size m when I am given the m.
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm