OFFSET
0,3
LINKS
Alois P. Heinz and Vaclav Kotesovec, Table of n, a(n) for n = 0..168 (terms 0..100 from Alois P. Heinz)
FORMULA
a(n) = A258829(2n,n).
EXAMPLE
a(2) = 11: 1324, 1423, 1432, 2134, 2314, 2413, 2431, 3124, 3412, 3421, 4123.
MAPLE
b:= proc(u, o, c, k) option remember;
`if`(c<0 or c>k, 0, `if`(u+o=0, 1,
add(b(u-j, o-1+j, c+1, k), j=1..u)+
add(b(u+j-1, o-j, c-1, k), j=1..o)))
end:
a:= n-> b(2*n, 0$2, n)-b(2*n, 0$2, n-1):
seq(a(n), n=0..20);
MATHEMATICA
b[u_, o_, c_, k_] := b[u, o, c, k] = If[c < 0 || c > k, 0, If[u + o == 0, 1, Sum[b[u - j, o - 1 + j, c + 1, k], {j, 1, u}] + Sum[b[u + j - 1, o - j, c - 1, k], {j, 1, o}]]];
a[n_] := b[2n, 0, 0, n] - b[2n, 0, 0, n - 1];
a /@ Range[0, 20] (* Jean-François Alcover, Dec 29 2020, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Jan 06 2016
STATUS
approved