A296860 Numbers k whose base-2 digits d(m), d(m-1), ..., d(0) have #(pits) < #(peaks); see Comments.
18, 34, 36, 50, 66, 68, 72, 73, 74, 82, 98, 100, 114, 130, 132, 136, 137, 138, 144, 145, 146, 147, 148, 162, 164, 194, 196, 200, 201, 202, 210, 226, 228, 242, 258, 260, 264, 265, 266, 272, 273, 274, 275, 276, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297
Offset: 1
Examples
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.
Links
- Clark Kimberling, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
z = 200; b = 2; d[n_] := Differences[Sign[Differences[IntegerDigits[n, b]]]]; Select[Range [z], Count[d[#], -2] == Count[d[#], 2] &] (* A296858 *) Select[Range [z], Count[d[#], -2] < Count[d[#], 2] &] (* A296859 *) Select[Range [z], Count[d[#], -2] > Count[d[#], 2] &] (* A296860 *)
-
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
Comments