OFFSET
1,1
COMMENTS
a(n)== 0 (mod 3). - Robert G. Wilson v, Mar 13 2006
LINKS
Robert Israel, Table of n, a(n) for n = 1..422
FORMULA
EXAMPLE
a(1)=3 because 10-3=7 and 10+3=13 both of which are primes.
a(3)=9 because 1000-9=991 and 1000+9=1009 both of which are primes.
MAPLE
f:= proc(n) local k;
for k from 3 by 6 do
if isprime(10^n+k) and isprime(10^n-k) then return k fi
od
end proc:
map(f, [$1..100]); # Robert Israel, May 25 2018
MATHEMATICA
f[n_] := Block[{k = 1}, While[ ! PrimeQ[10^n - 3k] || ! PrimeQ[10^n + 3k], k++ ]; 3k]; Array[f, 50]
dpp[n_]:=Module[{n10=10^n, np=NextPrime[10^n], diff}, diff=np-n10; While[ !PrimeQ[n10-diff], np=NextPrime[np]; diff=np-n10]; np-n10]; Array[dpp, 80] (* Harvey P. Dale, Mar 28 2012 *)
PROG
(PARI) { for (n = 1, 80, tenp = 10^n ; p = nextprime(tenp) ; while ( p-tenp < tenp, diff=p-tenp ; if ( isprime(tenp-diff), print1(diff", ") ; break ; ) ; p=nextprime(p+1) ; ) ; ) } - R. J. Mathar, Mar 15 2006
CROSSREFS
KEYWORD
nonn
AUTHOR
Lekraj Beedassy, Mar 11 2006
EXTENSIONS
More terms from Craig Baribault (csb166(AT)psu.edu) and Robert G. Wilson v, Mar 13 2006
More terms from R. J. Mathar, Mar 15 2006
Corrected by Harvey P. Dale, Mar 28 2012
STATUS
approved