%I #28 Jun 08 2021 02:30:16
%S 0,1,1,0,0,1,0,0,1,0,1,1,0,1,1,0,0,1,0,1,1,0,1,1,0,0,1,0,1,1,0,0,1,0,
%T 0,1,0,1,1,0,0,1,0,0,1,0,1,1,0,1,1,0,0,1,0,1,1,0,0,1,0,0,1,0,1,1,0,0,
%U 1,0,0,1,0,1,1,0,1,1,0,0,1,0,1,1,0,0,1,0,0,1,0,1,1,0,1,1,0,0,1,0,1,1,0,1,1,0,0,1,0,1,1,0,0,1,0,0,1,0,1,1,0,1
%N Fixed point of the morphism 0->011, 1->001.
%H <a href="/index/Ar#3-automatic">Index entries for 3-automatic sequences</a>.
%H <a href="/index/Fi#FIXEDPOINTS">Index entries for sequences that are fixed points of mappings</a>
%F a(3k-2)=0, a(3k-1)=1-a(k), a(3k)=1 for k>=1, a(0)=0.
%e 0->011->011001001->...
%t t = Nest[Flatten[# /. {0->{0,1,1}, 1->{0,0,1}}] &, {0}, 5] (* A189706 *)
%t f[n_] := t[[n]]
%t Flatten[Position[t, 0]] (* A189707 *)
%t Flatten[Position[t, 1]] (* A189708 *)
%t s[n_] := Sum[f[i], {i, 1, n}]; s[0] = 0;
%t Table[s[n], {n, 1, 120}] (* A189709 *)
%o (PARI) a(n) = n--; my(ret=0); while([n,r]=divrem(n,3);r==1, ret++); (ret+r>>1)%2; \\ _Kevin Ryde_, Jun 02 2021
%Y Cf. A189628, A189707, A189708, A189709.
%Y Cf. A321090, A321091, A321093, A321095, A321097.
%K nonn
%O 1
%A _Clark Kimberling_, Apr 25 2011