The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A362269 a(1) = 1, then subtract, add, and multiply 2, 3, 4; 5, 6, 7; ... in that order. 7
1, -1, 2, 8, 3, 9, 63, 55, 64, 640, 629, 641, 8333, 8319, 8334, 133344, 133327, 133345, 2533555, 2533535, 2533556, 55738232, 55738209, 55738233, 1393455825, 1393455799, 1393455826, 39016763128, 39016763099, 39016763129 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
LINKS
FORMULA
a(1)=1; for n > 1,
a(n) = a(n-1) - n if n mod 3 = 2,
a(n-1) + n if n mod 3 = 0,
a(n-1) * n if n mod 3 = 1.
EXAMPLE
a(2) = 1 - 2 = -1;
a(3) = -1 + 3 = 2;
a(4) = 2 * 4 = 8.
MATHEMATICA
FoldList[If[Mod[#2, 3]==2, #1-#2, If[Mod[#2, 3]==0, #1+#2, #1*#2]]&, 1, Range[2, 30]] (* James C. McMahon, Oct 08 2023 *)
PROG
(Python)
from itertools import count, islice
def A362269_gen(): # generator of terms
yield (a:=1)
for n in count(2, 3):
yield (a:=a-n)
yield (a:=a+n+1)
yield (a:=a*(n+2))
A362269_list = list(islice(A362269_gen(), 20)) # Chai Wah Wu, Apr 19 2023
CROSSREFS
Other operation orders: A077382, A077383, A362270, A362271, A362272.
Sequence in context: A011057 A082236 A337822 * A262027 A328487 A083003
KEYWORD
sign
AUTHOR
James C. McMahon, Apr 13 2023
STATUS
approved

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 May 15 13:23 EDT 2024. Contains 372540 sequences. (Running on oeis4.)