Prove that every prime except for $2$ and $5$ is a factor of some number of the form $111\dots1$

589 Views Asked by At

How do we prove that for every prime $p\neq2,5$ there exists a positive integer $n$ such that $(10^n-1)/9$ is divisible by $p$?

BTW, I suspect that it holds not only in base $10$, but also in every other base $b$, for every prime which is not a factor of $b$.

My work so far - not much, except for manually testing the first few numbers of the form $111\dots1$:

  • $11=11$
  • $111=3\cdot37$
  • $1111=11\cdot101$
  • $11111=41\cdot271$
  • $111111=3\cdot7\cdot11\cdot13\cdot37$
  • $1111111=239\cdot4649$
  • $11111111=11\cdot73\cdot101\cdot137$

Thanks

1

There are 1 best solutions below

1
On BEST ANSWER

Fermat's theorem for prime $p\ne2,5$ implies $10^{p-1}-1\equiv0\pmod p$ as gcd$(10,p)=1$ in this case. Now factor out $9$ from $10^{p-1}-1$, you have what you want for $p\ne3$. For 3 you have already shown it.