Divisibility by a prime number I have been struggling with this question. It would be great if somebody can really help me out with this question:
Prove that for any Prime number P > 5, there exists a K such that 1111....11 (repeated K times) is divisible by P. 
 A: Using Fermat's Little Theorem $$10^{P-1}\equiv1\pmod P\text{ as }(P,10)=1$$
$$\implies P\text{ divides }\underbrace{99\cdots 99}_{P-1\text{ digits}}$$
$$\implies P\text{ divides }\underbrace{11\cdots 11}_{P-1\text{ digits}} \text {as } (P,9)=1$$

Alternatively,
using Pigeonhole Principle, if we consider $\underbrace{11\cdots 11}_{r\text{ digits}}$   where $r$ varies from $1,2,\cdot,P-1,P,P+1$
As $P$ can have at most $P$ remainders, there must be at least two values $r_1,r_2$ where $r_1>r_2$ of $r$ such that the remainders are same.
So, $P$ will divide  $\underbrace{11\cdots 11}_{r_1\text{ digits}}-\underbrace{11\cdots 11}_{r_2\text{ digits}}=\underbrace{11\cdots 11}_{(r_2-r_1)\text{ digits}}\underbrace{00\cdots 00}_{r_1\text{ digits}}$
So, $P$ will divide $\underbrace{11\cdots 11}_{(r_2-r_1)\text{ digits}}$ as $(P,10)=1$
$P$ does not need to be prime.
Using Euler's Totient Theorem or Carmichael's Theorem, we can always find $n$ such that $10^n\equiv1\pmod P$ if $(P,10)=1$
Subsequently, integer $$P \text{ divides  }\underbrace{11\cdots 11}_{n\text{ digits}} \text { if } (P,9)=1$$
