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!)
A122017 a(n) = if n even then a(n - 1) - (n - 1)*a(n - 2) otherwise 2*(a(n - 1) + (n - 1)*a(n - 2])). 0

%I #8 Jun 12 2020 15:32:42

%S 1,2,1,10,7,94,59,1246,833,21602,14105,460250,305095,11656190,7689955,

%T 341753230,226403905,11388911170,7540044785,425080891690,281820040775,

%U 17566875749150,11648654892875,796239842748350,528320780212225

%N a(n) = if n even then a(n - 1) - (n - 1)*a(n - 2) otherwise 2*(a(n - 1) + (n - 1)*a(n - 2])).

%t a[0] = 1; a[1] = 2; a[n_] := a[n] = If[Mod[n, 2] == 0, a[n - 1] - (n - 1)*a[n - 2], 2*(a[n - 1] + (n - 1)*a[n - 2])] b = Table[a[n], {n, 0, 30}]

%t nxt[{n_,a_,b_}]:={n+1,b,If[OddQ[n],b-n*a,2(b+n*a)]}; NestList[nxt,{1,1,2},30][[All,2]] (* _Harvey P. Dale_, Jun 12 2020 *)

%Y Cf. A000898, A121966.

%K nonn

%O 1,2

%A _Roger L. Bagula_, Sep 11 2006

%E Edited by _N. J. A. Sloane_, Sep 13 2006

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 25 11:06 EDT 2024. Contains 371967 sequences. (Running on oeis4.)