login
A227850
Number of Dyck paths of semilength n*(4*n+1) in which the run length sequence is a permutation of {1,...,4*n}.
3
1, 4, 1248, 5401472, 114070692352, 7593330670240768
OFFSET
0,2
EXAMPLE
a(1) = 4: UUDUUUDDDD (2134), UUUDUUDDDD (3124), UUUUDDUDDD (4213), UUUUDDDUDD (4312).
MAPLE
h:= proc(n, s) option remember;
`if`(n>add(sort([s[]], `>`)[i], i=1..(nops(s)+1)/2), 0,
add(g(n-i, s minus {i}), i=select(x-> x<=n, s)))
end:
g:= proc(n, s) option remember;
`if`(s={}, `if`(n=0, 1, 0), add(h(n+i, s minus {i}), i=s))
end:
a:= n-> g(0, {$1..4*n}):
seq(a(n), n=0..3);
MATHEMATICA
h[n_, s_] := h[n, s] = If[n > Sum[Sort[s, Greater][[i]], {i, 1, (Length[s] + 1)/2}], 0, Sum[g[n - i, s ~Complement~ {i}], {i, Select[s, # <= n&]}] ];
g[n_, s_] := g[n, s] = If[s == {}, If[n == 0, 1, 0], Sum[h[n + i, s ~Complement~ {i}], {i, s}]];
a[n_] := g[0, Range[4*n]];
Table[a[n], {n, 0, 4}] (* Jean-François Alcover, Apr 23 2016, translated from Maple *)
CROSSREFS
KEYWORD
nonn,more
AUTHOR
STATUS
approved