2

Find a number in the form of 111...1 (e.g. 111111) that is divisible by 2019. What I thought so far...

I know of Fermat's little theorem, which states following: $a^{p-1}\equiv 1$ for $p \in \mathbb{P} \land a\in \mathbb{Z}$

111...1 (with n 1's) can be written as $\frac{10^n-1}{10-1}$. Unfortunately, 2019 is not a prime.

$\frac{10^n-1}{10-1} = 2019*k$ is also no solution to the problem since there are two variables.

Can anyone give me a hint how to find the solution or at least how to proof that the solution exists? Thanks.

Bill Dubuque
  • 282,220
Quotenbanane
  • 1,604

2 Answers2

3

Let $R_n=\frac{10^n-1}{10-1}$

We know by the pigeonhole principle that there must be positive integers $i<j$ such that $$R_i\equiv R_j\pmod{2019}$$ Choose such $i,j$. Then $$R_{j-i}=\frac{R_j-R_i}{10^i}\equiv0\pmod{2019}$$ since $(10,2019)=1$.

  • Thanks for your answer. Why does the pigeonhole principle say that? What if there is only one $r$ with $111...1 = k*2019+r$ ? And how do you get the $10^i$? – Quotenbanane Nov 30 '19 at 22:10
  • 1
    @Quotenbanane There are only 2019 different remainders available, so eventually there has to be a repeat. Also, if you subtract two different repunits, you are left with 1111...0000 where there are $j-i$ ones followed by $i$ zeroes. –  Nov 30 '19 at 22:12
  • Great explanation. Hope you have a nice day. – Quotenbanane Nov 30 '19 at 22:18
  • +1 for the proof, but this proves the existence of a repunit with the desired property, while the question asks us to find one. Using this method, we have to find $R_i \pmod{2019}$ so it's no better than testing them one-by one. – saulspatz Nov 30 '19 at 22:22
  • @saulspatz True enough. Only half a gold star for me. –  Nov 30 '19 at 22:32
3

Use Euler's theorem, since $\gcd(10,3^3\cdot 673)=1$ then $$10^{\varphi(3^3\cdot 673)}\equiv 1 \pmod{3^3\cdot 673}$$ or $$10^{2\cdot 9 \cdot 672}- 1 =3^3\cdot 673 \cdot k \iff 10^{2\cdot 9 \cdot 672}- 1 =9\cdot 2019 \cdot k \iff \\ \frac{10^{2\cdot 9 \cdot 672}- 1}{10-1} =2019 \cdot k$$

rtybase
  • 17,398
  • 1
    Nice. $2\cdot672=1344$ works as well since we're only really concerned about mod 2019 and is probably the smallest solution. –  Nov 30 '19 at 22:39
  • @MatthewDaly indeed. I skipped these details since the question asks for "find a number" and "proof that the solution exists". – rtybase Nov 30 '19 at 22:42