A322156 Irregular triangle where row n includes all decreasing sequences S = {k_0 = n, k_1, k_2, ..., k_m} in reverse lexicographic order such that the sum of subsequent terms k_j for all i < j <= m does not exceed any k_i.
1, 1, 1, 2, 2, 1, 2, 1, 1, 2, 2, 3, 3, 1, 3, 1, 1, 3, 2, 3, 2, 1, 3, 3, 4, 4, 1, 4, 1, 1, 4, 2, 4, 2, 1, 4, 2, 1, 1, 4, 2, 2, 4, 3, 4, 3, 1, 4, 4, 5, 5, 1, 5, 1, 1, 5, 2, 5, 2, 1, 5, 2, 1, 1, 5, 2, 2, 5, 3, 5, 3, 1, 5, 3, 1, 1, 5, 3, 2, 5, 4, 5, 4, 1, 5, 5, 6, 6, 1, 6, 1, 1, 6, 2, 6, 2, 1, 6, 2, 1, 1, 6, 2, 2, 6
Offset: 1
Examples
Triangle begins: 1; 1,1; 2; 2,1; 2,1,1; 2,2; 3; 3,1; 3,1,1; 3,2; 3,2,1; 3,3; 4; 4,1; 4,1,1; 4,2; 4,2,1; 4,2,1,1; 4,2,2; 4,3; 4,3,1; 4,4; ... Row n = 5 starts with S_1 = 5. We append 1 to get {5,1}. 1 does not exceed 5, thus S_2 = {5,1}. We append 1 to get {5,1,1}. A = {1,2}; {5,1}-{2,1} = {3,0}, thus S_3 = {5,1,1} and we drop the last term and increment the new last term to get {5,2}. S_4 = {5,2}, and the ensuing terms {5,2,1}, {5,2,1,1}, {5,2,2} enter into the row. Since there are repeated terms at the last sequence, we drop the last term and increment the new last to get {5,3}. The terms {5,3,1}, {5,3,1,1}, {5,3,2}, {5,3,2,1}, are admitted. {5,3,2,1,1} has A = {1,2,4,6}. {5,3,2,1}-{6,4,2,1} = {-1,1,0,0}: {5,3,2,1,1} cannot be admitted, so we drop the last term and increment to {5,3,2,2} but the sum of the last two terms exceeds the second and we drop the last term and increment to {5,3,3}. For similar reasons, this cannot be admitted, so we drop the last term and increment to {5,4}. This enters as well as {5,4,1}. Since any appendage or increment proves invalid, we end up incrementing to {5,5}. The two terms are the same, therefore we end the row n = 5.
Links
- Michael De Vlieger, Table of n, a(n) for n = 1..10055 (rows 1 <= n <= 21, flattened)
- Michael De Vlieger, Illustration for A322156
- Michael De Vlieger, Rows 1 <= n <= 30, sequences S in row n have terms k that are space delimited
Programs
-
Mathematica
(* Generate sequence: *) f[n_] := Block[{w = {n}, c}, c[x_] := Apply[Times, Most@ x - Reverse@ Accumulate@ Reverse@ Rest@ x]; Reap[Do[Which[And[Length@ w == 2, SameQ @@ w], Sow[w]; Break[], Length@ w == 1, Sow[w]; AppendTo[w, 1], c[w] > 0, Sow[w]; AppendTo[w, 1], True, Sow[w]; w = MapAt[1 + # &, Drop[w, -1], -1]], {i, Infinity}] ][[-1, 1]] ]; Array[f, 6] // Flatten (* Convert S = row n to standard partition: *) g[w_] := Block[{k}, k = Total@ w; Total@ Map[Apply[Function[{s, t}, s Array[Boole[t <= # <= s + t - 1] &, k] ], #] &, Apply[Join, Prepend[Table[Function[{v, c}, Map[{w[[k]], # + 1} &, Map[Total[v #] &, Tuples[{0, 1}, {Length@ v}]]]] @@ {Most@ #, ConstantArray[1, Length@ # - 1]} &@ Take[w, k], {k, 2, Length@ w}], {{w[[1]], 1}}]]] ]
Comments