Sums of digits, overlaps, and palindromes

Let s_k(n) denote the sum of the digits in the base-k representation of n. In a celebrated paper, Thue showed that the infinite word (s_2(n) \bmod 2)_n≥ 0 is \emphoverlap-free, i.e., contains no subword of the form axaxa where x is any finite word and a is a single symbol. Let k,m be integers with k>2, m≥ 1. In this paper, generalizing Thue's result, we prove that the infinite word t_k,m := (s_k(n) \bmod m)_n≥ 0 is overlap-free if and only if m≥ k. We also prove that t_k,m contains arbitrarily long squares (i.e., subwords of the form xx where x is nonempty), and contains arbitrarily long palindromes if and only if m≤ 2.


Introduction
At the beginning of the 20th century, the Norwegian mathematician Axel Thue initiated the study of what is now called combinatorics on words with his results on repetitions in words [18,19,6,8].We say a nonempty word ✾ is a square if it can be written in the form ✿ ✍✿ for some word ✿ .Examples include the words chercher in French and murmur in English.We say that ✾ is an overlap if it can be written in the form ❀ ❁✿ ✍❀ ❁✿ ❂❀ for some word ✿ and single symbol ❀ .Examples include the words entente in French and alfalfa in English.Thue explicitly constructed an infinite word on two symbols that is overlapfree, that is, contains no subword that is an overlap.He also constructed an infinite word on three symbols that is square-free, that is, contains no subword that is a square.
Thue's constructions are based on what is now called the Thue-Morse sequence
Fife [12] described all infinite overlap-free binary sequences; also see [7].Séébold proved the beautiful and remarkable result that ❃ is essentially the only infinite overlap-free binary sequence which is generated by iterating a morphism [17].
It is natural to wonder if Thue's overlap-free construction is either unique in some sense, or a particular case of a more general construction.In this note we show that t is a particular case of a more general construction involving sums of digits.We will prove Theorem 1 Let ❚ ( ✁ , ( be integers.Then the sequence In contrast to Theorem 1 we also show that ❃ | ✂✁ ✄ always contains arbitarily long squares.
We also consider the occurrence of palindromes in We observe that overlaps, squares, and palindromes in sequences have several applications.For example, in number theory they aid in proving the transcendence of real numbers whose base ✛ expansion or continued fraction expansion have "repetitions" [11,4,16,2], while in statistical physics they are useful for studying the spectrum of certain discrete Schrödinger operators [9,13,1,5].

Some useful lemmas
In this section we introduce some notation and prove some useful lemmas.

Lemma 2 For any
Proof.Left to the reader.
where the differences are taken mod .We can also extend ✓ to infinite words.

Proof of the main theorem
We are now ready to prove Theorem 1.
Proof.Fix integers ❚ ( ✁ and ( , and let Every symbol contained in We call such a subword (of length ❚ , starting at a position in ❃ | ✂✁ ✄ which is congruent to ❈ , modulo ❚ ) a ❚ -aligned subword.It follows from Eq. ( 4) that every symbol in a ❚ -aligned subword is completely determined once the value of a single such symbol is known.
❄ ✂✁ : Assume ✩ ❚ .We will prove that the sequence ❃ | ✂✁ ✄ contains an overlap of period .In fact, the subword , is of the form . Thus Similarly, the base-❚ expansion of ❚ ✄ ✢ ✤ , ✄ ❄ : If ❃ | ✖✁ ✄ has an overlap, then it has an overlap of shortest period ✠ .Let be such an overlap.Note ✠ ( . By the definition of overlap, we have ✯ is a positive integer, and, using the division theorem, we have, by considering only those ✤ that are multiples of ❊ , and so Case 2(a): There are two cases to consider, (i) ✆ ✗ ✠ and (ii) ✆ ✠ .
Case 2(a

But
❄ ✠ and hence ❚ ✠ .This contradicts the assumption of case 2(b) that ❚ ✩ ✠ , and hence this case cannot occur.
In this case ☛ ✫ is a ❚ -aligned subword, and ☛ ❲ is a prefix of a ❚ -aligned subword.

Palindromes in ❚ ✎
In this section we examine the occurrence of palindromes in

Proof.
❄ ✂✁ : Suppose that the sequence ❃ | ✂✁ ✄ contains some palindrome of even length larger than or equal to ✞ .Then it must contain the word ✛ ✻❀ ✤❀ ✛ for some ❀ ✎ ✛ ✟☎ ☞ ✄ .If ❀ ✤❀ is contained in the image by ✜ | ✖✁ ✄ of some letter in ☞ ✄ , then ❄ .Otherwise the first ❀ must be the last letter of the image by ✜ | ✂✁ ✄ of some letter, and the second ❀ must be the first letter of the image by ✜ | ✂✁ ✄ of some letter.It follows that ❊ and this gives ✗ ✁ .Now suppose that the sequence ❃ | ✂✁ ✄ contains a palindrome of odd length larger than or equal to ✠ , , who used it in a construction ❴ Research supported in part by a grant from NSERC.1365-8050 c ❵ 2000 Maison de l'Informatique et des Mathématiques Discrètes (MIMD), Paris, France contradicting our assumption that ✠ was minimal.Case 2: ❚ ✙ ✭ ✠ .In this case there are three subcases to consider, based on the size of ✠ : (a) ✠ ✩ ❚ ; (b) and ✾ contains two identical symbols, namely ❆ ✰❇ ✛ ❊ and ❆ ✰❇ ✛ ✢ ✠ ❊ , again contradicting observation (5).

.
Note that if ❚ is a prime number, then we have ✧ ❁| we would have ❚ ✒ ✙ ❏❈ ✩❇ ❯❳ ❬) ✜❭ ❊ , and so ❚ ✒ ( It is easy to show the following theorem about the existence of arbitrarily long squares in the sequence ❃ | ✂✁ ✄ ., then in Theorem 1 we proved the existence of overlaps, hence squares.Now the image of a square by ✜ | ✂✁ ✄ is a longer square.Iterating ✜ | ✖✁ ✄ and using the fact that ❃ | ✂✁ ✄ is a fixed point of ✜ | ✂✁ ✄ ✁ ❚ ✒ ✁ .The images of this square under iterates of ✜ | ✂✁ ✄ are arbitrarily large squares.