OFFSET
0,18
LINKS
Alois P. Heinz, Rows n = 0..200, flattened
FORMULA
T(n,n) = 1.
T(n,k) = T(n-k,k+1) + T(n-k,k-1) for 0 < k < n.
T(n,k) = 0 for n < k.
T(n,0) = 0 for 0 < n.
EXAMPLE
Triangle begins:
1;
0, 1;
0, 0, 1;
0, 1, 1, 1;
0, 1, 0, 0, 1;
0, 0, 2, 1, 0, 1;
0, 2, 1, 1, 0, 0, 1;
0, 1, 1, 1, 1, 0, 0, 1;
0, 1, 3, 2, 0, 0, 0, 0, 1;
0, 3, 2, 1, 2, 1, 0, 0, 0, 1;
0, 2, 3, 2, 1, 0, 0, 0, 0, 0, 1;
...
For n = 6 there are a total of 5 compositions:
T(6,1) = 2: (123), (1212)
T(6,2) = 1: (2121)
T(6,3) = 1: (321)
T(6,6) = 1: (6)
MAPLE
T:= proc(n, i) option remember; `if`(n<1 or i<1, 0,
`if`(n=i, 1, add(T(n-i, i+j), j=[-1, 1])))
end: T(0$2):=1:
seq(seq(T(n, k), k=0..n), n=0..14); # Alois P. Heinz, Aug 08 2023
PROG
CROSSREFS
KEYWORD
AUTHOR
John Tyler Rascoe, Aug 06 2023
STATUS
approved