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
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