OFFSET
0,1
COMMENTS
Least k such that a(k) = n are 3, 2, 0, 4, 1, 112, 7, 32917, 802, 9712, 1198673602 for the initial terms.
LINKS
Altug Alkan, Table of n, a(n) for n = 0..10000
EXAMPLE
a(1) = 5 because 3 + 2^k is prime for 0 < k < 5 and 3 + 2^5 = 35 is composite.
MATHEMATICA
spk[n_]:=Module[{k=1}, While[!CompositeQ[2n+2^k+1], k++]; k]; Array[spk, 110, 0] (* Harvey P. Dale, Apr 26 2017 *)
PROG
(PARI) a(n) = my(k=1); while(isprime(2*n+2^k+1), k++); k;
CROSSREFS
KEYWORD
nonn
AUTHOR
Altug Alkan, Feb 15 2017
STATUS
approved