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

%I #17 May 14 2022 11:23:49

%S 3,5,7,11,13,17,19,41,43,71,97,101,103,107,109,193,197,227,229,281,

%T 311,313,349,397,401,457,461,463,487,491,499,617,643,743,761,769,823,

%U 827,857,859,881,883,911,937,1091,1093,1279,1301,1303,1427,1429,1447,1451

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

%H Alois P. Heinz, <a href="/A353137/b353137.txt">Table of n, a(n) for n = 1..10000</a>

%e 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.

%p p2:= proc(n) option remember; is(n=2^ilog2(n)) end:

%p q:= n-> isprime(n) and andmap(p2, [n-prevprime(n), nextprime(n)-n]):

%p select(q, [$3..3000])[];

%t p2[n_] := n == 2^Floor[Log2[n]];

%t q[n_] := PrimeQ[n] && p2[n-NextPrime[n, -1]] && p2[NextPrime[n]-n];

%t Select[Range[3, 3000], q] (* _Jean-François Alcover_, May 14 2022, after _Alois P. Heinz_ *)

%Y Cf. A000040, A000079, A353088, A353135, A353136.

%K nonn

%O 1,1

%A _Alois P. Heinz_, Apr 25 2022