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.

A367626 First differences of A036991.

Original entry on oeis.org

1, 2, 2, 2, 4, 2, 2, 4, 2, 2, 4, 2, 2, 8, 4, 2, 2, 4, 2, 2, 4, 2, 2, 8, 4, 2, 2, 4, 2, 2, 4, 2, 2, 8, 4, 2, 2, 4, 2, 2, 4, 2, 2, 16, 8, 4, 2, 2, 8, 4, 2, 2, 4, 2, 2, 4, 2, 2, 8, 4, 2, 2, 4, 2, 2, 4, 2, 2, 8, 4, 2, 2, 4, 2, 2, 4, 2, 2, 16, 8, 4, 2, 2, 8, 4, 2, 2
Offset: 1

Views

Author

N. J. A. Sloane, Nov 25 2023

Keywords

Comments

Entries are powers of 2 (see A036991 and A367627).

Crossrefs

Programs

  • Python
    from itertools import count, islice
    def A367626_gen(): # generator of terms
        a = 0
        yield 1
        for n in count(1):
            s = bin(n)[2:]
            c, l = 2, len(s)
            for i in range(1,l+1):
                if (c:=c+(2 if s[l-i]=='1' else 0)) <= i:
                    break
            else:
                yield n-a<<1
                a = n
    A367626_list = list(islice(A367626_gen(),30)) # Chai Wah Wu, Nov 28 2023