OFFSET
1,4
LINKS
Alois P. Heinz, Rows n = 1..141, flattened
FORMULA
G.f. for k-th column: (1-x)^2*x^k/((1-x-x^k)*(1-x-x^(k+1))).
EXAMPLE
1;
1, 1;
3, 0, 1;
6, 1, 0, 1;
13, 2, 0, 0, 1;
27, 3, 1, 0, 0, 1;
56, 5, 2, 0, 0, 0, 1;
MAPLE
p:= (t, l)-> zip((x, y)->x+y, t, l, 0):
b:= proc(n) option remember; local j, t, h, m, s;
t:= [0$(n-1), 1];
for j to n-1 do
h:= b(n-j);
m:= nops(h);
t:= p(p(t, [seq(h[i], i=1..min(j, m))]),
[0$(j-1), add(h[i], i=j+1..m)])
od; t
end:
T:= n-> b(n)[]:
seq(T(n), n=1..15); # Alois P. Heinz, Nov 13 2011
MATHEMATICA
zip[f_, x_, y_, z_] := With[{m = Max[Length[x], Length[y]]}, Thread[f[PadRight[x, m, z], PadRight[y, m, z]]]]; p[t_, l_] := zip[Plus, t, l, 0]; b[n_] := b[n] = Module[{j, t, h, m, s}, t = Append[Array[0&, n-1], 1]; For[j = 1, j <= n-1 , j++, h = b[n-j]; m = Length[h]; t = p[p[t, h[[1 ;; Min[j, m]]]], Append[Array[0&, j-1], h[[Min[j, m]+1 ;; m]] // Total]]]; t]; Table[b[n], {n, 1, 15}] // Flatten (* Jean-François Alcover, Jan 29 2014, after Alois P. Heinz *)
CROSSREFS
KEYWORD
AUTHOR
Vladeta Jovovic, Apr 10 2005
STATUS
approved