cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A296860 Numbers k whose base-2 digits d(m), d(m-1), ..., d(0) have #(pits) < #(peaks); see Comments.

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