OFFSET
0,4
COMMENTS
Equivalently the number of grand Dyck n-paths in which each run length is selected from {1..2*n} without replacement. - David Scambler, Apr 16 2013
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..200
FORMULA
It seems that a(n)=0 if n==1 or 2 (mod 4) and a(4*k)=4*k*a(4*k-1). - Benoit Cloitre, Aug 23 2002
MAPLE
b:= proc(n, i, c) option remember; `if`(abs(n)>i*(i+1)/2, 0,
`if`(i=0, `if`(abs(c)<2, 1, 0),
b(n+i, i-1, c+1) +b(n-i, i-1, c-1)))
end:
a:= n-> b(0, n, 0)*floor(n/2)!*ceil(n/2)!/2^irem(n, 2):
seq(a(n), n=0..40); # Alois P. Heinz, Apr 29 2015
MATHEMATICA
b[n_, i_, c_] := b[n, i, c] = If[Abs[n] > i*(i+1)/2, 0, If[i == 0, If[Abs[c]<2, 1, 0], b[n+i, i-1, c+1] + b[n-i, i-1, c-1]]]; a[n_] := b[0, n, 0]*Floor[n/2]! *Ceiling[n/2]!/2^Mod[n, 2]; Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Jun 12 2015, after Alois P. Heinz *)
PROG
(PARI) a(n)=sum(k=1, n!, if(sum(i=1, n, i*(-1)^component(numtoperm(n, k), i)), 0, 1))
CROSSREFS
KEYWORD
nonn
AUTHOR
Benoit Cloitre, Aug 23 2002
EXTENSIONS
More terms from John W. Layman, Feb 05 2003
a(14)-a(22) from Robert Gerbicz, Nov 22 2010
a(0), a(23)-a(30) from Alois P. Heinz, Apr 28 2015
STATUS
approved