OFFSET
0,4
COMMENTS
For terms after the first several, 10^n + a(n) is only known to be a highly probable prime. If, for m>0, 10^n - m and 10^n + m are both nearest primes to 10^n, a(n) = -m. For example, a(17) = -3 as 10^17-3 and 10^17+3 are the nearest primes to 10^17. Similarly, a(45) = -9 with both 10^45-9 and 10^45+9 prime.
FORMULA
a(n) = A115062(n) - 10^n.
EXAMPLE
a(4) = 7 as 10^4 + 7 = 10007 = A115062(4), the nearest prime to 10^4.
MAPLE
a:= n-> (t->((p, q)->`if`(q-t<t-p, q, p)-t)(`if`(t=1, -1,
prevprime(t)), nextprime(t)))(10^n):
seq(a(n), n=0..80); # Alois P. Heinz, Aug 13 2014
CROSSREFS
KEYWORD
sign
AUTHOR
Rick L. Shepherd, Mar 02 2006
STATUS
approved