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.

A220746 Numbers n such that n and n + 10 are prime and there is a power of two in the interval (n, n+10).

This page as a plain text file.
%I A220746 #16 Feb 19 2023 17:18:18
%S A220746 3,7,13,31,61,127,1021,1048573,
%T A220746 23945242826029513411849172299223580994042798784118781
%N A220746 Numbers n such that n and n + 10 are prime and there is a power of two in the interval (n, n+10).
%t A220746 Union[Flatten[Table[Select[Range[2^n - 9, 2^n - 1, 2], PrimeQ[#] && PrimeQ[# + 10] &], {n, 3, 200}]]] (* _T. D. Noe_, Feb 20 2013 *)
%t A220746 Union[Flatten[Table[Select[Thread[{Range[2^n-10,2^n],Range[ 2^n,2^n+10]}],AllTrue[ #,PrimeQ]&],{n,3,1000}],1][[;;,1]]] (* _Harvey P. Dale_, Feb 19 2023 *)
%o A220746 (Magma)
%o A220746 //Program finds primes separated by an even number (called gap) which
%o A220746 //have a power of two between them. Program starts with the smallest
%o A220746 //power of two above gap. Primes less than this starting point can be
%o A220746 //checked by inspection. In this example 3 also works.
%o A220746 gap:=10;
%o A220746 start:=Ilog2(gap)+1;
%o A220746 for i:= start to 1000 do
%o A220746     powerof2:=2^i;
%o A220746     for k:=powerof2-gap+1 to powerof2-1 by 2 do
%o A220746         if (IsPrime(k) and IsPrime(k+gap)) then k;
%o A220746         end if;
%o A220746     end for;
%o A220746 end for;
%o A220746 (PARI) print1(3); for(n=4,500,forprime(p=2^n-9,2^n-1,if(isprime(p+10), print1(", "p)))) \\ _Charles R Greathouse IV_, Feb 20 2013
%Y A220746 Cf. A023203, A221211.
%K A220746 nonn
%O A220746 1,1
%A A220746 _Brad Clardy_, Feb 20 2013