Prove that there's a multiple of 1997 which has only ones in its decimal expansion

232 Views Asked by At

A problem from an exercise book on the Pigeonhole Principle

Prove that there's a multiple of 1997 which has only ones in its decimal expansion.

My progress

As there are infinite number of such numbers, we can pick up $1998$ of them and according to the Pigeonhole principle there will be at least two of them that are equal modulo $1997$. We can take their difference and it will be of a form

111...1 (r "1"'s)
-
  1...1 (s "1"'s)
-------
110...0 (r - s "1"'s, s "0"'s)

This yields a multiple of $1997$ which consists of $1$'s and $0$'s in its decimal expansion.

I also checked that there's such a number with a brute force search in a Python script

s = 1
x = int("1" * s)
while x % 1997 != 0:
    s += 1
    x = int("1" * s)

which yielded the answer 998. So it's the number $11\dots1$ (998 $1$'s) that is a multiple of 1997.

This doesn't show the existence of a proof, of course.

3

There are 3 best solutions below

1
On

Since $1997$ is prime, Fermat's Theorem tells us $10^{1996} \equiv 1 \pmod{1997}$. In other words, $1997$ divides $(10^{1996} - 1)/9$.

0
On

You could divide your multiple of $1997$ that consists of $r-s$ $1$'s and $s$ $0$'s in its decimal expansion by $10^s$ to get a multiple of $1997$ that consists of $r-s$ $1$'s.

Since $1997$ does not divide $10^s$, $1997$ divides the number consisting of $r-s$ $1$'s.

0
On

Your pigeonhole principle proof is almost complete--you just need to note that if you remove the trailing zeros, you get a number that is still divisible by 1997.