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.

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

This page as a plain text file.
%I A297249 #5 Jan 15 2018 15:31:28
%S A297249 3,6,7,9,12,15,18,19,21,22,24,25,27,30,33,36,39,42,45,48,51,54,55,57,
%T A297249 58,60,61,63,64,66,67,69,70,72,73,75,76,78,79,81,84,87,90,93,96,99,
%U A297249 102,105,108,111,114,117,120,123,126,129,132,135,138,141,144,147
%N A297249 Numbers whose base-3 digits have greater down-variation than up-variation; see Comments.
%C A297249 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 A297249 Clark Kimberling, <a href="/A297249/b297249.txt">Table of n, a(n) for n = 1..10000</a>
%e A297249 147 in base-3:  1,3,1,1,0, having DV = 3, UV = 2, so that 147 is in the sequence.
%t A297249 g[n_, b_] := Map[Total, GatherBy[Differences[IntegerDigits[n, b]], Sign]];
%t A297249 x[n_, b_] := Select[g[n, b], # < 0 &]; y[n_, b_] := Select[g[n, b], # > 0 &];
%t A297249 b = 3; z = 2000; p = Table[x[n, b], {n, 1, z}]; q = Table[y[n, b], {n, 1, z}];
%t A297249 w = Sign[Flatten[p /. {} -> {0}] + Flatten[q /. {} -> {0}]];
%t A297249 Take[Flatten[Position[w, -1]], 120]   (* A297249 *)
%t A297249 Take[Flatten[Position[w, 0]], 120]    (* A297250 *)
%t A297249 Take[Flatten[Position[w, 1]], 120]    (* A297251 *)
%Y A297249 Cf. A297250, A297251, A297330.
%K A297249 nonn,base,easy
%O A297249 1,1
%A A297249 _Clark Kimberling_, Jan 15 2018