Which groups satisfy the condition that the square of every element is in the centre of the group? Let $G$ be a group satisfying that $ab^2=b^2a$ for every $a,b\in G$. Equivalently, this means that the square of every element is in the centre $Z(G)$. The following groups are examples:


*

*Every Abelian group satisfies this condition trivially.

*The quatenion group $Q_8$ satisfies this condition.

*The dihedral group $D_8$ satisfies this condition.


Question: Is there a name for the groups that satisfy this condition? What else can we say about such groups? What are other examples of such groups?

One can easily see that such a group is nilpotent of class at most 2. Assuming it's finite, that means that we can write $G=P_2\times P_2′$, where $P_2$ is the Sylow $2$-subgroup. Moreover, one can then easily see that $P_2′$ is abelian, so the question reduces to $2$-groups. You can say a little more, but not much more, because this family of $2$-groups is very large. (I think it's conjectured that almost all $2$-groups (and in fact almost all finite groups) have this property...) 
