TITLE: Groups for which the $n$-power map is a homomorphism
QUESTION [21 upvotes]: Let $\mathcal{V}_n$ be the collection of all groups satisfying $(ab)^n=a^nb^n$ for all $a,b$.
In particular $\mathcal{V}_1$ consists of all groups and $\mathcal{V}_2$ consists of all abelian groups, and is contained in $\mathcal{V}_n$ for all $n$. 

For which coprime integers $n,m$ is $\mathcal{V}_n\cap\mathcal{V}_m$ reduced to abelian groups?

REPLY [28 votes]: I assume $m,n>1$. 
(Edited for readability)
A group is said to be "$n$-abelian" if $(xy)^n=x^ny^n$ for all $x,y\in G$. Following the question, let $\mathcal{V}_n$ denote the variety of all $n$-abelian groups, and let $\mathcal{A}b$ denote the variety of all abelian groups.
The structure of $n$-abelian groups was determined by Alperin: they are the homomorphic images of subgroups of direct products of an abelian group, a group of exponent $n$, and a group of exponent $n-1$.
On the other hand, given a group $G$ we define the "exponent semigroup of $G$" to be
$$\mathcal{E}(G) = \{n\in\mathbb{Z}\mid (xy)^n=x^ny^n\text{ for all }x,y\in G\}.$$
This is a multiplicative semigroup of the semigroup of integers under multiplication. Its structure was determined by F.W. Levi, and also by Luise-Charlotte Kappe. The latter also explored the related concepts of $n$-Levi groups (groups for which $[x^n,y]=[x,y]^n$ for all $x,y\in G$) and $n$-Bell groups (groups for which $[x^n,y]=[x,y^n]$ for all $x,y\in G$). The structure of the semigroup of $n$s for which a given $G$ is an $n$-Levi (resp. an $n$-Bell) group is the same as for the exponent semigroup. 
Kappe defines a Levi system to be a subset of the integers that satisfies the following five conditions:

$n,m\in W$ implies $nm\in W$.
$n\in W$ implies $1-n\in W$.
$0\in W$.
There exists $w\in W$, $w\gt 0$, such that for all $n\in W$, $n^2\equiv n\pmod{w}$ and every integer congruent to $n$ modulo $w$ is in $W$.
If the congruence classes of both $n$ and $n+1$ modulo $w$ lie in $W$, then $n\equiv 0\pmod{w}$.

Kappe proves that a subset of the integers is $\mathcal{E}(G)$ for some $G$ if and only if it is $\{0,1\}$, or is a Levi system. 
We can drop $\gcd(m,n)=1$ from the hypotheses. The answer to the question is:

Theorem. Let $m,n>1$. Then $\mathcal{V}_n\cap\mathcal{V}_m=\mathcal{A}b$ if and only if $\gcd(n^2-n,m^2-m)=2$. 

Note that $2$ divides $n(n-1)$ and $m(m-1)$, so the gcd is at least two. 
Proof. If $p>2$ is an odd prime that divides $\gcd(n^2-n,m^2-m)$, then a nonabelian group of exponent $p$ is both $n$-abelian and $m$-abelian. Similarly, if $4$ divides $\gcd(n^2-n,m^2-m)$, then a nonabelian group of exponent $4$ is both $n$-abelian and $m$-abelian (since $2$ will divide either $n$ or $n-1$, but not both, and likewise $m$ or $m-1$, but not both). So the condition is necessary.
Conversely, assume $\gcd(n^2-n,m^2-m)=2$, and let $G\in\mathcal{V}_n\cap\mathcal{V}_m$. Then $n,m\in\mathcal{E}(G)$, so the latter is not just $\{0,1\}$, and hence must be a Levi system. Let $w$ be the positive integer guaranteed by property 4. Then $n^2\equiv n\pmod{w}$ and $m^2\equiv m\pmod{w}$, hence $w=1$ or $w=2$.
If $w=1$, then because $n\equiv k\pmod{1}$ for all $k$, it follows that $\mathcal{E}(G)=\mathbb{Z}$, so $G$ is abelian. If $w=2$, then $2\in\mathcal{E}(G)$, so $G$ satisfies $(xy)^2=x^2y^2$, a condition well known to imply that $G$ is abelian. Thus, $G\in\mathcal{A}b$ in either case. $\Box$
I note that Theorem 2 in Kappe's paper also gives this result. Given a subset $T$ of integers that includes $0$ and $1$, and such that if $m,n\in T$ then $k(n^2-n)+m\in T$ for all integers $k$, the theorem provides several conditions equivalent to $T=\mathbb{Z}$. One of them is the existence of a subset $U$ of $T$ such that $\gcd(n^2-n\mid n\in U)=2$. Since $\mathcal{E}(G)$ always satisfies these conditions, it follows that $m,n\in\mathcal{E}(G)$ and $\gcd(m^2-m,n^2-n)=2$ implies $\mathcal{E}(G)=\mathbb{Z}$, and hence $G$ is abelian.
References.

Alperin, J.L. A classification of n-abelian groups.
Canad. J. Math. 21 1969 1238–1244. MR0248204 (40 #1458)
Kappe , L.C. On n-Levi groups. Arch. Math. (Basel) 47 (1986), no. 3, 198–210. MR0861866 (88a:20048)
Levi, F.W.  Notes on group theory. VII. The idempotent residue classes and the mappings $\{m\}$. J. Indian Math. Soc. (N. S.) 9, (1945). 37–42. MR0016414 (8,13d)