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.
%I A047904 #31 Feb 19 2024 01:55:01 %S A047904 1,2,4,7,28,33,198,205,1640,1649,16490,16501,198012,198025,2772350, %T A047904 2772365,44357840,44357857,798441426,798441445,15968828900, %U A047904 15968828921,351314236262,351314236285,8431541670840,8431541670865,219220083442490 %N A047904 a(n+1) = a(n) + n (if n is odd), a(n+1) = a(n) * n (if n is even). %H A047904 T. D. Noe, <a href="/A047904/b047904.txt">Table of n, a(n) for n = 1..100</a> %t A047904 Transpose[NestList[{#[[1]]+1,If[OddQ[#[[1]]],Total[#],Times@@#]}&,{1,1},30]][[2]] (* _Harvey P. Dale_, Sep 11 2012 *) %o A047904 (Python) %o A047904 a=1 %o A047904 for n in range(1,33): %o A047904 print(a, end=", ") %o A047904 if n&1: %o A047904 a += n %o A047904 else: %o A047904 a *= n %o A047904 # _Alex Ratushnyak_, Feb 24 2013 %o A047904 (Haskell) %o A047904 a047904 n = a047904_list !! (n-1) %o A047904 a047904_list = 1 : zipWith uncurry %o A047904 (cycle [(+), (*)]) (zip a047904_list [1..]) %o A047904 -- _Reinhard Zumkeller_, Nov 13 2013, Mar 24 2013 %Y A047904 Cf. A000124, A047905, A077138. %K A047904 nonn,easy,nice %O A047904 1,2 %A A047904 Miklos SZABO (mike(AT)ludens.elte.hu)