OFFSET
1,5
LINKS
Alois P. Heinz, Rows n = 1..141, flattened
A. Knopfmacher and H. Prodinger, On Carlitz compositions, European Journal of Combinatorics, Vol. 19, 1998, pp. 579-589.
FORMULA
G.f.: 1/(1 - Sum_{k>0} (-1)^(k+1)*x^k*y^k/(1-x^k).
EXAMPLE
T(6,3) = 7 because the compositions of 6 into 3 parts with no adjacent equal parts are 3+2+1, 3+1+2, 2+3+1, 2+1+3, 1+3+2, 1+2+3, 1+4+1.
Triangle begins:
1;
1, 0;
1, 2, 0;
1, 2, 1, 0;
1, 4, 2, 0, 0;
1, 4, 7, 2, 0, 0;
1, 6, 9, 6, 1, 0, 0;
1, 6, 15, 14, 3, 0, 0, 0;
1, 8, 21, 24, 15, 2, 0, 0, 0;
...
MAPLE
b:= proc(n, h, t) option remember;
if n<t then 0
elif n=0 then `if`(t=0, 1, 0)
else add(`if`(h=j, 0, b(n-j, j, t-1)), j=1..n)
fi
end:
T:= (n, k)-> b(n, -1, k):
seq(seq(T(n, k), k=1..n), n=1..15); # Alois P. Heinz, Oct 23 2011
MATHEMATICA
nn=10; CoefficientList[Series[1/(1-Sum[y x^i/(1+y x^i), {i, 1, nn}]), {x, 0, nn}], {x, y}]//Grid (* Geoffrey Critzer, Nov 23 2013 *)
PROG
(PARI)
gf(n, y)={1/(1 - sum(k=1, n, (-1)^(k+1)*x^k*y^k/(1-x^k) + O(x*x^n)))}
for(n=1, 10, my(p=polcoeff(gf(n, y), n)); for(k=1, n, print1(polcoeff(p, k), ", ")); print); \\ Andrew Howroyd, Oct 12 2017
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Christian G. Bower, Apr 29 2005
STATUS
approved