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.

A370069 Lexicographically earliest sequence of distinct integers such that the concatenated binary expansions of the terms is A010051.

This page as a plain text file.
%I A370069 #18 Mar 19 2024 16:38:10
%S A370069 0,1,2,40,162,8,32,160,34,544,130,520,2568,8320,552,663552,2178,512,
%T A370069 10272,34848,2560,665600,2048,35360,163872,2080,10274,8396800,9052160,
%U A370069 33280,2592,128,33288,133128,131584,10242,33312,2056,165888,526464,2230272,655360,2129952,8352,32800,534560,141312,2050,139394,32776
%N A370069 Lexicographically earliest sequence of distinct integers such that the concatenated binary expansions of the terms is A010051.
%C A370069 If we take the binary expansion of each term and concatenate these bits to a sequence, we get the sequence of the characteristic function of primes (A010051).
%C A370069 For n > 2 every term is an even Fibbinary number (A022340).
%H A370069 Michael S. Branicky, <a href="/A370069/b370069.txt">Table of n, a(n) for n = 1..10000</a>
%e A370069 terms   0,   1,    2,         40,             162,            8,          32
%e A370069 binary {0}, {1}, {1,0}, {1,0,1,0,0,0}, {1,0,1,0,0,0,1,0}, {1,0,0,0}, {1,0,0,0,0,0}
%e A370069 A010051 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0
%t A370069 n=49; lst={0};p=2;c=Boole[PrimeQ@Range[n^2]]; Do[k=1;While[MemberQ[lst,ne=FromDigits[c[[p;;(pn=NextPrime[p,k])-1]],2]],k++]; AppendTo[lst,ne];p=pn,{i,n}];lst
%o A370069 (Python)
%o A370069 from sympy import nextprime
%o A370069 from itertools import islice
%o A370069 def agen(): # generator of terms
%o A370069     yield 0
%o A370069     p, nextp, aset = 2, 3, {0}
%o A370069     while True:
%o A370069         an = 0
%o A370069         while an in aset:
%o A370069             an = (an<<(nextp-p)) + (1<<(nextp-p-1))
%o A370069             p, nextp = nextp, nextprime(nextp)
%o A370069         yield an
%o A370069         aset.add(an)
%o A370069 print(list(islice(agen(), 50))) # _Michael S. Branicky_, Feb 08 2024
%Y A370069 Cf A010051, A022340, A003714, A030190, A139102.
%K A370069 nonn,base
%O A370069 1,3
%A A370069 _Giorgos Kalogeropoulos_, Feb 08 2024