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.

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

This page as a plain text file.
%I A248505 #20 Nov 17 2014 22:07:35
%S A248505 3,2,-1,-2,-1,2,3,6,3,18,15,270,255,68850,68595,4722765750,4722697155,
%T A248505 22304192371256441250,22304192366533744095,
%U A248505 497476997228678085728479670747901918750,497476997228678085706175478381368174655
%N A248505 Alternating the subtraction and multiplication of two previous terms, starting with 3, 2.
%F A248505 For n odd a(n) = a(n-1) - a(n-2),
%F A248505 For n even a(n) = a(n-1) * a(n-2),
%F A248505 a(1)  = 3, a(2) = 2.
%e A248505 For n = 3, a(n) = a(2) - a(1) = 2 - 3  = -1.
%t A248505 a248505[n_Integer] := Module[{f},
%t A248505 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 A248505 (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 A248505 Cf. A248479.
%K A248505 sign
%O A248505 1,1
%A A248505 _Stuart E Anderson_, Oct 07 2014
%E A248505 More terms from _Colin Barker_, Oct 07 2014