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

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

%S 1,2,-1,3,15,9,16,128,119,129,1419,1407,1420,19880,19865,19881,337977,

%T 337959,337978,6759560,6759539,6759561,155469903,155469879,155469904,

%U 4042217504,4042217477,4042217505,117224307645,117224307615,117224307646,3751177844672,3751177844639

%N a(1) = 1, then multiply, subtract, and add 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 = 2;

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

%e a(4) = -1 + 4 = 3.

%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 A362272_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 A362272_list = list(islice(A362272_gen(),20)) # _Chai Wah Wu_, Apr 19 2023

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

%K sign

%O 1,2

%A _James C. McMahon_, Apr 19 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 15:54 EDT 2024. Contains 374552 sequences. (Running on oeis4.)