A297250 Numbers whose base-3 digits having equal up-variation and down-variation; see Comments.
1, 2, 4, 8, 10, 13, 16, 20, 23, 26, 28, 31, 34, 37, 40, 43, 46, 49, 52, 56, 59, 62, 65, 68, 71, 74, 77, 80, 82, 85, 88, 91, 94, 97, 100, 103, 106, 109, 112, 115, 118, 121, 124, 127, 130, 133, 136, 139, 142, 145, 148, 151, 154, 157, 160, 164, 167, 170, 173
Offset: 1
Examples
173 in base-3: 2,0,1,0,2, having DV = 3, UV = 3, so that 173 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