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.

Previous Showing 21-21 of 21 results.

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

Original entry on oeis.org

0, 1, 2, 40, 162, 8, 32, 160, 34, 544, 130, 520, 2568, 8320, 552, 663552, 2178, 512, 10272, 34848, 2560, 665600, 2048, 35360, 163872, 2080, 10274, 8396800, 9052160, 33280, 2592, 128, 33288, 133128, 131584, 10242, 33312, 2056, 165888, 526464, 2230272, 655360, 2129952, 8352, 32800, 534560, 141312, 2050, 139394, 32776
Offset: 1

Views

Author

Giorgos Kalogeropoulos, Feb 08 2024

Keywords

Comments

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).
For n > 2 every term is an even Fibbinary number (A022340).

Examples

			terms   0,   1,    2,         40,             162,            8,          32
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}
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
		

Crossrefs

Programs

  • Mathematica
    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
  • Python
    from sympy import nextprime
    from itertools import islice
    def agen(): # generator of terms
        yield 0
        p, nextp, aset = 2, 3, {0}
        while True:
            an = 0
            while an in aset:
                an = (an<<(nextp-p)) + (1<<(nextp-p-1))
                p, nextp = nextp, nextprime(nextp)
            yield an
            aset.add(an)
    print(list(islice(agen(), 50))) # Michael S. Branicky, Feb 08 2024
Previous Showing 21-21 of 21 results.