# Infinitely many positive integers of the form $1998k+1$ such that all digits in their decimal representation are equal

Prove that there exist infinitely many positive integers of the form $1998k+1, k \in \mathbb{N},$ such that all digits in their decimal representation are equal.

We need to find integer solutions to $a \cdot \dfrac{10^n-1}{9} = 1998k+1$. Thus $$a(10^n-1) = 9(1998k+1).$$ How can we find infinitely many integer solutions to this?

• @mdave16 more like $1998 = 2\times 3^3\times 37$ Jun 15, 2017 at 23:53
• while $a$ lives between $1$ and $9$, there are infinitely many values for $n$, but using the factorisation, you can figure out what values of $a$ work. @user19405892 Jun 15, 2017 at 23:56
• Let's use $111...11$. We need $111...10$ to be divisible by $1998=2\times 3^3\times 37$. Let us assume that the number of $1$ in $111...10$ is multiple of 4. Since $1000 = 1$ both mod 27 and mod 37 then $111...10$ is equal to $1111m$ mod both $27$ and $37$, where $m$ is the number of blocks of 1111 in the number. If we take m to be multiple of both 27 and 37 then 111...10 will be multiple of both 27 and 37, as well as 2.
– OR.
Jun 16, 2017 at 0:25
• @MlazhinkaShungGronzalezLeWy Quick check, $11110 \not\equiv 1111\pmod{27}$ and $111111110 \not\equiv 2222\pmod{37}$. Jun 16, 2017 at 0:39
• @peterwhy 11110 has only one block of 1111, so (m=1). 1 is not multiple of 27
– OR.
Jun 16, 2017 at 0:42

Credit of the full answer to Mlazhinka Shung Gronzalez LeWy.

Let $N = 10^{3n} - 1 = 999\ldots 9$. By factorisation, $N$ is a multiple of $999$, and the other quotient is $$\frac{10^{3n}-1}{10^3-1} = 10^{3(n-1)}+ \cdots + 10^6 + 10^3+1.$$

I further would like the quotient be a multiple of $9$, so that $N$ is a multiple of $999\times 9$. Since $10\equiv 1\pmod 9$, the right hand side

$$10^{3(n-1)}+ \cdots + 10^6 + 10^3+1 \equiv n \pmod 9$$

So $n$ can be any multiple of $9$, i.e. $N = 10^{27m}-1$. Let \begin{align*} M = \frac N9 &= \frac{10^{27m}-1}{9}\\ 10M &=\frac{10^{27m+1}-1}{9}-1 \end{align*}

$M$ is a multiple of $999$, and so $10M$ is a multiple of $999$, and so

$$\frac{10^{27m+1}-1}{9}\equiv 1 \pmod{999}$$

But the left hand side is just $10^{27m} + 10^{27m-1} + \cdots + 10^2+10^1+10^0$, which is odd, $$\frac{10^{27m+1}-1}{9}\equiv 1 \pmod{2}$$

By Chinese remainder theorem, $$\frac{10^{27m+1}-1}{9}\equiv 1 \pmod{1998}$$

Let $a_t$ be a number whose decimal expansion has $t$ $1$ digits, e.g. $a_7=1111111$. Note that for $i>j$, $a_i-a_j=a_{i-j}*10^j$, e.g $a_5-a_2=11111-11=11100=a_3\times 10^2$.

Proposition: Let $n=2m$ where $m$ is any odd number not divisible by $5$. Then among the numbers $nk+1$, k=1,2,3,... there are infinitely many $a_t$ numbers.

For $m=999, n=1998$ this proposition answers the question.

Proof: The set of remainders of the numbers $a_t$ by $m$, $$R=\{a_t \mod m : t=1,2,3,...\}$$ is a finite set (whose cardinality is at most $m$), and so there exists $T$ such that $$R=\{a_t \mod m : t=1,2,3,..,T \}$$ Now take the numbers $a_{2T},a_{3T},a_{4T},..$. For each $a_{iT}$ there exists $a_{s_i}$, $1<=s_i<=T$, such that $a_{iT} \equiv a_{s_i} \mod m$. Therefore $m$ divides $a_{iT}-a_{s_i}$. But $$a_{iT}-a_{s_i}=a_{iT-s_i} \times 10^{s_i}$$ Since neither $2$ nor $5$ divide m, it follows that m divides $a_{iT-s_i}$, and thus $n=2m$ divides $a_{iT-s_i} \times 10$. So for some $k_i$ $$a_{iT-s_i} \times 10 + 1 = n\times k_i +1$$ But $a_{iT-s_i} \times 10 + 1$ is just $a_{iT-s_i+1}$. So for each $i = 2,3,..$, there exist $s_i \in {1,..,T}$, and $k_i$ such that $$a_{iT-s_i+1} = nk_i + 1$$ Since for any $i \neq j$ we have $a_{iT-s_i+1} \neq a_{jT-s_j+1}$, this proves the proposition.