OFFSET
0,7
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..895
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
KEYWORD
sign,frac,easy
AUTHOR
Aleksandar Petojevic, Sep 05 2000
EXTENSIONS
More terms from James A. Sellers, Sep 06 2000
STATUS
approved