OFFSET
1,2
LINKS
Paul Tek, Table of n, a(n) for n = 1..10000
EXAMPLE
35 in binary is 100011. There is a run of one 1, followed by a run of three 0's, followed finally by a run of two 1's. And there are six binary digits all together. Since 1, 3, and 2 each divide 6, then 35 is in the sequence.
PROG
(Python)
from itertools import groupby
def ok(n):
b = bin(n)[2:]
return all(len(b)%len(list(g)) == 0 for k, g in groupby(b))
print([k for k in range(1, 173) if ok(k)]) # Michael S. Branicky, Nov 07 2022
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Leroy Quet, May 07 2010
STATUS
approved