cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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)).

This page as a plain text file.
%I A122017 #12 Sep 15 2024 06:51:27
%S A122017 1,2,1,10,7,94,59,1246,833,21602,14105,460250,305095,11656190,7689955,
%T A122017 341753230,226403905,11388911170,7540044785,425080891690,281820040775,
%U A122017 17566875749150,11648654892875,796239842748350,528320780212225
%N 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)).
%t A122017 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 A122017 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 A122017 Cf. A000898, A121966.
%K A122017 nonn,easy
%O A122017 0,2
%A A122017 _Roger L. Bagula_, Sep 11 2006
%E A122017 Edited by _N. J. A. Sloane_, Sep 13 2006
%E A122017 Offset corrected by _Jason Yuen_, Sep 15 2024