login
A090239
a(n) = A053838(n) + 2 modulo 3.
2
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, 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, 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
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
Sequence in context: A371074 A287104 A190483 * A165276 A035698 A230204
KEYWORD
nonn
AUTHOR
Philippe Deléham, Feb 04 2004
STATUS
approved