Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #11 May 11 2021 06:11:17
%S 18,34,36,50,66,68,72,73,74,82,98,100,114,130,132,136,137,138,144,145,
%T 146,147,148,162,164,194,196,200,201,202,210,226,228,242,258,260,264,
%U 265,266,272,273,274,275,276,288,289,290,291,292,293,294,295,296,297
%N Numbers k whose base-2 digits d(m), d(m-1), ..., d(0) have #(pits) < #(peaks); see Comments.
%C A pit is an index i such that d(i-1) > d(i) < d(i+1); a peak is an index i such that d(i-1) < d(i) > d(i+1). The sequences A296858-A296860 partition the natural numbers. See the guides at A296882 and A296712.
%H Clark Kimberling, <a href="/A296860/b296860.txt">Table of n, a(n) for n = 1..10000</a>
%e 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.
%t z = 200; b = 2;
%t d[n_] := Differences[Sign[Differences[IntegerDigits[n, b]]]];
%t Select[Range [z], Count[d[#], -2] == Count[d[#], 2] &] (* A296858 *)
%t Select[Range [z], Count[d[#], -2] < Count[d[#], 2] &] (* A296859 *)
%t Select[Range [z], Count[d[#], -2] > Count[d[#], 2] &] (* A296860 *)
%o (Python)
%o def cwo(subs, s): # count with overlaps allowed
%o c = i = 0
%o while i != -1:
%o i = s.find(subs, i)
%o if i != -1: c += 1; i += 1
%o return c
%o def ok(n): b = bin(n)[2:]; return cwo('101', b) < cwo('010', b)
%o print(list(filter(ok, range(1, 298)))) # _Michael S. Branicky_, May 11 2021
%Y Cf. A296882, A296712, A296858, A296859.
%K nonn,base,easy
%O 1,1
%A _Clark Kimberling_, Jan 09 2018