cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A353137 Primes whose gaps to both neighbor primes are powers of two.

Original entry on oeis.org

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

Views

Author

Alois P. Heinz, Apr 25 2022

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.
		

Crossrefs

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 *)