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.

A056920 Denominators of continued fraction for left factorial.

Original entry on oeis.org

1, 1, 0, -1, -1, 1, 4, 1, -15, -19, 56, 151, -185, -1091, 204, 7841, 6209, -56519, -112400, 396271, 1520271, -2442439, -19165420, 7701409, 237686449, 145269541, -2944654296, -4833158329, 36392001815, 104056218421, -441823808804, -2002667085119, 5066513855745, 37109187217649
Offset: 0

Views

Author

Aleksandar Petojevic, Sep 05 2000

Keywords

Programs

  • GAP
    a:= function(n)
        if n<2 then return 1;
        else return a(n-1) - Int(n/2)*a(n-2);
        fi; end;
    List([0..40], n-> a(n) ); # G. C. Greubel, Dec 05 2019
  • Magma
    function a(n)
      if n lt 2 then return 1;
      else return a(n-1) - Floor(n/2)*a(n-2);
      end if; return a; end function;
    [a(n): n in [0..40]]; // G. C. Greubel, Dec 05 2019
    
  • Maple
    a:= proc(n) option remember;
       if n<2 then 1
       else a(n-1) - floor(n/2)*a(n-2)
       fi; end:
    seq(a(n), n=0..40); # G. C. Greubel, Dec 05 2019
  • Mathematica
    a[n_]:= a[n]= If[n<2, 1, a[n-1] -Floor[n/2]*a[n-2]]; Table[a[n], {n,0,40}] (* G. C. Greubel, Dec 05 2019 *)
  • PARI
    a(n) = if(n<2, n, a(n-1) - (n\2)*a(n-2) ); \\ G. C. Greubel, Dec 05 2019
    
  • Sage
    @CachedFunction
    def a(n):
        if (n<2): return 1
        else: return a(n-1) - floor(n/2)*a(n-2)
    [a(n) for n in (0..40)] # G. C. Greubel, Dec 05 2019
    

Formula

a(0)=1, a(1)=1, a(n) = a(n-1) - floor(n/2)*a(n-2).

Extensions

More terms from James Sellers, Sep 06 2000