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.

A039941 Alternately add and multiply.

This page as a plain text file.
%I A039941 #23 Jan 09 2025 09:39:58
%S A039941 0,1,1,1,2,2,4,8,12,96,108,10368,10476,108615168,108625644,
%T A039941 11798392572168192,11798392680793836,
%U A039941 139202068568601556987554268864512,139202068568601568785946949658348,19377215893777651167043206536157390321290709180447278572301746176
%N A039941 Alternately add and multiply.
%H A039941 Reinhard Zumkeller, <a href="/A039941/b039941.txt">Table of n, a(n) for n = 0..27</a>
%H A039941 A. V. Aho and N. J. A. Sloane, <a href="https://web.archive.org/web/2024*/https://www.fq.math.ca/Scanned/11-4/aho-a.pdf">Some doubly exponential sequences</a>, Fibonacci Quarterly, Vol. 11, No. 4 (1973), pp. 429-437.
%H A039941 A. V. Aho and N. J. A. Sloane, <a href="/A000058/a000058.pdf">Some doubly exponential sequences</a>, Fibonacci Quarterly, Vol. 11, No. 4 (1973), pp. 429-437 (original plus references that F.Q. forgot to include - see last page!)
%F A039941 a(2n) = a(2n-1) + a(2n-2); a(2n+1) = a(2n-1)*a(2n); a(0) = 0; a(1) = 1
%F A039941 a(n) = {a(n-1) + a(n-2), n even, a(n-1)*a(n-2), n odd}; a(0)=0; a(1)=1.
%t A039941 nxt[{n_,a_,b_}]:={n+1,b,If[EvenQ[n],a+b,a*b]}; Join[{0},Transpose[ NestList[ nxt,{0,0,1},20]][[3]]] (* _Harvey P. Dale_, Aug 23 2013 *)
%o A039941 (PARI) a(n)=if(n<2,n>0, if(n%2,a(n-1)*a(n-2),a(n-1)+a(n-2)))
%o A039941 (Haskell)
%o A039941 a039941 n = a039941_list !! (n-1)
%o A039941 a039941_list = 0 : 1 : zipWith3 ($)
%o A039941    (cycle [(+),(*)]) a039941_list (tail a039941_list)
%o A039941 -- _Reinhard Zumkeller_, May 07 2012
%Y A039941 A001696(n)=A039941(2*n), A001697(n)=A039941(2*n+1).
%Y A039941 Cf. A077753
%K A039941 easy,nonn,nice
%O A039941 0,5
%A A039941 _Walter Carlini_
%E A039941 Additional comments from _Michael Somos_, May 19 2000
%E A039941 One more term from _Harvey P. Dale_, Aug 23 2013