login
A056920
Denominators of continued fraction for left factorial.
3
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,7
LINKS
FORMULA
a(0)=1, a(1)=1, a(n) = a(n-1) - floor(n/2)*a(n-2).
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 *)
PROG
(PARI) a(n) = if(n<2, n, a(n-1) - (n\2)*a(n-2) ); \\ 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
(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
(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
CROSSREFS
Sequence in context: A159764 A124029 A207823 * A123382 A197653 A146160
KEYWORD
sign,frac,easy
AUTHOR
EXTENSIONS
More terms from James A. Sellers, Sep 06 2000
STATUS
approved