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.

A176304 a(n) = (-1)^n * n * a(n-1) - 1, with a(0)=0.

Original entry on oeis.org

0, -1, -3, 8, 31, -156, -937, 6558, 52463, -472168, -4721681, 51938490, 623261879, -8102404428, -113433661993, 1701504929894, 27224078878303, -462809340931152, -8330568136760737, 158280794598454002
Offset: 0

Views

Author

Roger L. Bagula, Apr 14 2010

Keywords

Comments

The sequence alternates in the sign and in the odd-even parity.

Programs

  • Magma
    function a(n)
      if n eq 0 then return 0;
      else return (-1)^n*n*a(n-1) -1;
      end if; return a; end function;
    [a(n): n in [0..20]]; // G. C. Greubel, Nov 26 2019
    
  • Maple
    a(n):=`if`(n=0, 0, (-1)^n*n*a(n-1) -1); seq(a(n), n=0..20); # G. C. Greubel, Nov 26 2019
  • Mathematica
    a[n_]:= a[n] = If[n==0, 0, (-1)^n*n*a[n-1] -1]; Table[a[n], {n, 0, 20}]
  • PARI
    a(n) = if(n==0, 0, (-1)^n*n*a(n-1) -1); \\ G. C. Greubel, Nov 26 2019
    
  • Sage
    @CachedFunction
    def a(n):
        if (n==0): return 0
        else: return (-1)^n*n*a(n-1) -1
    [a(n) for n in (0..20)] # G. C. Greubel, Nov 26 2019