|
|
A297251
|
|
Numbers whose base-3 digits have greater up-variation than down-variation; see Comments.
|
|
4
|
|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
Suppose that n has base-b digits b(m), b(m-1), ..., b(0). The base-b down-variation of n is the sum DV(n,b) of all d(i)-d(i-1) for which d(i) > d(i-1); the base-b up-variation of n is the sum UV(n,b) of all d(k-1)-d(k) for which d(k) < d(k-1). The total base-b variation of n is the sum TV(n,b) = DV(n,b) + UV(n,b). See the guide at A297330.
|
|
LINKS
|
|
|
EXAMPLE
|
290 in base-3: 1,0,1,2,0,2, having DV = 3, UV = 4, so that 147 is in the sequence.
|
|
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 *)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|