A220951 Primes p such that p+6 is also prime and there is a power of two in the interval (p,p+6).
5, 7, 11, 13, 31, 61, 251, 4093
Offset: 1
Programs
-
Magma
//Program finds primes separated by an even number (called gap) which have a power of two between them. Program starts with the smallest power of two above gap. Primes less than this starting point can be checked by inspection. gap:=6; start:=Ilog2(gap)+1; for i:= start to 1000 do powerof2:=2^i; for k:=powerof2-gap+1 to powerof2-1 by 2 do if (IsPrime(k) and IsPrime(k+gap)) then k; end if; end for; end for;
-
Mathematica
pptQ[n_]:=AllTrue[{n,n+6},PrimeQ]&&Count[Log[2,#]&/@Range[n,n+6], ?IntegerQ] > 0; Select[Range[4100],pptQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* _Harvey P. Dale, Nov 01 2015 *)
Comments