 
Summary: Discrete Mathematics and Theoretical Computer Science (subm.), by the authors, 1rev
Sums of Digits, Overlaps, and Palindromes
JeanPaul Allouche 1 and Jeffrey Shallit 2y
1 CNRS, Laboratoire de Recherche en Informatique, B“atiment 490, F91405 Orsay Cedex, France
2 Department of Computer Science, University of Waterloo, Waterloo, Ontario N2L 3G1, Canada
received 3 Aug 1999, revised 8 Feb 2000, accepted ???.
Let sk (n) denote the sum of the digits in the basek representation of n. In a celebrated paper, Thue
showed that the infinite word (s2(n) mod 2)n–0 is overlapfree, 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 tk;m := (sk (n) mod m)n–0 is
overlapfree if and only if m – k. We also prove that tk;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.
Keywords: sum of digits, overlapfree sequence, palindrome
Contents
1 Introduction 1
2 Some useful lemmas 2
3 Proof of the main theorem 4
4 Squares in the sequence t k;m 8
5 Palindromes in t k;m 9
1 Introduction
