Abelian and non-abelian group where $a^{3} = e$? I was asked to find a group where $a^{3} = e$ $ \forall a \in G$, G being the group. I came across the Heisenberg group(which from my understand is the group of all $3 \times 3$ matrices which has one along its diagonals and 0s in the bottom half, and real numbers in the top half). But when I multiplied such a matrix by itself 3 times, I did not land up with the identity matrix.
Can someone help me if my definition of Heisenberg group is wrong, and with helping me find abelian and non-abelian groups where if the elements are cubed, we get the identity?
 A: The original Heisenberg group is the group you describe: the $3\times 3$ matrices of the form
$$\left(\begin{array}{ccc}
1 & a & c\\
0 & 1 & b\\
0 & 0 & 1
\end{array}\right)\tag{1}$$
with $a,b,c\in\mathbb{R}$, which form a group under the usual matrix multiplication.
However, there is a generalization, and they are all generally known as "the Heisenberg group", and one is supposed to know which by context. Given any field $F$ (for example, the rationals, the complex numbers, the reals, the algebraic numbers, or a finite field of order $p$), you consider the matrices of the form $(1)$, but where now $0$, $1$, and $a,b,c$ are taken in the field $F$.
You should verify that these matrices form a group. In particular, if you take the entries in $\mathbb{F}_3=\mathbb{Z}/3\mathbb{Z}$, the integers modulo $3$, you obtain a nonabelian group of order $27$. (In general, taking them in $\mathbb{Z}/p\mathbb{Z}$ gives you a nonabelian group of order $p^3$). You should verify that it has the property you want.
A: $\mathbb{Z}_{3}$
$\mathbb{Z}_{3} \oplus\mathbb{Z}_{3}$
$\underbrace{\mathbb{Z}_3\oplus\cdots\oplus\mathbb{Z}_3}_{n\text{ factors}}$
All are examples of abelian groups whose every non identity element has order 3.
What you have mentioned, Heisenberg Group has order $27$.
it is collection of all upper triangular matrices with diagonal
entries 1 (entries of upper half comes from integer modulo 3 ($\mathbb{Z}_3$).
