OFFSET
0,4
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..30
FORMULA
a(n) = (2n)! - A269021(n).
a(n) = A214015(2n,n-1) for n>0.
a(n) ~ (2*n)!. - Vaclav Kotesovec, Mar 26 2016
EXAMPLE
a(2) = 1: 4321.
a(3) = 132: 165432, 216543, 261543, 265143, 265413, 265431, 316542, ..., 653412, 653421, 654132, 654213, 654231, 654312, 654321.
MAPLE
h:= proc(l) (n-> add(i, i=l)!/mul(mul(1+l[i]-j+add(`if`(
l[k]>=j, 1, 0), k=i+1..n), j=1..l[i]), i=1..n))(nops(l))
end:
g:= (n, i, l)-> `if`(n=0 or i=1, h([l[], 1$n])^2, `if`(i<1, 0,
add(g(n-i*j, i-1, [l[], i$j]), j=0..n/i))):
a:= n-> `if`(n=0, 0, g(2*n, n-1, [])):
seq(a(n), n=0..15);
MATHEMATICA
h[l_] := Function[n, Total[l]!/Product[Product[1+l[[i]]-j+Sum[If[l[[k]] >= j, 1, 0], { k, i+1, n}], {j, 1, l[[i]]}], {i, 1, n}]][Length[l]];
g[n_, i_, l_] := If[n == 0 || i == 1, h[Join[l, Table[1, {n}]]]^2, If[i < 1, 0, Sum[g[n - i*j, i-1, Join[l, Table[i, {j}]]], {j, 0, n/i}]]];
a[n_] := If[n == 0, 0, g[2n, n-1, {}]];
Table[a[n], {n, 0, 15}] (* Jean-François Alcover, Apr 01 2017, translated from Maple *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Feb 18 2016
STATUS
approved