cp's OEIS Frontend

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.

A297251 Numbers whose base-3 digits have greater up-variation than down-variation; see Comments.

This page as a plain text file.
%I A297251 #4 May 26 2018 22:46:19
%S A297251 5,11,14,17,29,32,35,38,41,44,47,50,53,83,86,89,92,95,98,101,104,107,
%T A297251 110,113,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,
%U A297251 161,245,248,251,254,257,260,263,266,269,272,275,278,281,284,287,290
%N A297251 Numbers whose base-3 digits have greater up-variation than down-variation; see Comments.
%C A297251 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 A297251 Clark Kimberling, <a href="/A297251/b297251.txt">Table of n, a(n) for n = 1..10000</a>
%e A297251 290 in base-3:  1,0,1,2,0,2, having DV = 3, UV = 4, so that 147 is in the sequence.
%t A297251 g[n_, b_] := Map[Total, GatherBy[Differences[IntegerDigits[n, b]], Sign]];
%t A297251 x[n_, b_] := Select[g[n, b], # < 0 &]; y[n_, b_] := Select[g[n, b], # > 0 &];
%t A297251 b = 3; z = 2000; p = Table[x[n, b], {n, 1, z}]; q = Table[y[n, b], {n, 1, z}];
%t A297251 w = Sign[Flatten[p /. {} -> {0}] + Flatten[q /. {} -> {0}]];
%t A297251 Take[Flatten[Position[w, -1]], 120]   (* A297249 *)
%t A297251 Take[Flatten[Position[w, 0]], 120]    (* A297250 *)
%t A297251 Take[Flatten[Position[w, 1]], 120]    (* A297251 *)
%Y A297251 Cf. A297249, A297250, A297330.
%K A297251 nonn,base,easy
%O A297251 1,1
%A A297251 _Clark Kimberling_, Apr 10 2018