login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A348111
Numbers k whose binary expansion starts with the concatenation of the binary expansions of the run lengths in binary expansion of k.
1
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,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
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