login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

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

%I #5 Jan 15 2018 15:31:28

%S 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 58,60,61,63,64,66,67,69,70,72,73,75,76,78,79,81,84,87,90,93,96,99,

%U 102,105,108,111,114,117,120,123,126,129,132,135,138,141,144,147

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

%C 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 Clark Kimberling, <a href="/A297249/b297249.txt">Table of n, a(n) for n = 1..10000</a>

%e 147 in base-3: 1,3,1,1,0, having DV = 3, UV = 2, so that 147 is in the sequence.

%t g[n_, b_] := Map[Total, GatherBy[Differences[IntegerDigits[n, b]], Sign]];

%t x[n_, b_] := Select[g[n, b], # < 0 &]; y[n_, b_] := Select[g[n, b], # > 0 &];

%t b = 3; z = 2000; p = Table[x[n, b], {n, 1, z}]; q = Table[y[n, b], {n, 1, z}];

%t w = Sign[Flatten[p /. {} -> {0}] + Flatten[q /. {} -> {0}]];

%t Take[Flatten[Position[w, -1]], 120] (* A297249 *)

%t Take[Flatten[Position[w, 0]], 120] (* A297250 *)

%t Take[Flatten[Position[w, 1]], 120] (* A297251 *)

%Y Cf. A297250, A297251, A297330.

%K nonn,base,easy

%O 1,1

%A _Clark Kimberling_, Jan 15 2018