$$(x^n-1)=(x-1)(x^{n-1}+x^{n-2}+\cdots +x+1)$$ so $$(10^n-1)=3 \times 3 \times (10^{n-1}+10^{n-2}+\cdots +10+1)$$ This is really saying for example $$10000000000 - 1 = 9999999999 = 3\times 3333333333 = 3\times 3 \times 1111111111$$ and it does not matter how many repeated digits are involved