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.

A222559 a(0) = 0. If n is odd, a(n) = a(n-1) * n, otherwise a(n) = a(n-1) + n.

This page as a plain text file.
%I A222559 #16 May 02 2021 21:45:06
%S A222559 0,0,2,6,10,50,56,392,400,3600,3610,39710,39722,516386,516400,7746000,
%T A222559 7746016,131682272,131682290,2501963510,2501963530,52541234130,
%U A222559 52541234152,1208448385496,1208448385520,30211209638000,30211209638026,815702660226702,815702660226730
%N A222559 a(0) = 0. If n is odd, a(n) = a(n-1) * n, otherwise a(n) = a(n-1) + n.
%H A222559 Harvey P. Dale, <a href="/A222559/b222559.txt">Table of n, a(n) for n = 0..808</a>
%t A222559 last = 0; Table[If[OddQ[n], last = n * last, last = n + last], {n, 0, 40}] (* _T. D. Noe_, Mar 01 2013 *)
%t A222559 nxt[{n_,a_}]:={n+1,If[EvenQ[n],a(n+1),a+n+1]}; NestList[nxt,{0,0},30][[All,2]] (* _Harvey P. Dale_, May 14 2019 *)
%o A222559 (Python)
%o A222559 a=0
%o A222559 for n in range(1,33):
%o A222559     print(a, end=',')
%o A222559     if n&1:
%o A222559         a *= n
%o A222559     else:
%o A222559         a += n
%Y A222559 Cf. A077138, A047904, A047905.
%K A222559 nonn,easy
%O A222559 0,3
%A A222559 _Alex Ratushnyak_, Feb 24 2013