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.

A353733 a(0)=0, a(1)=1; for k >= 1, a(2*k+1) and a(2*k+2) are the two smallest numbers not yet in the sequence whose binary expansions have no 1's in common with the binary expansion of a(k).

Original entry on oeis.org

0, 1, 2, 4, 6, 5, 8, 3, 9, 16, 17, 10, 18, 7, 19, 12, 20, 22, 32, 11, 13, 14, 34, 21, 33, 36, 37, 24, 40, 44, 64, 35, 48, 41, 42, 65, 72, 15, 23, 52, 68, 50, 66, 49, 80, 25, 28, 74, 96, 26, 30, 27, 67, 82, 88, 38, 39, 69, 70, 81, 83, 29, 31, 76, 84, 71, 73, 86
Offset: 0

Views

Author

N. J. A. Sloane, May 17 2022

Keywords

Comments

A variant of A352808.
This is a permutation of the nonnegative numbers (the proof is similar to that for A352808).

Examples

			For k=2, after a(2) = 2 = 10_2, we get a(5) = 5 = 101_2 and a(6) = 8 = 1000_2 since 101_2, 1000_2 have no 1's in common with 10_2.
		

Crossrefs

Cf. A352808.

Programs

  • Python
    from itertools import count, islice
    def agen(): # generator of terms
        alst = [0, 1]; aset = {0, 1}; yield from alst
        mink = 2
        for n in count(2):
            ahalf, k = alst[(n-1)//2], mink
            while k in aset or k&ahalf: k += 1
            alst.append(k); aset.add(k); yield k
            while mink in aset: mink += 1
    print(list(islice(agen(), 68))) # Michael S. Branicky, May 17 2022

Extensions

More terms from Michael S. Branicky, May 17 2022