Prove that if $n$ is not divisible by 5 or 2,then there exists a number consisting of ones that is divisible by $n$.
I tried something like this-
Suppose $n=a_0+a_1 10^1+a_2 10^2+...+a_k 10^k$. Now, it is not divisible by 5 or 2. So, $a_0$ not equal to 5 or 0.
I am unable to proceed after that.
Define $$a_n=\dfrac{10^n-1}{9}=\underbrace{111\dots 1}_{(n\text{ times})}$$and let $$r_n=a_n\mod n$$obviously $0\le r_n<n$. According to pigeonhole principle the set of $\{r_1,r_2,...,r_n,r_{n+1}\}$ consists of two equal members namely $r_i$ and $r_j$ i.e. $$\exists 0\le j\le i\le n\qquad,\qquad r_i=r_j$$therefore $$a_i-a_j=nq_i+r_i-(nq_j+r_j)=n(q_i-q_j)+r_i-r_j=n(q_i-q_j)$$therefore $$n|a_i-a_j$$also $$a_i-a_j=\dfrac{10^i-10^j}{9}=10^j\dfrac{10^{i-j}-1}{9}=10^ja_{i-j}$$since $\gcd(n,10)=1$ so $\gcd(n,10^{j})=1$ therefore $$n|a_{i-j}$$ or $$n|\underbrace{111\dots 1}_{(i-j\text{ times})}$$