EulerFermatTheorem Difficult

Problem - 4212

Show that there are infinite many composite numbers in the sequence $$1, 31, 331, 3331, 33331, \cdots$$


Because $31$ is a prime, by Fermat's little theorem, we have $10^{30}\equiv 1\pmod{31}$. Therefore, for any positive inter $k$, we have $10^{30k}\equiv 1\pmod{31}$.This means that $$\frac{1}{3}\times\left(10^{30k}-1\right)\equiv 0\pmod{31}$$

Obviously, $(10^{30k} - 1)=\underbrace{33\cdots 3}_{30k}$. It follows that $$\underbrace{33\cdots 3}_{30k} \times 100 + 31 = \underbrace{33\cdots 3}_{30k}31$$ is a multiple of $31$. Clearly, there are infinite many items in this form in the given sequence.

report an error