%I #7 Aug 02 2023 11:49:06
%S 2,6,1,8,3,4,18,5,12,13,20,7,14,39,40,24,9,22,41,120,121,26,10,31,67,
%T 122,363,364,54,11,36,94,202,365,1092,1093,56,15,37,117,283,607,1094,
%U 3279,3280,60,16,38,118,360,850,1822,3281,9840,9841,62,17,42,119
%N Rectangular array by descending antidiagonals: row n consists of the numbers k such that n = 1 + maximal runlength of 1's in the ternary representation of k.
%C Every positive integer occurs exactly once.
%e Corner:
%e 2 6 8 18 20 24 26
%e 1 3 5 7 9 10 11
%e 4 12 14 22 31 36 37
%e 13 39 41 67 94 117 118
%e 40 120 122 202 283 360 361
%e 121 363 365 607 850 1089 1090
%e Let r(n) = maximal runlength of 1's in the ternary representation of n, for n >= 1, so that (r(n)) = (1,0,1,2,1,0,1,0,1,...). Thus, r(4)=2, so the first term in row 3 of the array is 4.
%t d[n_] := d[n] = First[RealDigits[n, 3]]; f[w_] := FromDigits[w, 3];
%t s = Map[Split, Table[d[n], {n, 1, 50000}]];
%t x[n_] := Select[s, MemberQ[#, Table[1, n]] &];
%t u[n_] := Map[Flatten, x[n]];
%t t0 = Select[Range[1, 4000], DigitCount[#, 3, 1] == 0 &, 20];
%t v = Table[Take[Map[f, u[n]], Min[{20, Length[u[n]]}]], {n, 1, 11}]
%t t = Join[{t0}, v]
%t TableForm[t] (* this sequence as an array *)
%t Table[t[[n - k + 1, k]], {n, 11}, {k, n, 1, -1}] // Flatten (* this sequence *)
%Y Cf. A000244 (column 1), A032924 (row 1), A363995.
%K nonn,tabl,base
%O 1,1
%A _Clark Kimberling_, Jul 01 2023
|