When is it solvable:$10^a+10^b\equiv -1 \pmod p$ 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.
 A: The first few primes for which it is not solvable are
$$5, 11, 41, 73, 79, 101, 137, 239, 271, 281, 641, 733, 859, 1321, 1409, 2531, 2791, 3191, 3541, 4013, 4093, 4637, 4649, 5051, 5171, 5237, 6163, 6299, 7253, 7841, 8779, 9091, 9161, 11831, 12517, 12671$$
The sequence does not seem to be in the OEIS.
On the other hand, if you replace $10$ by $2$ there is https://oeis.org/A179113
EDIT: I doubt that there's a simple necessary and sufficient condition.  But here might be the start of a heuristic analysis which might suggest there should be infinitely many.
Heuristically, if the order of $10$ mod $p$ is $m$, we evaluate 
$10^a + 10^b \mod p$ for approximately $m^2/2$ unordered pairs $(a,b)$, so the
probability that none of those is congruent to $-1 \mod p$ should be approximately
$\exp(-m^2/(2p))$.  So if you want to find primes $p$ for which your equation is not solvable, 
you might look at those where  the order of $10 \mod p$ is less than about $\sqrt{p}$. 
The order of $10 \mod p$ is $m$ or one of its divisors if $p$ divides $10^m - 1$.
So we might look for  primes $ p > m^2$ dividing $10^m - 1$.  Nearly all positive integers $x$ will have at least one prime factor greater than $\log_{10}(x)^2$ (see Dickman's theorem).   
A: The thing looks pretty general.  Consider 7 in base 2.  Here 2+4-1, mod 7, even though 2 is not a primitive root.  The thing is resolving to what conditions are needed for p to divide the sum of three powers of 10.  The number 37 divides any such sum as long as the three powers are different, modulo 3, eg, 100,011.
Having a period that is divisible by $3$ implies a solution must exist, for this reason. 
