OFFSET
1,3
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.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..10000
Rémy Sigrist, PARI program for A348111
EXAMPLE
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.
PROG
(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
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Oct 01 2021
STATUS
approved