OFFSET
1,2
COMMENTS
a(n) - a(n-1) is in {1,2,3,4,5} for n >= 1; also, 3n - a(n) is in {0, 1, 2} for n >= 1. The first 20 numbers 3n - a(n) are 2, 0, 1, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 2, 1, 2, 0, 1, 0, 1, with 0 in positions given by A287420.
LINKS
Clark Kimberling, Table of n, a(n) for n = 1..10000
MATHEMATICA
s = Nest[Flatten[# /. {0->{0, 1, 2}, 1->{1, 2, 0}, 2->{1, 0, 2}}] &, {0}, 9]; (*A287418*)
Flatten[Position[s, 0]]; (*A287419*)
Flatten[Position[s, 1]]; (*A287420*)
Flatten[Position[s, 2]]; (*A287421*)
Position[SubstitutionSystem[{0->{0, 1, 2}, 1->{1, 2, 0}, 2->{1, 0, 2}}, {0}, {5}][[1]], 0]// Flatten (* Harvey P. Dale, Jun 21 2022 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, May 25 2017
STATUS
approved