[go: up one dir, main page]

login
A073410
Number of permutations p of (1,2,3,...,n) such that 1*(-1)^p(1)+2*(-1)^p(2)+3*(-1)^p(3)+...+n*(-1)^p(n)=0.
2
1, 0, 0, 2, 8, 0, 0, 576, 4608, 0, 0, 2505600, 30067200, 0, 0, 53444966400, 855119462400, 0, 0, 3587014803456000, 71740296069120000, 0, 0, 584198928937451520000, 14020774294498836480000, 0, 0, 196340349691596912721920000, 5497529791364713556213760000, 0, 0
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
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
Cf. A227850.
Sequence in context: A230915 A242922 A242530 * A021361 A199156 A073001
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