%I #12 Oct 01 2016 21:00:09
%S 1,2,0,1,0,2,1,1,1,1,2,0,1,1,1,1,0,2,1,2,0,1,2,0,1,2,0,1,2,0,1,0,2,1,
%T 1,1,1,2,0,1,2,0,1,2,0,1,2,0,1,1,1,1,0,2,1,2,0,1,0,2,1,1,1,1,2,0,1,0,
%U 2,1,1,1,1,2,0,1,0,2,1,1,1,1,2,0,1,0,2,1,1,1,1,2,0,1,1,1,1,0,2,1,2,0,1,2,0
%N a(n) = A089649(n) mod 3.
%C Partial sums, modulo 3, of the sequence: a(1)=1, a(1), a(1), a(1), a(2), a(2), a(2), a(3), a(3), ... each term repeated 3 times.
%H <a href="/index/Fi#FIXEDPOINTS">Index entries for sequences that are fixed points of mappings</a>
%F A fixed point of the morphism 1->120, 2->102, 0->111.
%t Nest[ Function[ l, {Flatten[(l /. {0 -> {1, 1, 1}, 1 -> {1, 2, 0}, 2 -> {1, 0, 2}})]}], {0}, 5] (* _Robert G. Wilson v_, Feb 26 2005 *)
%o (PARI) a(n)=if(n<2,1,(a(n-1)+a(floor((n+1)/3)))%3)
%K easy,nonn
%O 1,2
%A _Philippe Deléham_, Jan 02 2004