A297251 Numbers whose base-3 digits have greater up-variation than down-variation; see Comments.
5, 11, 14, 17, 29, 32, 35, 38, 41, 44, 47, 50, 53, 83, 86, 89, 92, 95, 98, 101, 104, 107, 110, 113, 116, 119, 122, 125, 128, 131, 134, 137, 140, 143, 146, 149, 152, 155, 158, 161, 245, 248, 251, 254, 257, 260, 263, 266, 269, 272, 275, 278, 281, 284, 287, 290
Offset: 1
Examples
290 in base-3: 1,0,1,2,0,2, having DV = 3, UV = 4, so that 147 is in the sequence.
Links
- Clark Kimberling, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
g[n_, b_] := Map[Total, GatherBy[Differences[IntegerDigits[n, b]], Sign]]; x[n_, b_] := Select[g[n, b], # < 0 &]; y[n_, b_] := Select[g[n, b], # > 0 &]; b = 3; z = 2000; p = Table[x[n, b], {n, 1, z}]; q = Table[y[n, b], {n, 1, z}]; w = Sign[Flatten[p /. {} -> {0}] + Flatten[q /. {} -> {0}]]; Take[Flatten[Position[w, -1]], 120] (* A297249 *) Take[Flatten[Position[w, 0]], 120] (* A297250 *) Take[Flatten[Position[w, 1]], 120] (* A297251 *)
Comments