non-abelian groups of prescribed order Is there a construction that will give a non-abelian group of order $p^mr$ where $p$ is a prime, $r$ and $p$ are relatively prime and $m$ is an arbitrary non-negative integer? I suspect in this generality there is no simple construction so feel free to restrict $m$ and $r$. 
I'm reading some notes on group theory and so far I've only seen the group $G=SL(2,p)$ which has order $p(p+1)(p-1)$. This is great because it gives me a class of groups to play with and test out the various theorems. It is a little annoying to have all these theorems and no concrete non-trival examples to test them out on to see all the subtleties since for the abelian groups all these theorems reduce to saying something trivial.
Edit: Mariano makes a good point and I'm not sure how to rule out silly examples like $G\times\mathbb{Z}_p^{m-3}\times\mathbb{Z}_r$. These aren't bad per se but what matters for me is an explicit description of $G$, the non-commutative part, so I have some hope of carrying out some calculations. In essence what I would really like is a construction that parametrizes the non-commutative part depending on all the parameters. In Mariano's example the non-commutative part has no dependence on $m$ and this simplifies the structure of the resulting group.

Thanks for the examples and references. This gives me a lot more concrete stuff to work with. Now hopefully I can work out some of the reasons for the various assumptions used in the proofs.
 A: This does not answer your question but may be quite useful anyways: there are much worse things you can do than learn how to use GAP, which, among many marvels, has a library of all (!) groups of small order, and lets you construct the 'usual' groups, do operationx with them, &c, &c.
A: I think you can generate what you're looking for using the Wreath Product. The linked Wikipedia article is fairly well written and includes some examples, so I won't duplicate everything. 
If G is any group and H is any subgroup of the permutation group on n elements, then the wreath product of G with H has order $|G|^n |H|$. Multiplication works by using elements of H to permute n copies of G. The result is non-commutative as long as H is non-commutative. You can take, e.g., |G|=p, H any non-commutative order r subgroup of the symmetric group on m elements. This imposes some relations between r and m, but there's plenty of non-trivial examples to play with. In fact, a lot of interesting examples of groups can be expressed as wreath products of smaller groups.
Also note that by Cayley's Theorem, every group of order r is a subgroup of the symmetric group on r elements (and the group multiplication tells you how it acts to permute its own elements). So if you take m=r you can use any non-commutative group H you like.
A: Given p and r:  Pick your favorite group $G$ of order $r$.  It has a faithful transitive action on a set of size $m$ for some $m$, so you can take the semidirect product $\mathbb{F}_p^m \rtimes G$.  Alternately, if $G$ has an interesting automorphism group, pick one of the Sylow $p$-subgroups $H$ of $\text{Aut}(G)$ and you can take the semidirect product $G \rtimes H$.
Given p and m:  The group $GL_m(\mathbb{F}_p)$ contains a (say, Sylow) subgroup $G$ of order relatively prime to $p$, so again you can take the semidirect product $\mathbb{F}_p^m \rtimes G$.  
A: If $m$ is big, you get a large family of nonabelian unipotent algebraic groups over $\mathbb{F}\_p$, and these yield the nonabelian p-groups.  The standard examples include the group of $k \times k$ upper triangular matrices with ones along the diagonal and entries in $\mathbb{F}\_p$ for $k \geq 3$, and subgroups like Heisenberg (whose elements are nonzero in a hollow upper triangle).  By a theorem of Sims (1965), as $m$ grows large, most isomorphism types will end up being 3-step nilpotent, with exponent $p^3$ (i.e., not of the specific matrix form I specified).  You can ask for a group of order $r$ to act on such a group by automorphisms, and you get a semidirect product.
You also might want to consider central extensions of $p$-groups by abelian groups of order $r$.  There can be interesting homological calculations there.
A: I am also unsure of what "nontriviality" conditions you want to impose.  Without any further conditions, the following answers your question:
Call a positive integer $n$ nilpotent if every group of order $n$ is nilpotent.
Call a positive integer $n$ abelian if every group of order $n$ is abelian.
Suppose that the prime factorization of $n$ is $p_1^{a_1} \cdots p_r^{a_r}$.  Then:

*

*$n$ is nilpotent iff for all $i,j,k$ with $1 \leq k \leq a_i$, $p_i^k \not \equiv 1 \pmod{p_j}$.


*$n$ is abelian iff it is nilpotent and $a_i \leq 2$ for all $i$.
These results are proved in

Pakianathan, Jonathan(1-WI); Shankar, Krishnan(1-MI)
Nilpotent numbers.
Amer. Math. Monthly 107 (2000), no. 7, 631--634.

The proofs are constructive: for any $n$ which is not nilpotent (resp. abelian), they give an explicit group of that order which is not nilpotent (resp. abelian).
The paper is available at
http://alpha.math.uga.edu/~pete/nilpotentnumbers.pdf
