A370924 Rectangular array, read by antidiagonals: row n consists of the numbers m whose ternary representation starts with 1 and has exactly n runs.
1, 4, 3, 13, 5, 10, 40, 9, 11, 30, 121, 12, 15, 32, 91, 364, 14, 16, 33, 92, 273, 1093, 17, 28, 34, 96, 275, 820, 3280, 27, 29, 46, 97, 276, 821, 2460, 9841, 36, 31, 47, 100, 277, 825, 2462, 7381, 29524, 39, 35, 48, 101, 289, 826, 2463, 7382, 22143
Offset: 1
Examples
Corner: 1 4 13 40 121 364 1093 3280 3 5 9 12 14 17 27 36 10 11 15 16 28 29 31 35 30 32 33 34 46 47 48 50 91 92 96 97 100 101 102 104 273 275 276 277 289 290 291 293 820 821 825 826 829 830 831 833
Programs
-
Mathematica
d[n_] := First[IntegerDigits[n, 3]]; a[n_] := a[n] = Select[Range[30000], d[#] == 1 && 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 *)
Comments