login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A248505 Alternating the subtraction and multiplication of two previous terms, starting with 3, 2. 1

%I

%S 3,2,-1,-2,-1,2,3,6,3,18,15,270,255,68850,68595,4722765750,4722697155,

%T 22304192371256441250,22304192366533744095,

%U 497476997228678085728479670747901918750,497476997228678085706175478381368174655

%N Alternating the subtraction and multiplication of two previous terms, starting with 3, 2.

%F For n odd a(n) = a(n-1) - a(n-2),

%F For n even a(n) = a(n-1) * a(n-2),

%F a(1) = 3, a(2) = 2.

%e For n = 3, a(n) = a(2) - a(1) = 2 - 3 = -1.

%t a248505[n_Integer] := Module[{f},

%t 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 *)

%o (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

%Y Cf. A248479.

%K sign

%O 1,1

%A _Stuart E Anderson_, Oct 07 2014

%E More terms from _Colin Barker_, Oct 07 2014

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 17 06:16 EDT 2021. Contains 347478 sequences. (Running on oeis4.)