OFFSET
1,1
COMMENTS
LINKS
Clark Kimberling, Table of n, a(n) for n = 1..10000
EXAMPLE
The base-2 digits of 297 are 1, 0, 0, 1, 0, 1, 0, 0, 1; here #(pits) = 1 and #(peaks) = 2, so 297 is in the sequence.
MATHEMATICA
PROG
(Python)
def cwo(subs, s): # count with overlaps allowed
c = i = 0
while i != -1:
i = s.find(subs, i)
if i != -1: c += 1; i += 1
return c
def ok(n): b = bin(n)[2:]; return cwo('101', b) < cwo('010', b)
print(list(filter(ok, range(1, 298)))) # Michael S. Branicky, May 11 2021
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Clark Kimberling, Jan 09 2018
STATUS
approved