login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A077384 a(1) = 1, then add, multiply, subtract, multiply 2, 3, 4, 5; 6, 7, 8, 9; ... in that order. 2

%I #17 Oct 10 2023 05:08:28

%S 1,3,9,5,25,31,217,209,1881,1891,20801,20789,270257,270271,4054065,

%T 4054049,68918833,68918851,1309458169,1309458149,27498621129,

%U 27498621151,632468286473,632468286449,15811707161225,15811707161251

%N a(1) = 1, then add, multiply, subtract, multiply 2, 3, 4, 5; 6, 7, 8, 9; ... in that order.

%F a(1) = 1, a(2n+1) = (2n+1)*a(2n), a(4n) = a(4n-1)-4n, a(4n+2) = a(4n+1) + 4n+2.

%t FoldList[If[Mod[#2, 4]==2, #1+#2, If[Mod[#2, 4]==3, #1*#2,If[Mod[#2,4] ==0,#1-#2,#1*#2]]]&, 1, Range[2, 26]] (* _James C. McMahon_, Oct 09 2023 *)

%o (Python)

%o from itertools import count, islice

%o def A077384_gen(): # generator of terms

%o yield (a:=1)

%o for n in count(2,4):

%o yield (a:=a+n)

%o yield (a:=a*(n+1))

%o yield (a:=a-n-2)

%o yield (a:=a*(n+3))

%o A077384_list = list(islice(A077384_gen(),20)) # _Chai Wah Wu_, Apr 19 2023

%Y Other operation orders: A077382, A077383, A362269, A362270, A362271, A362272.

%K nonn

%O 1,2

%A _Amarnath Murthy_, Nov 06 2002

%E More terms from _Sascha Kurz_, Jan 04 2003

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 07:42 EDT 2024. Contains 371905 sequences. (Running on oeis4.)