%I #46 May 04 2026 18:55:07
%S 0,1,1,0,0,0,1,1,0,1,1,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,1,1,0,1,
%T 1,0,0,0,1,1,0,1,1,0,1,1,0,0,0,1,1,0,1,1,0,1,1,0,0,0,1,1,0,0,0,1,1,0,
%U 0,0,1,1,0,1,1,0,1,1,0,0,0,1,1,0,0,0,1
%N Fixed point of the morphism 0->011, 1->0.
%C Start with 0, apply 0 -> 011, 1 -> 0, take limit.
%C Define strings S(0) = 1, S(1) = 0, S(n) = S(n-1)S(n-2)S(n-2); iterate; sequence is S(infinity).
%C Related to the Thue-Morse sequence A010060 (see formula section).
%C Conjecture: Let c(n) be the list with the length of 0-runs, then a(n) = (3-c(n+2))/2, i.e., c(1) = 1, c(n) = 3 - 2*a(n-2) for n > 1. If this conjecture is true, this is a self-generating sequence, starting with 011 whereafter the n-th 0-run has length 3 - 2*a(n-2) and the 1-runs all have length 2.
%H Paolo Xausa, <a href="/A395088/b395088.txt">Table of n, a(n) for n = 0..10922</a>
%F a(n) = 1 - A395089(n).
%F a(n) = 2 - A026465(n+2).
%F P(a(n) = 0) = P(a(n) = 1) = 1/2.
%e 011000110110110001100011000110110110001101101100011...
%t f[n_]:=Module[{a={0},b={1}},While[Length[a]<n,{a,b}={Join[a,b,b],a}];Take[a,n]];
%t a[n_]:=Module[{a={0},b={1}},While[Length[a]<=n,{a,b}={Join[a,b,b],a}];a[[n+1]]];
%t a/@Range[0,86] (* _Robert P. P. McKone_, Apr 14 2026 *)
%t (* Alternative: *)
%t First[SubstitutionSystem[{0 -> {0, 1, 1}, 1 -> {0}}, {0}, {7}]] (* _Paolo Xausa_, May 04 2026 *)
%o (Python)
%o def first(n): # returns first n terms
%o f0, f1 = "01"
%o while len(f0) < n:
%o f0, f1 = f0+2*f1, f0
%o return list(map(int, f0[0:n]))
%o print(first(87))
%Y Cf. A010060, A026465.
%Y Cf. A003849, A005614, A171588, A080764, A395089.
%K nonn,easy
%O 0
%A _A.H.M. Smeets_, Apr 11 2026