OFFSET
1,2
COMMENTS
Every positive integer occurs exactly once.
EXAMPLE
Corner:
1 2 4 8 13 26 40
3 5 6 7 9 12 14
10 11 15 16 19 20 21
30 32 33 34 46 47 48
91 92 96 97 100 101 102
273 275 276 277 289 290 291
820 821 825 826 829 830 831
2460 2462 2463 2464 2476 2477 2478
The ternary representation of 12 is 110, which has 2 runs: 11 and 0.
MATHEMATICA
a[n_] := a[n] = Select[Range[25000], Length[Split[IntegerDigits[#, 3]]] == n &];
t[n_, k_] := a[n][[k]];
Grid[Table[t[n, k], {n, 1, 10}, {k, 1, 10}]] (* array *)
Table[t[n - k + 1, k], {n, 10}, {k, n, 1, -1}] // Flatten (* sequence *)
CROSSREFS
KEYWORD
AUTHOR
Clark Kimberling, Mar 13 2024
STATUS
approved