A384001 Irregular triangle T(n,j,k), j = 1..A024718(n), k = 1..n, where row 1 = {(0), (1)}, and row n = union of n-tuples whose sum s < n, and the n-tuples formed by appending s to the (n-1)-tuples in row n-1.
0, 1, 0, 0, 0, 1, 0, 2, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 3, 0, 1, 0, 0, 1, 1, 0, 1, 2, 0, 2, 0, 0, 2, 1, 1, 0, 0, 1, 0, 1, 1, 0, 2, 1, 1, 0, 1, 1, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 4, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 2
Offset: 1
Examples
Table begins: 1: (0), (1); 2: (0, 0), (0, 1), (0, 2), (1, 0), (1, 1); 3: (0,0,0), (0,0,1), (0,0,2), (0,0,3), (0,1,0), (0,1,1), (0,1,2), (0,2,0), (0,2,1), (1,0,0), (1,0,1), (1,0,2), (1,1,0), (1,1,1), (2,0,0) etc. Row 2 arranged as a rank 2 table, concatenating T(2,j,k), k = 1..2: 00 10 20 01 11 . Row 3 arranged as a rank 3 table, concatenating T(3,j,k), k = 1..3: 000 001 002 003 100 101 102 200 010 011 012 110 111 020 021
Programs
-
Mathematica
nn = 4; w[0] = {{0}}; Do[If[n == 1, Set[w[1], {{0}, {1}}], Set[w[n], Union@ Join[Select[Tuples[Range[0, n - 1], n], Total[#] < n &], Map[Append[#, n - Total[#]] &, w[n - 1] ] ] ] ], {n, nn}]; Flatten@ Array[w, nn]
Formula
Length of row n = n*A024718(n).
Comments