%I #19 May 19 2026 19:39:59
%S 0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,
%T 0,1,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,
%U 0,1,1,0,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,1,0
%N Third iterate of the Thue-Morse transform applied to A000035.
%C The Thue-Morse transform T acts on any binary word w with w(0) = 0 and in which both 0 and 1 appear infinitely often, by setting T(w)(0) = 0, T(w)(v_w(n)) = T(w)(n) and T(w)(u_w(n)) = 1 - T(w)(n), where v_w(n) and u_w(n) (offset 0) are the positions of the n-th 0 and the n-th 1 of w. Iterating T starting from a_0=A000035 produces A010060 (T(a_0)), A341389 (T^2(a_0)), the present sequence is T^3(a_0).
%C This sequence is 2-automatic. It is the fixed point starting with 0 of the uniform morphism of length 16 sending 0 -> 0110 0110 0110 0110 and 1 -> 1001 1001 1001 1001.
%H Benoit Cloitre, <a href="https://arxiv.org/abs/2604.06243">The Thue-Morse Transform</a>, arXiv:2604.06243 [math.NT], 2026.
%F a(n) = Sum_{p >= 0, p AND 2 = 0} b_p(n) mod 2, where b_p(n) is the p-th binary digit of n.
%F a(2*n+1) = 1 - a(2*n) for n>=0.
%F a(16*n + r) = a(n) XOR a(r) for 0 <= r < 16 for n>=0.
%p a := proc(n) local s, p, bit;
%p s := 0; p := 0;
%p while 2^p <= n do
%p if p mod 4 = 0 or p mod 4 = 1 then
%p bit := iquo(n, 2^p) mod 2;
%p s := (s + bit) mod 2 fi;
%p p := p + 1;
%p od; s end:
%p seq(a(n), n = 0..89); # _Peter Luschny_, May 16 2026
%o (Python)
%o def a(n):
%o s, p = 0, 0
%o while (1 << p) <= n:
%o if (p & 2) == 0:
%o s ^= (n >> p) & 1
%o p += 1
%o return s
%o print([a(n) for n in range(90)])
%Y Cf. A000035, A010060, A341389, A395959, A395960, A395961, A395964.
%K nonn,base,easy
%O 0,2
%A _Benoit Cloitre_, May 12 2026