A039941
Alternately add and multiply.
Original entry on oeis.org
0, 1, 1, 1, 2, 2, 4, 8, 12, 96, 108, 10368, 10476, 108615168, 108625644, 11798392572168192, 11798392680793836, 139202068568601556987554268864512, 139202068568601568785946949658348, 19377215893777651167043206536157390321290709180447278572301746176
Offset: 0
- 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.
- A. V. Aho and N. J. A. Sloane, Some doubly exponential sequences, Fibonacci Quarterly, Vol. 11, No. 4 (1973), pp. 429-437 (original plus references that F.Q. forgot to include - see last page!)
-
a039941 n = a039941_list !! (n-1)
a039941_list = 0 : 1 : zipWith3 ($)
(cycle [(+),(*)]) a039941_list (tail a039941_list)
-- Reinhard Zumkeller, May 07 2012
-
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 *)
-
a(n)=if(n<2,n>0, if(n%2,a(n-1)*a(n-2),a(n-1)+a(n-2)))
A248479
a(1) = 1, a(2) = 3, and from then on alternatively subtract and multiply two previous terms.
Original entry on oeis.org
1, 3, 2, 6, 4, 24, 20, 480, 460, 220800, 220340, 48651072000, 48650851660, 2366916086971979520000, 2366916086923328668340, 5602291762651594835806920193095352396800000, 5602291762651594835804553277008429068131660, 31385672993873913406017018916292673201543291913142263413575757282059524278962688000000
Offset: 1
-
a248479 n = a248479_list !! (n-1)
a248479_list = 1 : 3 : zipWith ($) (map uncurry $ cycle [(-), (*)])
(zip (tail a248479_list) a248479_list)
-- Reinhard Zumkeller, Oct 28 2014
-
a:= proc(n) option remember;
piecewise(n::odd, a(n-1)-a(n-2), a(n-1)*a(n-2))
end proc:
a(1):= 1: a(2):= 3:
seq(a(n),n=1..20); # Robert Israel, Oct 27 2014
-
nxt[{n_,a_,b_}]:={n+1,b,If[EvenQ[n],b-a,b*a]}; NestList[nxt,{2,1,3},20][[All,2]] (* Harvey P. Dale, Jul 31 2018 *)
-
v=[1,3];for(n=1,20,if(n%2,v=concat(v,v[#v]-v[#v-1]));if(!(n%2),v=concat(v,v[#v]*v[#v-1])));v \\ Derek Orr, Oct 26 2014
-
(definec (A248479 n) (cond ((= 1 n) 1) ((= 2 n) 3) ((odd? n) (- (A248479 (- n 1)) (A248479 (- n 2)))) (else (* (A248479 (- n 1)) (A248479 (- n 2))))))
;; A memoizing definec-macro can be found from http://oeis.org/wiki/Memoization - Antti Karttunen, Oct 26 2014
One term corrected and additional terms added by
Colin Barker, Oct 07 2014
A320603
a(0) = 1; if n is odd, a(n) = Product_{i=0..n-1} a(i); if n is even, a(n) = Sum_{i=0..n-1} a(i).
Original entry on oeis.org
1, 1, 2, 2, 6, 24, 36, 20736, 20808, 8947059130368, 8947059171984, 716210897494804754044764041567551881216, 716210897494804754044764059461670225184
Offset: 0
5 is odd, so a(5) = 1 * 1 * 2 * 2 * 6 = 24.
6 is even, so a(6) = 1 + 1 + 2 + 2 + 6 + 24 = 36.
Product of previous terms:
A165420.
-
a[0]:= 1; a[n_]:= If[OddQ[n], Product[a[j], {j,0,n-1}], Sum[a[j], {j,0,n -1}]]; Table[a[n], {n, 0, 15}] (* G. C. Greubel, Oct 19 2018 *)
-
first(n) = my(res = vector(n, i, 1)); for(x=3, n, res[x]=if(x%2, sum(i=1, x-1, res[i]), prod(i=1, x-1, res[i]))); res
-
first(n) = my(res = vector(n, i, 1)); res[3]++; for(x=4, n, res[x]=if(x%2, res[x-1]+2*res[x-2], res[x-1]*res[x-2]^2)); res
Showing 1-3 of 3 results.
Comments