login
A248512
Sequence based on repeating in turn the subtract, add and multiply operations on the previous 2 terms, starting with 0, 1.
0
0, 1, 1, 2, 2, 0, 2, 0, -2, -2, 4, 6, 10, 60, 50, 110, 5500, 5390, 10890, 58697100, 58686210, 117383310, 6888781581155100, 6888781463771790, 13777563044926890, 94910620919839581404684194433100, 94910620919839567627121149506210
OFFSET
1,4
COMMENTS
After a(16) the sequence entries end 100, 90, 90, 100, 10, 10, 100, 90, 90, ... . - Jon Perry, Oct 29 2014
FORMULA
For n > 2,
If n mod 3 = 0, a(n) = a(n-1) - a(n-2),
If n mod 3 = 1, a(n) = a(n-1) + a(n-2),
If n mod 3 = 2, a(n) = a(n-1) x a(n-2),
a(1) = 0, a(2) = 1.
MATHEMATICA
nxt[{n_, a_, b_}]:={n+1, b, Which[Mod[n+1, 3]==0, b-a, Mod[n+1, 3] == 1, a+b, True, a*b]}; NestList[nxt, {2, 0, 1}, 30][[All, 2]] (* Harvey P. Dale, Sep 20 2021 *)
CROSSREFS
Sequence in context: A080378 A243865 A120439 * A352564 A353596 A182122
KEYWORD
sign,easy
AUTHOR
Stuart E Anderson, Oct 07 2014
EXTENSIONS
More terms from Colin Barker, Oct 08 2014
Edited: Name changed and keyword easy added - Wolfdieter Lang, Oct 29 2014
Changed name. - Jon Perry, Oct 29 2014
STATUS
approved