OFFSET
0,1
COMMENTS
Can construct sequence by starting with 2 and mapping 0->012, 1->120, 2->201 (e.g., 2, 201, 201012120, ...) and looking at n-th digit of a term with sufficient digits.
FORMULA
a(n)=mod(n+a([n/3]), 3), a(0)=2. - Michael Somos, Feb 14 2004
PROG
(PARI) a(n)=if(n<0, 0, 2*(n==0), (n+a(n\3))%3) /* Michael Somos, Feb 14 2004 */
CROSSREFS
KEYWORD
nonn
AUTHOR
Philippe Deléham, Feb 04 2004
STATUS
approved