Let $ R(n) = \underbrace{111\ldots111}_{\text n\ ones}$. Prove that if a prime number $ p \neq 3 $ divides $ R(n) $ then $ n $ and $ p - 1 $ are not coprime.
So obviously $ R(n) = \frac{10^n - 1}{9}$. Now if $ p $ divides $ R(n) $ then
$$ \frac{10^n - 1}{9} \equiv 0 \pmod p $$
which implies
$$ 10^n - 1 \equiv 0 \pmod p $$
$$ 10^n \equiv 1 \pmod p $$
Can we deduce from there that $ GCD(n, p - 1) \neq 1 $? How? Also, why is $ p \neq 3 $ requirement necessary? I suppose "multiplying both sides" by $ 9 = 3^2 $ is somehow relevant, but I'm not sure why... it's not diffucult to come up with a counterexample for $ p = 3 $ case, but I don't know how the proof would account for it.
Use little Fermat $10^{p-1} \equiv 1\bmod p$