Prime dividing repunit 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.
 A: Use little Fermat $10^{p-1} \equiv 1\bmod p$
A: Theorem(1): 
Let $m$ and $a$ be two integers; 
such that $\gcd(a,m)=1$.
Then there exists a natural number $r$ such that $a^{r} \overset{m}{\equiv} 1$.
The least positive integer $r$ by the above property 
will be called the order of $a$ module $m$;
and we will denote it by $\text{ord}_m(a)$.
Theorem(2): 
Let $m$ and $a$ be two integers; 
such that $\gcd(a,m)=1$.
Suppose that $a^R \overset{m}{\equiv} 1$; then we can conclude that: 
$$\text{ord}_m(a) \mid R \ \  .$$


Remark(I): 
Let $p\neq3$ (also $p\neq2$ and $p\neq5$ ) be a prime number; 
then $1 < \text{ord}_p(10)$.
proof: Suppose on contrary that $ \text{ord}_p(10) = 1$; 
then we must have:
$$ 
10^1 \overset{p}{\equiv} 1 
\Longleftrightarrow p \mid 10-1 
\Longleftrightarrow p =3; $$ 
which has an obvious contradiction with our assumption.

Remark(II): 
By little Fermat's theorem we know that 
$$10^{p-1} \overset{p}{\equiv} 1 ;$$ 
now Theorem(2) implies that $\text{ord}_p(10) \mid p-1$.
Remark(II): 
From the assuptuion of the question we know that 
$$10^{n} \overset{p}{\equiv} 1 ;$$ 
now Theorem(2) implies that $\text{ord}_p(10) \mid n$.


By the last two remarks we can conclude that: 
$$1 < \text{ord}_p(10) \mid \text{gcd}(n, p-1).$$
