%I #9 Apr 25 2014 00:20:11
%S 2,0,1,0,1,2,1,2,0,0,1,2,1,2,0,2,0,1,1,2,0,2,0,1,0,1,2,0,1,2,1,2,0,2,
%T 0,1,1,2,0,2,0,1,0,1,2,2,0,1,0,1,2,1,2,0,1,2,0,2,0,1,0,1,2,2,0,1,0,1,
%U 2,1,2,0,0,1,2,1,2,0,2,0,1,0,1,2,1,2,0,2,0,1,1,2,0,2,0,1,0,1,2,2,0,1,0,1,2
%N a(n) = A053838(n) + 2 modulo 3.
%C 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.
%F a(n)=mod(n+a([n/3]), 3), a(0)=2. - _Michael Somos_, Feb 14 2004
%o (PARI) a(n)=if(n<0,0,2*(n==0),(n+a(n\3))%3) /* _Michael Somos_, Feb 14 2004 */
%K nonn
%O 0,1
%A _Philippe Deléham_, Feb 04 2004