OFFSET
1,3
COMMENTS
For n>=3 all terms are multiples of 3.
Conjecture: a(n) = O(n^3). - Thomas Ordowski, Apr 20 2015
LINKS
P. Poplin, Table of n, a(n) for n = 0..10000 (Terms after 8025 correspond to Fermat and Lucas PRP.)
EXAMPLE
a(1)=0 because 2^1 +/- 0 are primes; a(2)=1 because 2^2 -/+ 1 are primes;
a(33)=675 because 2^33 +/- 675 are closest (to each other) primes.
MATHEMATICA
f[n_]:=Module[{a=2^n, i=1}, While[!PrimeQ[a+i]||!PrimeQ[a-i], i++]; i]; Join[{0}, Rest[Array[f, 80]]] (* Harvey P. Dale, Apr 25 2011 *)
PROG
(PARI) a(n) = my(m=0); while(!(isprime(2^n+m) && isprime(2^n-m)), m++); m; \\ Michel Marcus, Apr 20 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, Jan 07 2006
STATUS
approved