How many "$1$" is need at least for a decimal number,which is consisting of "$0$" and "$1$" and divisible by $p$?
If $p=2^k\cdot d+1$, and $10^d\equiv 1 \pmod p$,then $10^n\equiv -1 \pmod p$ has no solution, so $10^n+1$ is never divisible by $p$, so two "$1$" is not enough,but since $\dfrac{10^{p-1}-1}{9}=11\cdots 111\equiv 0 \pmod p$,so $p-1$ is awlays enough,in fact,$ord(10,p)$ is enough,but may be not the least.
In When is it solvable:$10^a+10^b\equiv -1 \pmod p$ , I asked that when three "$1$" is need at least,I think I should ask this original problem here,because this is more general and why I asked that question.
Assume $(10,p)=1.$
Two "$1$" is need at least for $p=7, 11, 13, 17, 19, 23, 29, 47, 59, 61, 73, 89, 97, 101, 103,\cdots$
Three "$1$" is need at least for $p=3, 31, 37, 43, 53, 67, 71, 83, 107, 151, 163, 173, 191, 199,\cdots$
Four "$1$" is need at least for $p=79, 733,\cdots$
Thank you!