TITLE: Conjugacy classes of non-Abelian group of order $p^3$
QUESTION [13 upvotes]: Let $G$ be a non-abelian group of order $p^3$. How many are its
conjugacy classes?
The conjugacy classes are the orbits of $G$ under conjugation of 
$G$ by itself. Since $G$ is non-abelian, its center has order $p$.
So the class equation yields
$p^3 = p + \sum_{[x]} (G: G_x)$, where $G_x$ is the centralizer of $x$
and the sum is taken over disjoint orbits $[x]$. We can also see that
$(G:G_x)$ can only be $p$ or $p^2$. So we will have $p$ orbits of length
$1$ and then orbits of length $p$ and $p^2$. Any hints on determining the
number of the latter?

REPLY [3 votes]: One can break it up into 3 steps. First, show that $|Z(G)|$ is equal to p. Second, show that if $a$ is not in $Z(G)$ then $|N_G(a)|=p^2$. Finally, the last step is to use the class equation to show that there are $p^2+p-1$ conjugacy classes.