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.
%I A214415 #32 Oct 16 2023 12:41:19 %S A214415 2,4,6,8,12,15,16,23,25,30,37,53,55,57,67,75,76,81,82,84,95,108,129, %T A214415 132,135,139,143,155,160,163,180,181,188,192,203,204,210,222,244,263, %U A214415 273,277,280,287,289,295,297,308,315,319,325,330,341,367,370,393,394,406 %N A214415 Numbers n such that prevprime(2^n) AND nextprime(2^n) = 1, where AND is the bitwise AND operator. %C A214415 A007053(a(n)) are indices of 1's in A175330. That is, A175330(A007053(a(n)))=1. %C A214415 Conjecture: the sequence is infinite. %e A214415 4 is in the sequence because (prevprime(2^4) AND nextprime(2^4)) = 13 AND 17 = 1. %t A214415 ba1Q[n_]:=Module[{c=2^n},BitAnd[NextPrime[c],NextPrime[c,-1]]==1]; Select[ Range[ 450],ba1Q] (* _Harvey P. Dale_, Dec 25 2012 *) %o A214415 (Java) %o A214415 import java.math.BigInteger; %o A214415 public class A214415 { %o A214415 public static void main (String[] args) { %o A214415 BigInteger b1 = BigInteger.valueOf(1); %o A214415 BigInteger b2 = BigInteger.valueOf(2); %o A214415 for (int n=2; ; n++) { %o A214415 BigInteger pwr = b1.shiftLeft(n); %o A214415 BigInteger pm = pwr.subtract(b1); %o A214415 BigInteger pp = pwr.add(b1); %o A214415 while (true) { %o A214415 if (pm.isProbablePrime(2)) { %o A214415 if (pm.isProbablePrime(80)) break; %o A214415 } %o A214415 pm = pm.subtract(b2); %o A214415 } %o A214415 while (true) { %o A214415 if (pp.isProbablePrime(2)) { %o A214415 if (pp.isProbablePrime(80)) break; %o A214415 } %o A214415 pp = pp.add(b2); %o A214415 } %o A214415 if (pm.and(pp).equals(b1)) { %o A214415 System.out.printf("%d, ",n); %o A214415 } %o A214415 } %o A214415 } %o A214415 } %o A214415 (PARI) %o A214415 { for (n=2,1000, N = 2^n; %o A214415 p1 = precprime(N-1); %o A214415 p2 = nextprime(N+1); %o A214415 ba = bitand(p1, p2); %o A214415 if ( bitand( ba, ba-1 ) == 0, print1(n,", ")); %o A214415 ); } %o A214415 /* _Joerg Arndt_, Aug 16 2012 */ %o A214415 (Python) %o A214415 from itertools import islice %o A214415 from sympy import prevprime, nextprime %o A214415 def A214415_gen(): # generator of terms %o A214415 n, m = 2, 4 %o A214415 while True: %o A214415 if prevprime(m)&nextprime(m) == 1: %o A214415 yield n %o A214415 n += 1 %o A214415 m *= 2 %o A214415 A214415_list = list(islice(A214415_gen(),20)) # _Chai Wah Wu_, Oct 16 2023 %Y A214415 Cf. A007053, A175330. %K A214415 nonn,base %O A214415 0,1 %A A214415 _Alex Ratushnyak_, Aug 07 2012