TITLE: What finite non-abelian group is generated by $\operatorname{diag}(1,w,w^2,\ldots,w^{N-1})$ (with $w=e^{2\pi i/N}$) and a cyclic permutation matrix?
QUESTION [7 upvotes]: What is the finite nonabelian group? generated by the following elements and satifies the rules:

$$A=\left(\begin{array}{ccccc}
1&0&0&\cdots&0\\
0&\omega&0&\cdots&0\\
0&0&\omega^2&\cdots &0\\
\vdots&\vdots&\vdots& &\vdots\\
0&0&0&\cdots&\omega^{N-1}
\end{array}\right)$$ where $\omega^{N}=1$ and $\omega = e^{2\pi i/N}$. 
$$B=\left(\begin{array}{ccccc}
0&1&0&\cdots&0\\
0&0&1&\cdots&0\\
 \vdots&\vdots &\vdots & \ddots &\vdots\\
0&0&0&\cdots&1\\
1&0&0&\cdots&0
\end{array}\right)$$
$$AB=\omega \;BA$$ (or $AB=\omega^{-1} \;BA$)


It looks like this nonabelian group has an order $N^3$ at least. Because
$$
A^N=B^N=\omega^N=1,
$$
and all elements of these are distinct.
When $N=2$, the answer of this  nonabelian group seems to be a quaternion group of order $2^3=8$.

REPLY [4 votes]: The group $G = \langle A,B \rangle$ generated by $A$ and $B$ has order $N^3$ for all $N>1$.
There are $N$ conjugates $A_i = A^{B^i}$ $(0 \le i < N)$ of $A$ under powers of $B$, but $A_iA_{i-1}^{-1} = \omega I_n$, so the $A_i$ generate the group $N = \langle A,\omega I_n \rangle$, which has order $N^2$. Then $N \lhd G$ and $G/N$ is generated by the image $BN$ of $B$ and is cyclic of order $N$.
This is a nilpotent group of class $2$ with $Z(G) = [G,G] = \langle \omega I_n \rangle$.