login
A395958
Third iterate of the Thue-Morse transform applied to A000035.
7
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, 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, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0
OFFSET
0,2
COMMENTS
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).
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.
LINKS
Benoit Cloitre, The Thue-Morse Transform, arXiv:2604.06243 [math.NT], 2026.
FORMULA
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.
a(2*n+1) = 1 - a(2*n) for n>=0.
a(16*n + r) = a(n) XOR a(r) for 0 <= r < 16 for n>=0.
MAPLE
a := proc(n) local s, p, bit;
s := 0; p := 0;
while 2^p <= n do
if p mod 4 = 0 or p mod 4 = 1 then
bit := iquo(n, 2^p) mod 2;
s := (s + bit) mod 2 fi;
p := p + 1;
od; s end:
seq(a(n), n = 0..89); # Peter Luschny, May 16 2026
PROG
(Python)
def a(n):
s, p = 0, 0
while (1 << p) <= n:
if (p & 2) == 0:
s ^= (n >> p) & 1
p += 1
return s
print([a(n) for n in range(90)])
KEYWORD
nonn,base,easy
AUTHOR
Benoit Cloitre, May 12 2026
STATUS
approved