How to construct a nonabelian group of order $n\phi (n)$, where $\phi (n)$ is the Euler phi function of n. How to construct a nonabelian group of order $n\phi (n)$, where $\phi (n)$ is the Euler phi function of $n$ for $n \geq 3$. 
I am trying to use the fact that $\alpha : \mathbb{Z}_n^\times \to  \operatorname{Aut}(\mathbb{Z}_n)$ is an isomorphism where $\mathbb{Z}_n^\times$ is the units of $\mathbb{Z}_n$. So we know that $|\mathbb{Z}_n^\times| = \phi (n)$, but I'm not sure where to go from here. 
 A: Hint:
Consider the semi-direct product $\;\mathbf Z_n\rtimes_f\mathbf Z_n^\times$.
A: On a far more elementary level, why not take all linear polynomials $ax+b$, with $a,b\in\Bbb Z/n\Bbb Z$, under composition? Here of course $a$ must be invertible.
A: Pick any prime $p$ such that $p$ does not divide $n$ and $p\not\equiv 1\pmod{n}$. Such a $p$ exists as long as $n\geq 3$. Then $\sigma:\alpha\mapsto p\alpha$ is a nontrivial automorphism of the group $\mathbf{Z}/n\mathbf{Z}$, and the unique homomorphism $\mathbf{Z}\to\mathrm{Aut}(\mathbf{Z}/n\mathbf{Z})$ sending $1$ to $\sigma$ kills the subgroup $\varphi(n)\mathbf{Z}$ because $p^{\varphi(n)}\equiv 1\pmod{n}$. Therefore the homomorphism descends to a nontrivial homomorphism $\Sigma:\mathbf{Z}/\varphi(n)\mathbf{Z}\to\mathrm{Aut}(\mathbf{Z}/n\mathbf{Z})$ satisfying $\Sigma(1+\varphi(n)\mathbf{Z})=\sigma$.
The semidirect product $\mathbf{Z}/n\mathbf{Z}\rtimes_\Sigma\mathbf{Z}/\varphi(n)\mathbf{Z}$ with respect to the homomorphism $\Sigma$ will then be a nonabelian group of order $n\varphi(n)$.
A: The affine group over $\Bbb{Z}/n\Bbb{Z}$ has order $n\phi(n)$, and is the group Lubin described. We have
$$
{\rm Aff}(\Bbb{Z}/n\Bbb{Z})\cong \Bbb{Z}/n\Bbb{Z}\rtimes U(\Bbb{Z}/n\Bbb{Z}).
$$
