login
A321103
Sequence generated by: a(3*n) = 1, a(3*n+2) = 2 - a(3*n+1), a(9*n+1) = 2, a(9*n+7) = 0, a(9*n+4) = 2 - a(3*n+1), for n >= 0.
0
1, 2, 0, 1, 0, 2, 1, 0, 2, 1, 2, 0, 1, 2, 0, 1, 0, 2, 1, 2, 0, 1, 2, 0, 1, 0, 2, 1, 2, 0, 1, 0, 2, 1, 0, 2, 1, 2, 0, 1, 0, 2, 1, 0, 2, 1, 2, 0, 1, 2, 0, 1, 0, 2, 1, 2, 0, 1, 0, 2, 1, 0, 2, 1, 2, 0, 1, 0, 2, 1, 0, 2, 1, 2, 0, 1, 2, 0, 1, 0, 2, 1, 2, 0, 1, 0, 2, 1, 0, 2, 1, 2, 0, 1, 2, 0, 1, 0, 2, 1, 2, 0, 1, 2, 0, 1, 0, 2, 1, 2, 0, 1, 0, 2, 1, 0, 2, 1, 2, 0, 1, 2, 0, 1, 0, 2, 1, 2, 0, 1, 2, 0, 1, 0, 2, 1, 2, 0, 1, 0, 2, 1, 0, 2, 1, 2, 0, 1, 0, 2, 1, 0, 2, 1, 2, 0, 1, 2, 0, 1, 0, 2, 1, 2, 0, 1, 0, 2, 1, 0, 2, 1, 2, 0, 1, 2, 0, 1, 0, 2, 1, 2, 0, 1, 2, 0, 1, 0, 2, 1, 2, 0, 1, 0, 2, 1, 0, 2, 1, 2, 0
OFFSET
0,2
FORMULA
FORMULA FOR TERMS: for n >= 0,
(1) a(3*n) = 1,
(2) a(3*n+2) = 2 - a(3*n+1),
(3) a(9*n+1) = 2,
(4) a(9*n+7) = 0,
(5) a(9*n+4) = 2 - a(3*n+1).
PROG
(PARI) /* Using formula for terms */
{a(n) =
if(n%3==0, 1,
if(n%3==2, 2 - a(n-1),
if(n%9==1, 2,
if(n%9==7, 0,
if(n%9==4, 2 - a((n-1)/3) )))))}
for(n=0, 200, print1(a(n), ", "))
CROSSREFS
Sequence in context: A193527 A127505 A194923 * A358133 A363878 A086372
KEYWORD
nonn
AUTHOR
Paul D. Hanna, Nov 25 2018
STATUS
approved