If $p$ is a prime, $(a,p)=1$,denote $ord(a,p)=d,$ where $d$ is the smallest positive integer solution to the equation $a^d\equiv 1 \pmod p$.We can prove that $$10^n\equiv -1 \pmod p\tag1$$ is solvable iff $ord(10,p)$ is even.
Now,consider this equation,$$10^a+10^b\equiv -1 \pmod p.\tag2$$ If $10$ is a primitive root modulo $p$, then there is an integer $a$ for every $b≠\dfrac{p-1}{2}\pmod {p-1}$ so that $a,b$ satisfies $(2)$.
My question is,what's the necessary and sufficient condition that $(2)$ has at least $1$ solution?
If we are given a prime $p$,how to determine whether $(2)$ is solvabe?
This is a way,but not effectively: for every positive integer $b\leq\frac{1}{2}ord(10,p)$,determine whether $(2)$ is solvabe for $a$.By this way,I find $(2)$ is solvable for these primes,which $10^n\equiv -1 \pmod p$ is not solvable:
$3,31,37,43,53,67,71,83,107,151,163,173,191,199,227,277,283,307,311,317,347,359,397,431,439,443,467,479,523,547,563,587,599,613,631,643,683,719,751,757,773,787,797,827,839,853,883,907,911,919,947,991,\cdots$
My original problem is: how many "$1$" is need at least for a decimal number which is consisting of "$0$" and "$1$" and divisible by $p$?This question is to find these primes that three "$1$" is need at least.
Thank you.