OFFSET
0,5
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 0..27
A. V. Aho and N. J. A. Sloane, Some doubly exponential sequences, Fibonacci Quarterly, Vol. 11, No. 4 (1973), pp. 429-437, alternative link.
FORMULA
a(2n) = a(2n-1) + a(2n-2); a(2n+1) = a(2n-1)*a(2n); a(0) = 0; a(1) = 1
a(n) = {a(n-1) + a(n-2), n even, a(n-1)*a(n-2), n odd}; a(0)=0; a(1)=1.
MATHEMATICA
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 *)
PROG
(PARI) a(n)=if(n<2, n>0, if(n%2, a(n-1)*a(n-2), a(n-1)+a(n-2)))
(Haskell)
a039941 n = a039941_list !! (n-1)
a039941_list = 0 : 1 : zipWith3 ($)
(cycle [(+), (*)]) a039941_list (tail a039941_list)
-- Reinhard Zumkeller, May 07 2012
CROSSREFS
KEYWORD
easy,nonn,nice
AUTHOR
EXTENSIONS
Additional comments from Michael Somos, May 19 2000
One more term from Harvey P. Dale, Aug 23 2013
STATUS
approved