OFFSET
0,3
COMMENTS
The sequence alternates in the sign and in the odd-even parity.
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..445
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}]
PROG
(PARI) a(n) = if(n==0, 0, (-1)^n*n*a(n-1) -1); \\ G. C. Greubel, Nov 26 2019
(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
(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
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Roger L. Bagula, Apr 14 2010
STATUS
approved