OFFSET
1,1
COMMENTS
Every positive integer occurs exactly once.
EXAMPLE
Corner:
2 6 8 18 20 24 26
1 3 5 7 9 10 11
4 12 14 22 31 36 37
13 39 41 67 94 117 118
40 120 122 202 283 360 361
121 363 365 607 850 1089 1090
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.
MATHEMATICA
d[n_] := d[n] = First[RealDigits[n, 3]]; f[w_] := FromDigits[w, 3];
s = Map[Split, Table[d[n], {n, 1, 50000}]];
x[n_] := Select[s, MemberQ[#, Table[1, n]] &];
u[n_] := Map[Flatten, x[n]];
t0 = Select[Range[1, 4000], DigitCount[#, 3, 1] == 0 &, 20];
v = Table[Take[Map[f, u[n]], Min[{20, Length[u[n]]}]], {n, 1, 11}]
t = Join[{t0}, v]
TableForm[t] (* this sequence as an array *)
Table[t[[n - k + 1, k]], {n, 11}, {k, n, 1, -1}] // Flatten (* this sequence *)
CROSSREFS
KEYWORD
AUTHOR
Clark Kimberling, Jul 01 2023
STATUS
approved