OFFSET
0
COMMENTS
(Adapted from Drmota, Mauduit, and Rivat) The Thue-Morse sequence T(n) is a 0-1-sequence that can be defined by T(n) = s2(n) mod 2, where s2(n) denotes the binary sum-of-digits function of n (that is, the number of powers of 2). By definition it is clear that 0 and 1 appear with the same asymptotic frequency 1/2. However, there is no consecutive block of the form 000 or 111, so that the Thue-Morse sequence is not normal. (A 0-1-sequence is normal if every finite 0-1-block appears with the asymptotic frequency 1/2^k, where k denotes the length of the block.) Mauduit and Rivat (2009) showed that the subsequence T(n^2) also has the property that both 0 and 1 appear with the same asymptotic frequency 1/2. This solved a long-standing conjecture by Gelfond (1967/1968). Drmota, Mauduit, and Rivat (2013) proved that the subsequence T(n^2) is actually normal.
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..65537
M. Drmota, C. Mauduit, and J. Rivat, The Thue-Morse Sequence Along The Squares is Normal, Abstract, ÖMG-DMV Congress, 2013.
A. O. Gelfond, Sur les nombres qui ont des propriétés additives et multiplicatives données, Acta Arith. 13 (1967/1968) 259-265.
C. Mauduit and J. Rivat, La somme des chiffres des carrés, Acta Mathem. 203 (1) (2009) 107-148.
Wikipedia, Normal number
Lukas Spiegelhofer, Thue-Morse along the sequence of cubes, arXiv:2308.09498 [math.NT], 2023.
MATHEMATICA
a[n_] := If[ n == 0, 0, If[ Mod[n, 2] == 0, a[n/2], 1 - a[(n - 1)/2]]]; Table[ a[n^2], {n, 0, 104}]
(* Second program: *)
ThueMorse[Range[0, 104]^2] (* Michael De Vlieger, Dec 22 2017 *)
PROG
(PARI) a(n)=hammingweight(n^2)%2 \\ Charles R Greathouse IV, May 08 2016
(Python)
def A228039(n): return (n**2).bit_count()&1 # Chai Wah Wu, Aug 22 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Jonathan Sondow, Sep 02 2013
STATUS
approved