login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A122033 a(n) = 2*a(n-1) - 2*(n-2)*a(n-2), with a(0)=1, a(1)=2. 2
1, 2, 4, 4, -8, -40, -16, 368, 928, -3296, -21440, 16448, 461696, 561536, -9957632, -34515200, 209783296, 1455022592, -3803020288, -57076808704, 22755112960, 2214428956672, 3518653394944, -85968709390336, -326758168158208, 3301044295639040, 22286480662872064 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
LINKS
FORMULA
a(n) = 2*a(n-1) - 2*(n-2)*a(n-2), with a(0)=1, a(1)=2. - G. C. Greubel, Oct 04 2019
a(n) = 2*A062267(n-1) for n > 0. - Michel Marcus, Oct 05 2019
E.g.f.: 1 + exp(1)*sqrt(Pi)*( erf(1) - erf(1-x) ), where erf(x) is the error function. - G. C. Greubel, Oct 05 2019
MAPLE
a:= proc(n) option remember;
if n < 2 then n+1
else 2*(a(n-1) - (n-2)*a(n-2))
fi
end proc:
seq(a(n), n = 0..35); # G. C. Greubel, Oct 04 2019
MATHEMATICA
a[n_]:= a[n]= If[n<2, n+1, a[n-1]-(n-2)*a[n-2]]; Table[a[n], {n, 0, 30}] (* modified by G. C. Greubel, Oct 04 2019 *)
nxt[{n_, a_, b_}]:={n+1, b, 2b-2a(n-1)}; NestList[nxt, {1, 1, 2}, 30][[;; , 2]] (* Harvey P. Dale, Jan 01 2024 *)
PROG
(PARI) my(m=35, v=concat([1, 2], vector(m-2))); for(n=3, m, v[n] = 2*(v[n-1] - (n-3)*v[n-2] ) ); v \\ G. C. Greubel, Oct 04 2019
(Magma) I:=[1, 2]; [n le 2 select I[n] else 2*(Self(n-1)-(n-3)*Self(n-2)): n in [1..35]]; // G. C. Greubel, Oct 04 2019
(Sage)
def a(n):
if n<2: return n+1
else: return 2*(a(n-1) - (n-2)*a(n-2))
[a(n) for n in (0..35)] # G. C. Greubel, Oct 04 2019
(GAP) a:=[1, 2];; for n in [3..35] do a[n]:=2*(a[n-1]-(n-3)*a[n-2]); od; a; # G. C. Greubel, Oct 04 2019
CROSSREFS
Sequence in context: A296229 A322175 A298117 * A281122 A201777 A096189
KEYWORD
sign,less
AUTHOR
Roger L. Bagula, Sep 13 2006
EXTENSIONS
Edited by N. J. A. Sloane, Sep 17 2006
Corrected and offset changed by G. C. Greubel, Oct 04 2019
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 29 09:42 EDT 2024. Contains 372113 sequences. (Running on oeis4.)