OFFSET
1,2
COMMENTS
T(n,k) is defined for all n >= 0, k >= 1. The triangle contains only the positive terms. T(n,k) = 0 if k > n*(n+1)/2.
The sequence of column k satisfies a linear recurrence with constant coefficients of order 3*A000593(k).
LINKS
Alois P. Heinz, Rows n = 1..50, flattened
FORMULA
T(n+1,n*(n+1)/2+1) = A000009(n) for n >= 0.
EXAMPLE
The subsets of [4] whose sum is divisible by 3 are: {}, {3}, {1,2}, {2,4}, {1,2,3}, {2,3,4}. The sum of their elements is 0 + 3 + 3 + 6 + 6 + 9 = 27. So T(4,3) = 27/3 = 9.
Triangle T(n,k) begins:
1;
6, 1, 1;
24, 6, 4, 1, 1, 1;
80, 20, 9, 4, 4, 2, 2, 1, 1, 1;
240, 60, 30, 14, 12, 7, 5, 3, 3, 3, 2, 2, 1, 1, 1;
...
MAPLE
b:= proc(n, m, s) option remember; `if`(n=0, [`if`(s=0, 1, 0), 0],
b(n-1, m, s) +(g-> g+[0, g[1]*n])(b(n-1, m, irem(s+n, m))))
end:
T:= (n, k)-> b(n, k, 0)[2]/k:
seq(seq(T(n, k), k=1..n*(n+1)/2), n=1..10);
# second Maple program:
b:= proc(n, s) option remember; `if`(n=0, add(s/d *x^d,
d=numtheory[divisors](s)), b(n-1, s)+b(n-1, s+n))
end:
T:= n-> (p-> seq(coeff(p, x, i), i=1..degree(p)))(b(n, 0)):
seq(T(n), n=1..10);
MATHEMATICA
b[n_, m_, s_] := b[n, m, s] = If[n == 0, {If[s == 0, 1, 0], 0}, b[n-1, m, s] + Function[g, g + {0, g[[1]] n}][b[n-1, m, Mod[s+n, m]]]];
T[n_, k_] := b[n, k, 0][[2]]/k;
Table[T[n, k], {n, 1, 10}, {k, 1, n(n+1)/2}] // Flatten (* Jean-François Alcover, Oct 04 2019, after Alois P. Heinz *)
CROSSREFS
KEYWORD
AUTHOR
Alois P. Heinz, Jul 20 2019
STATUS
approved