login
A395089
Binary complement of A395088.
2
1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0
OFFSET
0
COMMENTS
Start with 1, apply 1 -> 100, 0 -> 1, take limit.
Define strings S(0) = 0, S(1) = 1, S(n) = S(n-1)S(n-2)S(n-2); iterate; sequence is S(infinity).
Related to the Thue-Morse sequence A010060 (see formula section).
FORMULA
a(n) = 1 - A395088(n).
a(n) = A026465(n+2) - 1.
P(a(n) = 0) = P(a(n) = 1) = 1/2.
a(n) = A284391(n+2).
a(n) = A284388(n+3).
EXAMPLE
100111001001001110011100111001001001110010010011...
MATHEMATICA
f[n_]:=Module[{a={1}, b={0}}, While[Length[a]<n, {a, b}={Join[a, b, b], a}]; Take[a, n]]; a[n_]:=Module[{a={1}, b={0}}, While[Length[a]<=n, {a, b}={Join[a, b, b], a}]; a[[n+1]]]; a/@Range[0, 86] (* Robert P. P. McKone, Apr 14 2026 *)
(* Alternative: *)
First[SubstitutionSystem[{0 -> {1}, 1 -> {1, 0, 0}}, {1}, {7}]] (* Paolo Xausa, May 04 2026 *)
PROG
(Python)
def first(n): # returns first n terms
f0, f1 = "10"
while len(f0) < n:
f0, f1 = f0+2*f1, f0
return list(map(int, f0[0:n]))
print(first(87))
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
A.H.M. Smeets, Apr 11 2026
STATUS
approved