login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A037036
Least k such that 2^n+1-k is a prime.
0
0, 0, 0, 2, 0, 2, 4, 2, 0, 4, 4, 10, 4, 2, 4, 20, 0, 2, 6, 2, 4, 10, 4, 16, 4, 40, 6, 40, 58, 4, 36, 2, 6, 10, 42, 32, 6, 26, 46, 8, 88, 22, 12, 58, 18, 56, 22, 116, 60, 82, 28, 130, 48, 112, 34, 56, 6, 14, 28, 56, 94, 2, 58, 26, 60, 50, 6, 20, 24, 20, 36, 232, 94, 70, 36, 98, 16, 34
OFFSET
0,4
EXAMPLE
a(5)=2 because 2^5+1-2=31 that is a prime.
PROG
(PARI) a(n) = my(k = 0); while (! isprime(2^n+1-k), k++); k; \\ Michel Marcus, Sep 28 2013
CROSSREFS
Cf. A016014.
Sequence in context: A338227 A350861 A144182 * A378986 A055947 A015910
KEYWORD
nonn
AUTHOR
EXTENSIONS
More terms from Erich Friedman
STATUS
approved