PU.M.A. Vol. 17 (2006), No. 3–4, pp. 183–195 Properties of palindromes in finite words Mira-Cristiana Anisiu Tiberiu Popoviciu Institute of Numerical Analysis Romanian Academy, Cluj-Napoca e-mail: mira@math.ubbcluj.ro and Valeriu Anisiu Department of Mathematics Faculty of Mathematics and Computer Science Babeş-Bolyai University of Cluj-Napoca e-mail: anisiu@math.ubbcluj.ro and Zoltán Kása Department of Computer Science Faculty of Mathematics and Computer Science Babeş-Bolyai University of Cluj-Napoca e-mail: kasa@cs.ubbcluj.ro (Received: July 12–15, 2006) Abstract. We present a method which displays all palindromes of a given length from De Bruijn words of a certain order, and also a recursive one which constructs all palindromes of length n +1 from the set of palindromes of length n. We show that the palindrome complexity function, which counts the number of palindromes of each length contained in a given word, has a different shape compared with the usual (subword) complexity function. We give upper bounds for the average number of palindromes contained in all words of length n, and obtain exact formulae for the number of palindromes of length 1 and 2 contained in all words of length n. Mathematics Subject Classifications (2000). 68R15 1 Introduction The palindrome complexity of infinite words has been studied by several authors (see [1], [3], [14] and the references therein). Similar problems related to the number of palindromes are important for finite words too. One of the reasons is that palindromes occur in DNA sequences (over 4 letters) as well as in protein description (over 20 letters), and their role is under research ([9]). Let an alphabet A with card (A)= q ≥ 1 be given. The set of the words of length n over A will be denoted by A n . Given a word w = w 1 w 2 ...w n , the reversed of w is w = w n ...w 2 w 1 . Denoting by ε the empty word, we put by convention ε = ε. The word w is a palindrome if w = w. We denote by a k the word a...a k times . The set of the subwords of a word w which are nonempty palindromes will be denoted by PAL (w). The (infinite) set of all palindromes over the alphabet A is denoted by PAL (A), while PAL n (A) = PAL (A) ∩ A n . 183