In this question it is asked for an example of a group $G$ such that $(ab)^n=a^nb^n$ for all $a, b\in G$ holds for two consecutive integers $n\in\{m, m+1\}$, but $G$ is not an abelian group. The solution is easy: take $m=0$, or even $m=|G|$. I would be interested to see how long these chains can get.
What is the least $k$ such that there exists some integer $n$ and some non-abelian group $G=\langle a, b\rangle$ such that the following holds? $$(ab)^n=a^nb^n, (ab)^{n+1}=a^{n+1}b^{n+1}, \ldots, (ab)^{n+k}=a^{n+k}b^{n+k}$$
Note that if $k=2$ then simply taking $n=-1$ (so the chain $-1, 0, 1$) with $G$ arbitrary doesn't work, as $(ab)^{-1}=b^{-1}a^{-1}$ so if $(ab)^{-1}=a^{-1}b^{-1}$ and $a$ and $b$ necessarily commute. One can also prove that $a^n$ and $b$ commute (and so by symmetry $a$ and $b^n$ commute). Therefore, $|n|>1$ for all $k$.