login
Numbers whose base-4 digits d(m), d(m-1), ... d(0) have #(rises) = #(falls); see Comments.
4

%I #9 Jan 28 2023 19:35:39

%S 1,2,3,5,10,15,17,18,19,21,24,25,28,29,30,33,34,35,38,39,42,44,45,46,

%T 49,50,51,54,55,59,63,65,66,67,69,74,79,81,82,83,85,88,89,92,93,94,96,

%U 101,104,105,112,117,122,124,125,126,129,130,131,133,138,143

%N Numbers whose base-4 digits d(m), d(m-1), ... d(0) have #(rises) = #(falls); see Comments.

%C A rise is an index i such that d(i) < d(i+1); a fall is an index i such that d(i) > d(i+1). The sequences A296694-A296696 partition the natural numbers. See the guide at A296712.

%H Clark Kimberling, <a href="/A296694/b296694.txt">Table of n, a(n) for n = 1..10000</a>

%e The base-4 digits of 143 are 2,0,3,3; here #(rises) = 1 and #(falls) = 1, so 143 is in the sequence.

%t z = 200; b = 4; d[n_] := Sign[Differences[IntegerDigits[n, b]]];

%t Select[Range [z], Count[d[#], -1] == Count[d[#], 1] &] (* A296694 *)

%t Select[Range [z], Count[d[#], -1] < Count[d[#], 1] &] (* A296695 *)

%t Select[Range [z], Count[d[#], -1] > Count[d[#], 1] &] (* A296696 *)

%Y Cf. A296695, A296696, A296700, A296712.

%K nonn,base

%O 1,2

%A _Clark Kimberling_, Dec 21 2017