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.
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
Keywords
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..200
Crossrefs
Cf. A227850.
Programs
-
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 *)
-
PARI
a(n)=sum(k=1,n!,if(sum(i=1,n,i*(-1)^component(numtoperm(n,k),i)),0,1))
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
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
Comments