0

Prove that for any given positive integer $n$,there exists a number having digits $0,1$ which is divisible by $n$.

Let that number be of the general form: $x=\overline {b_kb_{k-1}...b_1b_0}$ where $b_i\in \{0,1\}$.How can we construct $x$ to be divisible by the given $n$?

nonuser
  • 91,557
  • 2
    Try something similar to this https://math.stackexchange.com/questions/2463480/prove-that-every-positive-integer-divides-a-number-such-as-70-700-7770-77000/2463493#2463493 – Donald Splutterwit Dec 01 '17 at 21:11
  • @DonaldSplutterwit Honestly the answer there is so good it makes this a dupe. Just replace $7$ with $1$ and you're done. – orlp Dec 01 '17 at 21:13

3 Answers3

4

Let $$a_k = \underbrace{111...11}_{k} = {10^k-1\over 9}$$

So, among $a_1,a_2,...a_{n+1}$ two must have the same remainder modulo $n$, say $a_i$ and $a_j$ and $i>j$. Thus $$n\mid a_i-a_j ={10^i-10^j\over 9} =10^j{10^{i-j}-1\over 9}= \underbrace{111...11}_{i-j}\underbrace{000...00}_{j}$$

nonuser
  • 91,557
3

Note that $10^{k \, \varphi(n)} \equiv 1,$ where $\varphi$ is the Euler phi function and $k\in \mathbb{N}$, and then see that $$ \sum_{k=1}^n 10^{k \, \varphi(n)} \equiv 0 \pmod n $$ Thus the integer whose decimal expansion has a 1 at positions $k \, \varphi(n)$ for $k=1,\dots,n$ and zeros everywhere else is divisible by $n.$

Alas, this only works if $n$ is relative prime to 10, and needs to be modified otherwise.

0

I complete the answer of Reiner Martin with the following remark:

General case: Using the decomposition of $n$ in prime numbers, write $n = 2^k 5^l n'$, where $n' \wedge 10 = 1$. By the preceding argument, there is a multiple $m' = \sum\limits_{k=0}^{n'-1} 10^{k \phi(n')}$ of $n'$ such that $m'$ contains only the digits $0$ and $1$.

Then $$n \mid 5^k2^l n =5^k2^l ( 2^k 5^l n') =10^{k+l} n' \mid 10^{k+l} m'.$$ Therefore $ m = 10^{k+l} m' = 10^{k+l} \sum\limits_{k=0}^{n'-1} 10^{k \phi(n')}$ is such that $n \mid m$, and $$m = \underset{\phi(n)}{\underbrace{100\cdots0}}\underset{\phi(n)}{\underbrace{100\cdots0}}\cdots\underset{\phi(n)}{\underbrace{100\cdots0}}\underset{1}{\underbrace{1}} \underset{k+l}{\underbrace{00\cdots0}}$$ contains only the digits $0$ and $1$.