login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A328141
a(n) = a(n-1) - (n-2)*a(n-2), with a(0)=1, a(1)=2.
2
1, 2, 2, 0, -4, -4, 12, 32, -40, -264, 56, 2432, 1872, -24880, -47344, 276096, 938912, -3202528, -18225120, 36217856, 364270016, -323869248, -7609269568, -808015360, 166595915136, 185180268416, -3813121694848, -8442628405248, 90698535660800, 318649502602496, -2220909495899904
OFFSET
0,2
COMMENTS
Former title and formula of A122033, but not the data.
LINKS
FORMULA
a(n) = a(n-1) - (n-2)*a(n-2), with a(0)=1, a(1)=2.
E.g.f.: 1 + sqrt(2*e*Pi)*( erf(1/sqrt(2)) + erf((x-1)/sqrt(2)) ), where erf(x) is the error function.
a(n) = 2*(-1)^(n-1)*A001464(n-1).
a(n) = 2*(1/sqrt(2))^(n-1) * Hermite(n-1, 1/sqrt(2)), n > 0.
MAPLE
a:= proc (n) option remember;
if n < 2 then n+1
else a(n-1) - (n-2)*a(n-2)
fi;
end proc; seq(a(n), n = 0..35);
MATHEMATICA
a[n_]:= a[n]= If[n<2, n+1, a[n-1]-(n-2)*a[n-2]]; Table[a[n], {n, 0, 35}]
PROG
(PARI) my(m=35, v=concat([1, 2], vector(m-2))); for(n=3, m, v[n] = v[n-1] - (n-3)*v[n-2] ); v
(Magma) I:=[1, 2]; [n le 2 select I[n] else Self(n-1) - (n-3)*Self(n-2): n in [1..35]];
(Sage)
def a(n):
if n<2: return n+1
else: return a(n-1) - (n-2)*a(n-2)
[a(n) for n in (0..35)]
(GAP) a:=[1, 2];; for n in [3..35] do a[n]:=a[n-1]-(n-3)*a[n-2]; od; a;
CROSSREFS
KEYWORD
sign
AUTHOR
G. C. Greubel, Oct 04 2019
STATUS
approved