A067760 a(n) is the least positive k such that (2n+1) + 2^k is prime, or 0 if no such k exists.
1, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 3, 2, 1, 1, 4, 2, 1, 2, 1, 1, 2, 1, 5, 2, 1, 3, 2, 1, 1, 8, 2, 1, 2, 1, 1, 4, 2, 1, 2, 1, 7, 2, 1, 3, 4, 2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 7, 4, 5, 3, 4, 2, 1, 2, 1, 3, 2, 1, 1, 10, 3, 3, 2, 1, 1, 4, 2, 1, 4, 2, 1, 2, 1, 5, 2, 1, 3, 2, 1, 1, 4, 3, 3, 2, 1, 1, 2, 1, 1, 6, 5, 3, 6
Offset: 0
Keywords
Examples
a(15)=4 because (2*15+1)+2^k is composite for k=1,2,3 and prime for k=4.
Links
- Jinyuan Wang, Table of n, a(n) for n = 0..39278 (terms 0..1064 from T. D. Noe, terms 1065..3000 from Richard N. Smith).
- Mersenne Forum, Five or Bust
- Carlos Rivera, Puzzle 167. Primes m + 2^j & m - 2^j, The Prime Puzzles and Problems Connection.
Crossrefs
Programs
-
PARI
a(n) = {my(k=1); while (! isprime((2*n+1)+2^k), k++); k;} \\ Michel Marcus, Feb 26 2018
Comments