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.

A373082 Number of runs of 0's in A014550(n).

Original entry on oeis.org

1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 0, 1, 1, 2, 2, 1, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2, 2, 1, 1, 0, 1, 2, 1, 1, 1, 2, 2, 2, 3, 2, 1, 2, 2, 2, 2, 1, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2, 2, 2, 2, 1, 2, 3, 2, 2, 2, 1, 1, 1, 2, 1, 0, 1, 1, 2, 2, 1, 2, 2, 1, 1, 1, 2, 2, 2, 3
Offset: 0

Views

Author

James S. DeArmon, May 22 2024

Keywords

Crossrefs

Cf. A014550.

Programs

  • Python
    def count_zero_runs_in_binary(n):
        binRep = bin(n)[2:]   # as binary, but ignore "0b" prefix
        zRuns = binRep.split('1')  # split on the 1's
        zRvec = [run for run in zRuns if run] # filter "" to get runs of 0
        return len(zRvec)
    out = []
    for i in range(100):
        gv = i ^ (i>>1)   # gray code
        ans = count_zero_runs_in_binary(gv)
        out.append(ans)
    print(out)