cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

Original entry on oeis.org

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

Views

Author

Benoit Cloitre, Aug 23 2002

Keywords

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

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