Find the number of prime numbers which does not have any multiple that only contains the digit $1$

89 Views Asked by At

A number theory contest (ITMO) problem:

Find the number of prime numbers which does not have any multiple that only contains the digit $1$.

I really do not know how to do it the only thing i could do is guess work and i find only two prime numbers $2$ and $5$ satisfying the condition so the answer $2$ . Is the answer correct? Also please tell if there is any logical approach to get the answer and eliminate others. Thank you

1

There are 1 best solutions below

0
On BEST ANSWER

Let $p$ be a prime that is not $2,3$ or $5$. Then by Fermat's theorem, $p$ is coprime to $10$ so $p$ is a divisor of $10^{p-1} - 1$, which is the number $\underbrace{999...999}_{p-2 \text{ times}}$. Since $p$ is coprime to $9$ as well, it follows that $p$ divides $\underbrace{111...111}_{p-2 \text{ times}}$ and hence has a multiple with only digit $1$.

It remains to check only $2,3,5$, but $111$ is a multiple of $3$ and we know the divisibility tests for $2$ and $5$ via last digit, so we are done.

Note : You don't need Fermat's theorem for showing that $p \neq 2,5$ has a multiple which has only ones : indeed, considering the integers $1,11,...,\underbrace{111...111}_{ \text{ p times}}$ gives us $p$ distinct integers. If one is a multiple of $p$ we are done, else two of them leave the same remainder modulo $p$ and the difference of these two with zeros stripped is a multiple of $p$ with only digit one.