Academia.eduAcademia.edu

Fine and Wilf words for any periods II

2009, Theoretical Computer Science

Abstract

Let w = wt . ..w., be a word of maximal length n, and with a maximal number of distinct letters for this length, such that w has periods pt, . . ..pr but not period gcd(pt, . . ..pr). We provide a fast algorithm to compute n and w. We show that w is uniquely determined apart from isomorphism and that it is a palindrome. Furthermore we give lower and upper bounds for n as explicit functions of pt, . . ..pr. For I = 2 the exact value of n is due to Fine and Wilf. In case the number of distinct letters in the extremal word equals r a formula for n had been given by Castelli, Mignosi and Restivo in case Y = 3 and by Justin if r > 3.