login
A296691
Numbers whose base-3 digits d(m), d(m-1), ... d(0) have #(rises) = #(falls); see Comments.
4
1, 2, 4, 8, 10, 11, 13, 15, 16, 19, 20, 23, 26, 28, 29, 31, 35, 37, 38, 40, 42, 43, 45, 49, 51, 52, 55, 56, 58, 62, 68, 71, 73, 74, 77, 80, 82, 83, 85, 89, 91, 92, 94, 96, 97, 100, 101, 104, 107, 109, 110, 112, 116, 118, 119, 121, 123, 124, 126, 130, 132
OFFSET
1,2
COMMENTS
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 A296691-A296693 partition the natural numbers. See the guide at A296712.
LINKS
EXAMPLE
The base-3 digits of 132 are 1,1,2,2,0; here #(rises) = #(falls) = 1, so 132 is in the sequence.
MATHEMATICA
z = 200; b = 3; d[n_] := Sign[Differences[IntegerDigits[n, b]]];
Select[Range [z], Count[d[#], -1] == Count[d[#], 1] &] (* A296691 *)
Select[Range [z], Count[d[#], -1] < Count[d[#], 1] &] (* A296692 *)
Select[Range [z], Count[d[#], -1] > Count[d[#], 1] &] (* A296693 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Clark Kimberling, Dec 19 2017
STATUS
approved