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.

A129724 a(0) = 1; then a(n) = n!*(1 - (-1)^n*Bernoulli(n-1)).

Original entry on oeis.org

1, 2, 3, 7, 24, 116, 720, 5160, 40320, 350784, 3628800, 42940800, 479001600, 4650877440, 87178291200, 2833294464000, 20922789888000, -2166903606067200, 6402373705728000, 6808619561103360000, 2432902008176640000, -26982365129174827008000, 1124000727777607680000
Offset: 0

Views

Author

Paul Curtz, Jun 02 2007

Keywords

Crossrefs

Programs

  • GAP
    Concatenation([1], List([1..25], n-> Factorial(n)*(1 - (-1)^n*Bernoulli(n-1)) )); # G. C. Greubel, Dec 03 2019
  • Magma
    [n eq 0 select 1 else Factorial(n)*(1 - (-1)^n*Bernoulli(n-1)): n in [0..25]]; // G. C. Greubel, Dec 03 2019
    
  • Maple
    a:= proc(n)
          if n=0 and n>=0 then 1
        elif n mod 2 = 0 then n!*(1 - bernoulli(n-1))
        else n!*(1 + bernoulli(n-1))
          fi; end;
    seq(a(n), n=0..25); # modified by G. C. Greubel, Dec 03 2019
  • Mathematica
    a[0] = 1; a[n_]:= n!*(1-(-1)^n*BernoulliB[n-1]); Table[a[n], {n, 0, 22}] (* Jean-François Alcover, Sep 16 2013 *)
  • PARI
    a(n) = if(n==0, 1, n!*(1 - (-1)^n*bernfrac(n-1)) ); \\ G. C. Greubel, Dec 03 2019
    
  • Sage
    [1]+[factorial(n)*(1 - (-1)^n*bernoulli(n-1)) for n in (1..25)] # G. C. Greubel, Dec 03 2019
    

Extensions

Edited with simpler definition by N. J. A. Sloane, May 25 2008