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.

A247068 Primes whose base-2 expansion has no two consecutive 1's.

This page as a plain text file.
%I A247068 #39 Apr 25 2025 12:54:30
%S A247068 2,5,17,37,41,73,137,149,257,277,293,337,521,577,593,641,661,673,677,
%T A247068 1033,1061,1093,1097,1109,1153,1193,1289,1297,1301,1321,1361,2053,
%U A247068 2069,2081,2089,2113,2129,2213,2309,2341,2377,2389,2593,2633,2689,2693,2729,4129,4133,4177,4229,4241,4261,4357,4373,4421,4649,4673,5153,5189
%N A247068 Primes whose base-2 expansion has no two consecutive 1's.
%C A247068 Also: numbers appearing in both A000040 and A003714. Is it known to be infinite?
%H A247068 Alois P. Heinz, <a href="/A247068/b247068.txt">Table of n, a(n) for n = 1..10000</a>
%H A247068 Estelle Basor, Brian Conrey, and Kent E. Morrison, <a href="https://arxiv.org/abs/1703.00990">Knots and ones</a>, arXiv:1703.00990 [math.GT], 2017. See page 1.
%p A247068 M:= 16: # to get all terms < 2^M
%p A247068 B1:= {1}:
%p A247068 B2:= {}:
%p A247068 for n from 2 to M-1 do
%p A247068    B3:= map(`+`,B1,2^n);
%p A247068    B1:= B1 union B2;
%p A247068    B2:= B3;
%p A247068 od:
%p A247068 select(isprime,{2} union B1 union B2);
%p A247068 # if using Maple 11 or earlier, uncomment the next line
%p A247068 # sort(convert(%,list));   # _Robert Israel_, Nov 16 2014
%t A247068 Select[Prime[Range[700]],SequenceCount[IntegerDigits[#,2],{1,1}]==0&] (* _Harvey P. Dale_, May 14 2022 *)
%o A247068 (Sage)
%o A247068 def a_list(M):  # All terms < 2^M. After Robert Israel.
%o A247068     A = [1]; B = [2]; s = 4
%o A247068     for n in range(M-2):
%o A247068         C = [a + s for a in A]
%o A247068         A.extend(B)
%o A247068         B = C
%o A247068         s <<= 1
%o A247068     A.extend(B)
%o A247068     return list(filter(is_prime, A))
%o A247068 a_list(13) # _Peter Luschny_, Nov 16 2014
%o A247068 (PARI) my(t=bitand(n++,2*n));if(t==0,return(n));my(o=#binary(t)-1);((n>>o)+1)<<o
%o A247068 n=0;while(n<1e6,if(isprime(n=step(n)), print1(n", "))) \\ _Charles R Greathouse IV_, Nov 16 2014
%o A247068 (PARI) forprime(p=2,5000,if(bitand(p,p>>1)==0,print1(p,", "))); \\ _Joerg Arndt_, Apr 25 2025
%o A247068 (Python)
%o A247068 from itertools import islice
%o A247068 from sympy import isprime
%o A247068 def A247068_gen(): # generator of terms
%o A247068     k = 0
%o A247068     while True:
%o A247068         if isprime(k:=(m:=~(k>>1))&(k-m)): yield k
%o A247068 A247068_list = list(islice(A247068_gen(),30)) # _Chai Wah Wu_, Apr 25 2025
%Y A247068 Cf. A000040, A003714.
%K A247068 nonn,base
%O A247068 1,1
%A A247068 _Jeffrey Shallit_, Nov 16 2014