P-group with abelian centralzer I will be so thankful if someone help me about the following question.
I need to know the presentation of a (if it is possible) family of finite non-abelian $p$-group $G$ with the follwing properties:
1- all non-central element have abelian centralizer.
2- $cs(G)$ has at least three integer, where by $cs(G)$ I mean the set of all conjugacy class sizes of $G$. 
 A: The dihedral groups of order $2^n$ (with $n \geq 4$) form such a family.
Indeed, for such a group, we have
$$\operatorname{cs}(G) = \{ 1, 2, 2^{n-2} \} , $$
and they do have the required property that each non-central element has an abelian centralizer.
Added.
Here is another class of examples for arbitrary $p$, still with $\lvert\operatorname{cs}(G)\rvert = 3$ however.
Let $N$ be an arbitrary abelian $p$-group admitting a non-trivial action of $C_p$ (the cyclic group of order $p$), and let $G$ be the semidirect product
$$ G = N \rtimes C_p .$$
Then I claim that all non-central elements of $G$ have abelian centralizer, and that
$$\operatorname{cs}(G) = \{ 1, p, [N:Z(G)] \} . $$
There are three types of elements:


*

*elements $g \in Z(G)$. They necessarily lie in $N$.

*elements $g \in N \setminus Z(G)$. Such an element has conjugacy class of size at least $p$, but on the other hand these elements are of course centralized by $N$, so $C_G(g) = N$ and $\lvert g^G \rvert = p$.

*elements $g \in G \setminus N$. Notice that for such an element, $g^p \in Z(G)$. In this case, $C_G(g) = \langle g, Z(G) \rangle$, which is an abelian group of order $p \cdot \lvert Z(G) \rvert$. Hence the conjugacy class $\lvert g^G \rvert$ has size $[N: Z(G)]$ in this case.
An example of such groups is the wreath product $C_{p^n} \wr C_p$, but of course there are many more examples of this type.
A: Consider $p$-groups of maximal class with abelian subgroup of index $p$, and order at least $p^4$ (to satisfy second condition in question)
$C_p\wr C_p$ is one such group, but order of this (these) group(s) is(are) bounded by $p$, whereas, $p$-groups of maximal class, of order $p^n$, with abelian subgroup of index $p$, exists for all $p$ and all $n\geq 3$; the book of Leedham-Green and S. McKay has an interesting example (see link, Ex. 3.1.5, p. 53)
