Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #11 Jan 22 2023 16:58:02
%S 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 39,40,41,44,46,47,50,51,52,53,54,55,56,57,60,61,63,66,67,68,69,70,72,
%U 75,76,78,79,80,81,82,83,85,86,89,90,96,97,99,102,103
%N Numbers whose base-3 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 A296861-A296863 partition the natural numbers. See the guides at A296882 and A296712.
%H Clark Kimberling, <a href="/A296861/b296861.txt">Table of n, a(n) for n = 1..10000</a>
%e 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 z = 200; b = 3;
%t d[n_] := Differences[Sign[Differences[IntegerDigits[n, b]]]];
%t Select[Range [z], Count[d[#], -2] == Count[d[#], 2] &] (* A296861 *)
%t Select[Range [z], Count[d[#], -2] < Count[d[#], 2] &] (* A296862 *)
%t Select[Range [z], Count[d[#], -2] > Count[d[#], 2] &] (* A296863 *)
%Y Cf. A296882, A296712, A296862, A296863.
%K nonn,base,easy
%O 1,2
%A _Clark Kimberling_, Jan 09 2018