$(ab)^n = a^{n}b^{n}$ in a unitary ring $A$ implies A commutative? 
Here is my question :
  Let $n\in\mathbb{N}$ and $A$ be a unitary ring such that for all $a, b\in A$, we have $(ab)^{n} = a^{n}b^{n}$. For which value of n, we can affirm A commutative ?


For $n = 2$, I replaced $a$ by $a + 1$ in the identity, then $b$ by $b + 1$ in the new identity obtained for deducing $A$ commutative. I don't know if the same method works for general cases
 A: We may assert that $A$ is commutative when $n=2$. Suppose $(ab)^2=a^2b^2$ for any $a,b\in A$. Then
$$
a[a,b]b=a(ab-ba)b=a^2b^2-(ab)^2=0
$$
for any $a,b\in A$. Hence
$$
a[a,b]=a[a,b](b+1)-a[a,b]b=a[a,b+1](b+1)-a[a,b]b=0
$$
for every $a,b\in A$. In turn,
$$
[a,b]=(a+1)[a,b]-a[a,b]=(a+1)[a+1,b]-a[a,b]=0
$$
for any $a,b\in A$, i.e. $A$ is commutative.
We cannot make the same assertion when $n\ge3$. Pick any fixed $n\ge3$. Then either $n-1$ or $n$ has a prime factor $p>2$. In other words, we must have $n=pk$ or $pk+1$ for some prime number $p>2$. Let $A$ be the set of all $p$-by-$p$ matrices over $GF(p)$ of the form $xI+M$ for some strictly upper triangular matrix $M$. Then $(xI+M)^p=x^pI$. It follows that
\begin{aligned}
&[(xI+M)(yI+N)]^p\\
&=[xyI+(xN+yM+MN)]^p\\
&=(xy)^pI\\
&=(x^pI)(y^pI)\\
&=(xI+M)^p(yI+N)^p\\
\end{aligned}
for every $xI+M,\,yI+N\in A$. Consequently, when $r\in\{0,1\}$,
\begin{aligned}
&[(xI+M)(yI+N)]^{pk+r}\\
&=[(xI+M)(yI+N)]^{pk}[(xI+M)(yI+N)]^r\\
&=(xy)^{pk}[(xI+M)(yI+N)]^r\\
&=(xI+M)^{pk}(xI+M)^r(yI+N)^r(yI+N)^{pk}\\
&=(xI+M)^{pk+r}(yI+N)^{pk+r}.
\end{aligned}
Hence we have exhibited a ring $A$ such that $(ab)^n=a^nb^n$ whenever $a,b\in A$. However, as $p>2$, we have $MN\ne NM$ in general (such as when $M=E_{12}$ and $N=E_{23}$). Therefore our example $A$ is not commutative.
