For any given $k \geq 1$ what is a non-abelian finite group $G$ of the smallest order that satisfies $\forall g\in G, g^k=e$?
An exercise in an abstract algebra textbook asks the reader to construct such $G$ for $k=3,4$.
These are the answers given by the book:
$G_1=\left\{\begin{pmatrix}1&a&c\\&1&b\\&&1\end{pmatrix}:a,b,c\in GF(3)\right\}$ for $k=3$,
$G_2=\left\{\begin{pmatrix}1&a&d&f\\&1&b&e\\&&1&c\\&&&1\end{pmatrix}:a,b,c,d,e,f\in GF(2)\right\}$ for $k=4$.
It is clear that $G_1$ is the group of the smallest order for $k=3$. However, the dihedral group $D_4$ (i.e., the isometry group of a square) is also a solution for $k=4$ but of a smaller order than $G_2$.
I wonder that for any given $k$, what is $G$ of the smallest order?