Three is enough.
First we have that
$$
a^{i+2} b^{i+2} = (ab)^{i+2} = (ab)^{i+1} (ab) = a^{i+1} b^{i+1} ab,
$$
that is,
$$ a^{i+2} b^{i+2} = a^{i+1} b^{i+1} ab, $$
implying that
$$ a b^{i+1} = b^{i+1} a,$$
meaning that $i+1$ powers commute with all elements.
Now,
$$
a^{i+2} b^{i+2} = (ab)^{i+2} = (ab)^{i} (ab)^2 = a^i b^i (ab)^2 = a^i b^i (ab)(ab) = a^i b^i ab ab ,
$$
that is,
$$ a^{i+2} b^{i+2} = a^i b^i a b a b, $$
from which it follows that
$$ a^2 b^{i+1} = b^i a b a.$$
Reorder the terms on the LHS and conclude
$$ b^{i+1} a^2 = b^i a b a, $$
so that
$$ b a = ab, $$
as required.