login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

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

%I #3 Nov 25 2018 14:28:07

%S 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,

%T 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,

%U 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

%N 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.

%F FORMULA FOR TERMS: for n >= 0,

%F (1) a(3*n) = 1,

%F (2) a(3*n+2) = 2 - a(3*n+1),

%F (3) a(9*n+1) = 2,

%F (4) a(9*n+7) = 0,

%F (5) a(9*n+4) = 2 - a(3*n+1).

%o (PARI) /* Using formula for terms */

%o {a(n) =

%o if(n%3==0, 1,

%o if(n%3==2, 2 - a(n-1),

%o if(n%9==1, 2,

%o if(n%9==7, 0,

%o if(n%9==4, 2 - a((n-1)/3) )))))}

%o for(n=0, 200, print1(a(n), ", "))

%K nonn

%O 0,2

%A _Paul D. Hanna_, Nov 25 2018