OFFSET
0,4
COMMENTS
LINKS
Alois P. Heinz, Rows n = 0..17, flattened
Eric Weisstein's World of Mathematics, Matching-Generating Polynomial
Wikipedia, Matching (graph theory)
Wikipedia, Triangular grid graph
FORMULA
EXAMPLE
Triangle T(n,k) begins:
1;
1;
1, 3;
1, 9, 15, 2;
1, 18, 99, 193, 108, 6;
1, 30, 333, 1734, 4416, 5193, 2331, 240;
1, 45, 825, 8027, 45261, 151707, 298357, 327237, 180234, 40464, 2238;
MAPLE
b:= proc(l) option remember; local n, k; n:= nops(l);
if n=0 then 1
elif min(l)>0 then b(subsop(-1=NULL, map(h-> h-1, l)))
else for k to n while l[k]>0 do od; b(subsop(k=1, l))+
expand(x*(`if`(k<n, b(subsop(k=2, l)), 0)+
`if`(k<n and l[k+1]=0, b(subsop(k=1, k+1=1, l)), 0)+
`if`(k>1 and l[k-1]=1, b(subsop(k=1, k-1=2, l)), 0)))
fi
end:
T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b([0$n])):
seq(T(n), n=0..10);
MATHEMATICA
b[l_] := b[l] = Module[{n = Length[l], k}, Which[n == 0, 1, Min[l] > 0, b[ReplacePart[l - 1, -1 -> Nothing]], True, For[k = 1, k <= n && l[[k]] > 0, k++]; b[ReplacePart[l, k -> 1]] + x*Expand[If[k < n, b[ReplacePart[l, k -> 2]], 0] + If[k < n && l[[k + 1]] == 0, b[ReplacePart[l, {k -> 1, k + 1 -> 1}]], 0] + If[k > 1 && l[[k - 1]] == 1, b[ReplacePart[l, {k -> 1, k - 1 -> 2}]], 0]]]];
T[n_] := Table[Coefficient[#, x, i], {i, 0, Exponent[#, x]}]&[b[Table[0, n] ]];
Table[T[n], {n, 0, 10}] // Flatten (* Jean-François Alcover, May 24 2018, translated from Maple *)
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Alois P. Heinz, Jun 18 2017
STATUS
approved