OFFSET
1,2
COMMENTS
A "run" of 0's is not immediately bounded by any 0's, and a "run" of 1's is not immediately bounded by any 1's.
There are exactly (m*(m+1)/2)! / Product_{k=1 to m} k! numbers in the sequence each of m^3/3 + m^2/2 + m/6 binary digits, for all m >= 1, and none of any other number of binary digits.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..12664
Rémy Sigrist, PARI program for A175356
EXAMPLE
9016 in binary is 10001100111000. There is exactly one run of one binary digit, two runs of two binary digits, and three runs of three binary digits. (Note that it doesn't matter if the runs are of 0's or of 1's.) So, 9016 is in the sequence.
PROG
(PARI) \\ See Links section.
(Python)
from itertools import groupby
def ok(n):
runlens = [len(list(g)) for k, g in groupby(bin(n)[2:])]
return all(runlens.count(k) == k for k in range(1, max(runlens)+1))
def aupto(limit): return [m for m in range(1, limit+1) if ok(m)]
print(aupto(14536)) # Michael S. Branicky, Jan 19 2021
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Leroy Quet, Apr 22 2010
EXTENSIONS
More terms from Rémy Sigrist, Feb 06 2019
STATUS
approved