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.

A348111 Numbers k whose binary expansion starts with the concatenation of the binary expansions of the run lengths in binary expansion of k.

Original entry on oeis.org

0, 1, 7, 14, 28, 112, 127, 254, 509, 1016, 1018, 1792, 2033, 2037, 2039, 4066, 4072, 4075, 4078, 8132, 8135, 8150, 8156, 16256, 16300, 16313, 32513, 32528, 32576, 32601, 32607, 32626, 32639, 32767, 65027, 65087, 65153, 65202, 65248, 65253, 65255, 65534, 130307
Offset: 1

Views

Author

Rémy Sigrist, Oct 01 2021

Keywords

Comments

We consider here that 0 has an empty binary expansion, and include it in the sequence.
This sequence is infinite as it contains A077585.

Examples

			Regarding 32607:
- the binary expansion of 32607 is "111111101011111",
- the corresponding run lengths are: 7, 1, 1, 1, 5,
- in binary: "111", "1", "1", "1", "101",
- after concatenation: "111111101",
- as "111111101011111" starts with "111111101", 32607 belongs to this sequence.
		

Crossrefs

Programs

  • PARI
    See Links section.
    
  • Python
    from itertools import groupby
    def ok(n):
        if n == 0: return True
        b = bin(n)[2:]
        c = "".join(bin(len(list(g)))[2:] for k, g in groupby(b))
        return b.startswith(c)
    print(list(filter(ok, range(2**17)))) # Michael S. Branicky, Oct 02 2021