OFFSET
0,2
COMMENTS
Equivalently, T(n,k) is the number of ways to arrange n children in a line so that exactly k children are in between two children of opposite gender than their own. Children on the ends of the line cannot be counted as "in between".
Row sums = 2^n.
Column k=0 is A128588.
LINKS
Alois P. Heinz, Rows n = 0..150, flattened
FORMULA
G.f.: 1/(1 - 2*x - 2*(y-1)*x^3/(1 - (y-1)*x - (y-1)*x^2) ).
EXAMPLE
Triangle T(n,k) begins:
1;
2;
4;
6, 2;
10, 4, 2;
16, 10, 4, 2;
26, 20, 12, 4, 2;
42, 40, 26, 14, 4, 2;
68, 76, 58, 32, 16, 4, 2;
110, 142, 120, 78, 38, 18, 4, 2,
178, 260, 244, 172, 100, 44, 20, 4, 2;
T(4,1) = 4 because we have: BBGB, BGBB, GBGG, GGBG.
T(4,2) = 2 because we have: BGBG, GBGB.
MAPLE
b:= proc(n, t) option remember; `if`(n=0, 1, expand(
b(n-1, [4, 3, 4, 4, 3][t])*`if`(t=5, x, 1)+
b(n-1, [2, 2, 5, 5, 2][t])*`if`(t=3, x, 1)))
end:
T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 1)):
seq(T(n), n=0..16); # Alois P. Heinz, May 18 2014
MATHEMATICA
nn=10; sol=Solve[{A==va(z^3+z^2A+z B), B==va(z^3+z^2 B + z A)}, {A, B}]; Fz[z_, y_]:=Simplify[1/(1-2z-A-B)/.sol/.va->y-1]; Map[Select[#, #>0&]&, Level[CoefficientList[Series[Fz[z, y], {z, 0, nn}], {z, y}], {2}]]//Grid
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Geoffrey Critzer, May 18 2014
STATUS
approved