A248505 Alternating the subtraction and multiplication of two previous terms, starting with 3, 2.
3, 2, -1, -2, -1, 2, 3, 6, 3, 18, 15, 270, 255, 68850, 68595, 4722765750, 4722697155, 22304192371256441250, 22304192366533744095, 497476997228678085728479670747901918750, 497476997228678085706175478381368174655
Offset: 1
Keywords
Examples
For n = 3, a(n) = a(2) - a(1) = 2 - 3 = -1.
Crossrefs
Cf. A248479.
Programs
-
Mathematica
a248505[n_Integer] := Module[{f}, f[1] = 3; f[2] = 2; f[k_] := If[EvenQ[k], f[k - 1] * f[k - 2], f[k - 1] - f[k - 2]]; f /@ Range[n]]; a248505[21] (* Michael De Vlieger, Nov 17 2014 *)
-
PARI
v=[3,2];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 29 2014
Formula
For n odd a(n) = a(n-1) - a(n-2),
For n even a(n) = a(n-1) * a(n-2),
a(1) = 3, a(2) = 2.
Extensions
More terms from Colin Barker, Oct 07 2014