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.
%I A296861 #11 Jan 22 2023 16:58:02 %S A296861 1,2,3,4,5,6,7,8,9,12,13,14,17,18,21,22,24,25,26,27,28,29,30,33,34,36, %T A296861 39,40,41,44,46,47,50,51,52,53,54,55,56,57,60,61,63,66,67,68,69,70,72, %U A296861 75,76,78,79,80,81,82,83,85,86,89,90,96,97,99,102,103 %N A296861 Numbers whose base-3 digits d(m), d(m-1), ..., d(0) have #(pits) = #(peaks); see Comments. %C A296861 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 A296861-A296863 partition the natural numbers. See the guides at A296882 and A296712. %H A296861 Clark Kimberling, <a href="/A296861/b296861.txt">Table of n, a(n) for n = 1..10000</a> %e A296861 The base-3 digits of 103 are 1, 0, 2, 1, 1; here #(pits) = 1 and #(peaks) = 1, so 103 is in the sequence. %t A296861 z = 200; b = 3; %t A296861 d[n_] := Differences[Sign[Differences[IntegerDigits[n, b]]]]; %t A296861 Select[Range [z], Count[d[#], -2] == Count[d[#], 2] &] (* A296861 *) %t A296861 Select[Range [z], Count[d[#], -2] < Count[d[#], 2] &] (* A296862 *) %t A296861 Select[Range [z], Count[d[#], -2] > Count[d[#], 2] &] (* A296863 *) %Y A296861 Cf. A296882, A296712, A296862, A296863. %K A296861 nonn,base,easy %O A296861 1,2 %A A296861 _Clark Kimberling_, Jan 09 2018