This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A297250 #4 Jan 15 2018 15:31:34 %S A297250 1,2,4,8,10,13,16,20,23,26,28,31,34,37,40,43,46,49,52,56,59,62,65,68, %T A297250 71,74,77,80,82,85,88,91,94,97,100,103,106,109,112,115,118,121,124, %U A297250 127,130,133,136,139,142,145,148,151,154,157,160,164,167,170,173 %N A297250 Numbers whose base-3 digits having equal up-variation and down-variation; see Comments. %C A297250 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. %H A297250 Clark Kimberling, <a href="/A297250/b297250.txt">Table of n, a(n) for n = 1..10000</a> %e A297250 173 in base-3: 2,0,1,0,2, having DV = 3, UV = 3, so that 173 is in the sequence. %t A297250 g[n_, b_] := Map[Total, GatherBy[Differences[IntegerDigits[n, b]], Sign]]; %t A297250 x[n_, b_] := Select[g[n, b], # < 0 &]; y[n_, b_] := Select[g[n, b], # > 0 &]; %t A297250 b = 3; z = 2000; p = Table[x[n, b], {n, 1, z}]; q = Table[y[n, b], {n, 1, z}]; %t A297250 w = Sign[Flatten[p /. {} -> {0}] + Flatten[q /. {} -> {0}]]; %t A297250 Take[Flatten[Position[w, -1]], 120] (* A297249 *) %t A297250 Take[Flatten[Position[w, 0]], 120] (* A297250 *) %t A297250 Take[Flatten[Position[w, 1]], 120] (* A297251 *) %Y A297250 Cf. A297249, A297251, A297330. %K A297250 nonn,base,easy %O A297250 1,2 %A A297250 _Clark Kimberling_, Jan 15 2018