[go: up one dir, main page]

login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A321101
Sequence generated by: a(3*n) = 0, a(3*n+2) = 3 - a(3*n+1), a(9*n+1) = 1, a(9*n+7) = 2, a(9*n+4) = 3 - a(3*n+1), for n >= 0.
0
0, 1, 2, 0, 2, 1, 0, 2, 1, 0, 1, 2, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 2, 1, 0, 2, 1, 0, 1, 2, 0, 2, 1, 0, 2, 1, 0, 1, 2, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 2, 1, 0, 2, 1, 0, 1, 2, 0, 2, 1, 0, 2, 1, 0, 1, 2, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 2, 1, 0, 2, 1, 0, 1, 2, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 2, 1, 0, 2, 1, 0, 1, 2, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 2, 1, 0, 2, 1, 0, 1, 2, 0, 2, 1, 0, 2, 1, 0, 1, 2, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 2, 1, 0, 2, 1, 0, 1, 2, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 2, 1, 0, 2, 1, 0, 1, 2
OFFSET
0,3
FORMULA
FORMULA FOR TERMS: for n >= 0,
(1) a(3*n) = 0,
(2) a(3*n+2) = 3 - a(3*n+1),
(3) a(9*n+1) = 1,
(4) a(9*n+7) = 2,
(5) a(9*n+4) = 3 - a(3*n+1).
PROG
(PARI) {a(n) =
if(n%3==0, 0,
if(n%3==2, 3 - a(n-1),
if(n%9==1, 1,
if(n%9==7, 2,
if(n%9==4, 3 - a((n-1)/3) )))))}
for(n=0, 200, print1(a(n), ", "))
CROSSREFS
Sequence in context: A226860 A244526 A035394 * A067167 A255195 A194317
KEYWORD
nonn,cofr
AUTHOR
Paul D. Hanna, Nov 14 2018
STATUS
approved