A353137 Primes whose gaps to both neighbor primes are powers of two.
3, 5, 7, 11, 13, 17, 19, 41, 43, 71, 97, 101, 103, 107, 109, 193, 197, 227, 229, 281, 311, 313, 349, 397, 401, 457, 461, 463, 487, 491, 499, 617, 643, 743, 761, 769, 823, 827, 857, 859, 881, 883, 911, 937, 1091, 1093, 1279, 1301, 1303, 1427, 1429, 1447, 1451
Offset: 1
Keywords
Examples
Prime 1447 is a term, the gap to the previous prime 1439 is 8 and the gap to the next prime 1451 is 4 and both gaps are powers of two.
Links
- Alois P. Heinz, Table of n, a(n) for n = 1..10000
Programs
-
Maple
p2:= proc(n) option remember; is(n=2^ilog2(n)) end: q:= n-> isprime(n) and andmap(p2, [n-prevprime(n), nextprime(n)-n]): select(q, [$3..3000])[];
-
Mathematica
p2[n_] := n == 2^Floor[Log2[n]]; q[n_] := PrimeQ[n] && p2[n-NextPrime[n, -1]] && p2[NextPrime[n]-n]; Select[Range[3, 3000], q] (* Jean-François Alcover, May 14 2022, after Alois P. Heinz *)