Question:
Let $p$ be any prime and $n \geq 3$. Show that there exists a non-abelian group of order $p^n$.
Attempt:
Take $n = 3$. Writing $\mathbb Z_p \times \mathbb Z_p = \{e, \alpha_1, \ldots, \alpha_{p^2 - 1}\}$ and considering $$\begin{align}\tau_{jk} : \mathbb Z_p \times \mathbb Z_p&\to \mathrm {Aut} (\mathbb Z_p)\,\\e &\mapsto id\\\alpha_j &\mapsto id \\\alpha_i &\mapsto \rho_k \end{align}$$
$\forall i \neq j$ where $\rho_k : \mathbb Z_p \to \mathbb Z_p$ is such that $\rho_k (1) = k$, with $k \in \{2, \ldots, p-1\}$. Then we take the group $(\mathbb Z_p \times \mathbb Z_p) \ltimes_{\tau_{jk}} \mathbb Z_p$.
Then $$(\alpha_i , 2) \ltimes_{\tau_{jk}} (\alpha_i, 1) = (2\alpha_i, 1 + \tau_{jk} (\alpha_i)(2)) = (2\alpha_i , 1 +2 k)$$
and $$(\alpha_i , 1) \ltimes_{\tau_{jk}} (\alpha_i, 2) = (2\alpha_i, 1 + \tau_{jk} (\alpha_i)(2)) = (2\alpha_i , 1 +k)$$
taking $k = 1$ for example we have that the group $(\mathbb Z_p \times \mathbb Z_p) \ltimes_{\tau_{jk}} \mathbb Z_p$ is not abelian.
I was wondering if this is a good aproach. If not, is there an easier way to reach the result?
If this is the "best" way then would the higher cases ($n > 3$) be more of a notation play game?
Take a vector space over the field of order $p$ of dimension $n-1$ and take the semidirect product with $\mathbb Z_p$. If you can use the fact that the order of the general linear group is divisible by $p$, you can use Cauchy's theorem to see that we can map a generator to a matrix of multiplicative order $p$ without even having to explicitly construct one.