A112539 Half-baked Thue-Morse: at successive steps the sequence or its bit-inverted form is appended to itself.
1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0
Offset: 1
Examples
Triangle begins: 1; 0; 1, 0; 0, 1, 0, 1; 1, 0, 1, 0, 0, 1, 0, 1; 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0; 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0; ...
Programs
-
Mathematica
s = {1}; Do[s = Join[s, Mod[s + 1, 2]]; s = Join[s, s], {n, 4}]; s (* Robert G. Wilson v, Dec 22 2005 *)
-
PARI
aiter(x) = my(s=[1]); for(i=1, x, s=concat(s, if(i%2, [1-e|e<-s], s))); s \\ Ruud H.G. van Tol, Jan 20 2025
-
Python
s = [1] for _ in range(4): s = s + [(x + 1) % 2 for x in s] s = s + s print(s) # Robert C. Lyons, Jan 19 2025
Extensions
More terms from Robert G. Wilson v, Dec 22 2005