OFFSET
0,2
COMMENTS
FORMULA
T(n,k) = Sum_{j=0..n-3k} binomial(-(k-1),j) * binomial(j,(n-3k-j)/2) * (-3)^((3j+3k-n)/2). - Max Alekseyev
G.f.: G(t,z) = 1/(1-3z+z^3-tz^3).
Recurrence relation: T(n,k) = 3*T(n-1,k) - T(n-3,k) + T(n-3,k-1) for n >= 3.
EXAMPLE
T(4,1)=6 because we have 0012, 0120, 0121, 0122, 1012 and 2012.
Triangle starts:
1;
3;
9;
26, 1;
75, 6;
216, 27;
622, 106, 1;
MAPLE
G:=1/(1-3*z+z^3-t*z^3): Gser:=simplify(series(G, z=0, 20)): P[0]:=1: for n from 1 to 15 do P[n]:=sort(coeff(Gser, z^n)) od: for n from 0 to 15 do seq(coeff(P[n], t, j), j=0..floor(n/3)) od; # yields sequence in triangular form
PROG
(PARI) { T(n, k) = sum(j=0, n-3*k, if((n-3*k-j)%2, 0, binomial(-(k-1), j) *
binomial(j, (n-3*k-j)/2) * (-3)^((3*j+3*k-n)/2) )) } \\ Max Alekseyev
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Emeric Deutsch, May 26 2006
STATUS
approved