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.

A056966 In binary: write what is described (putting a leading zero on numbers which have an odd number of binary digits).

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 2, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 2, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 2, 3, 1, 1, 2, 3, 1, 1, 2, 3, 2, 2, 4, 5, 3, 3, 6, 7, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 2, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 2, 3, 0, 0, 0, 1, 0, 0, 0, 1, 0
Offset: 0

Views

Author

Henry Bottomley, Jul 20 2000

Keywords

Examples

			a(54)=2 because 54 = 110110 base 2, which can be read as one 1 followed by zero 1's followed by one 0, i.e., 10 base 2 = 2 base 10.
		

Crossrefs

Programs

  • Python
    def A056966(n):
        s = bin(n)[2:]
        s = '0'*(len(s)&1)+s
        return int('0'+''.join(s[i+1]*int(s[i])for i in range(0,len(s),2)),2) # Chai Wah Wu, Feb 12 2023