OFFSET
1,2
EXAMPLE
a(2) = a(1) *2 = 2, a(3) = a(2) +3= 5, a(4) = a(3) -4 = 1,a(5) = 1*5 = 5, a(6) = a(5)+6 = 11, a(7) = 11-7 = 4, a(8) = 4*8 = 32, etc.
MATHEMATICA
FoldList[If[Mod[#2, 3]==2, #1*#2, If[Mod[#2, 3]==0, #1+#2, #1-#2]]&, 1, Range[2, 32]] (* James C. McMahon, Oct 10 2023 *)
PROG
(Python)
from itertools import count, islice
def A077382_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)
CROSSREFS
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Nov 06 2002
EXTENSIONS
More terms from Franklin T. Adams-Watters, May 12 2006
STATUS
approved