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!)
A362271 a(1) = 1, then add, subtract and multiply 2, 3, 4; 5, 6, 7; ... in that order. 6

%I #18 Oct 10 2023 05:04:22

%S 1,3,0,0,5,-1,-7,1,-8,-80,-69,-81,-1053,-1039,-1054,-16864,-16847,

%T -16865,-320435,-320415,-320436,-7049592,-7049569,-7049593,-176239825,

%U -176239799,-176239826,-4934715128,-4934715099,-4934715129,-152976168999,-152976168967,-152976169000

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

%F a(1)=1; for n > 1,

%F a(n) = a(n-1) + n if n mod 3 = 2,

%F a(n-1) - n if n mod 3 = 0,

%F a(n-1) * n if n mod 3 = 1.

%e a(2) = 1 + 2 = 3;

%e a(3) = 3 - 3 = 0;

%e a(4) = 0 * 4 = 0.

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

%o (Python)

%o from itertools import count, islice

%o def A362271_gen(): # generator of terms

%o yield (a:=1)

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

%o yield (a:=a+n)

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

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

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

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

%K sign

%O 1,2

%A _James C. McMahon_, Apr 13 2023

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 July 23 18:13 EDT 2024. Contains 374553 sequences. (Running on oeis4.)