Discrete Mathematics 224 (2000) 215 223 www.elsevier.com/locate/disc Properties of Fibonacci languages S.S Yu a;, Yu-Kuang Zhao b a Department of Applied Mathematics, National Chung-Hsing University, Taichung, Taiwan b Required Courses Department, National Chung-Yi Institute of Technology, Taichung, Taiwan Abstract The Fibonacci language F u;v is the set of all Fibonacci words, where the rst word and the second word in the Fibonacci sequence are u and v, respectively. We show that the language F u;v is context-free free. We also show that F u;v is not dense if the word uv contains at least two distinct letters. Let w i denote the ith Fibonacci word. When considering the Fibonacci language F a;b for two distinct letters a and b, we show that for k 2 and 16i k, the word w iw i is not a prex of the Fibonacci word w k. We also show that for k 2, the language F k = {w nk n 1} is a code. c 2000 Elsevier Science B.V. All rights reserved. Keywords: Fibonacci word; Primitive; Palindrome word; Code; Context-free 1. Introduction Let X be a nite alphabet consisting of more than one element and let {a; b} X. Let X be the free monoid generated by X. Let 1 be the empty word and let X + =X \{1}. The length of a word x is denoted by lg (x). In this paper, for two words u; v X +, we consider the following two types of Fibonacci sequences of words: (1) w 1 = u; w 2 = v; w 3 = uv; :::; w n = w n 2 w n 1 ;::: ; (2) w 1 = u; w 2 = v; w 3 = vu; :::; w n = w n 1 w n 2 ;:::. Clearly, lg (w i ) lg (w i 1 ) for every i 3. Let F u;v ={w i i 1} and F u;v={w i i 1}. The language F a;b is a DOL language generated by the DOL rules a b and b ab (see [9]). The sequence of Fibonacci words plays a very important role in the combinatorial theory of free monoids for the recursively dened structure and remarkable combinatorial properties of Fibonacci words. Some properties concerning the Fibonacci language F u;v have been investigated by De Luca in [6], by Fan and Shyr in [1] and by Corresponding author. E-mail addresses: pyu@ower.amath.nchu.edu.tw (S. Yu), zhao@chinyi.ncit.edu.tw (Y. Zhao). 0012-365X/00/$ - see front matter c 2000 Elsevier Science B.V. All rights reserved. PII: S0012-365X(00)00089-3
216 S.S. Yu, Y. Zhao / Discrete Mathematics 224 (2000) 215 223 Knuth et al. in [4]. In this paper, we investigate properties of the Fibonacci language F u;v either. Section 2 is dedicated to investigate the relationships between Fibonacci words and primitive words. A word f X + which is not a power of any other word is called a primitive word. Let Q be the set of all primitive words over X [10]. It is known that every word in X + can be uniquely expressed as a power of a primitive word [8]. For x X +,ifx = f n, n 1, and f is a primitive word, then we call f the primitive root of the word x and is denoted by x. For a language A X +, let A = { x x A}. In Section 2, we characterize the Febonacci language F u;v consisting of primitive words. A word w X is said to be a proper d-factor of a word z X + if w z and z = wx = yw for some words x; y. The family of words which have i distinct proper d-factors is denoted by D(i). A word x X + is d-primitive if x = wy 1 = y 2 w, where w X + and y 1 ;y 2 X, implies that x = w and y 1 = y 2 = 1. The set D(1) is exactly the family of all d-primitive words. For the properties of D(i), one is referred to [12]. Consider w i F a;b. In Section 3, we show that {w 1 ;w 2 ;w 3 } D(1) and w i D(j) for i 4 and j = i=2. If x = a 1 a 2 a n, where a i X, then we dene the reverse (or mirror image) ofthe word x to be ˆx = a n a 2 a 1. A word x is called palindrome if x =ˆx. Remark that if u = a and v = b, then ŵ i = w i, i 1. Let R be the set of all palindrome words over the alphabet X. Note that 1 R. Clearly, if x XX + R, then x D(1). The palindrome words and languages are studied by De Luca in [6,7], by Knuth et al. in [4], and by Lin in his Master thesis [5]. For the motivation of studying palindrome words and languages, one is referred to [7,8]. We derive that F a;b R = {a; b; bab} and F a;b F a;b R = {aa; bb; aba; babbab; w 4 w 6 } {w 2n w 3 n 1} in Section 3. Section 4 deals with the properties concerning the Fibonacci language F u;v related to formal language theory. We show that F u;v is context-free free and not dense. Items not dened here or in the subsequence sections can be found in books [2] and [10]. A non-empty language L is a code if for x 1 ;x 2 ;:::;x n ;y 1 ;y 2 ; :::; y m L, x 1 x 2 x n = y 1 y 2 y m implies that m = n and x i = y i for i =1; 2; :::; n. In Section 5, we show that for k 2, F k = {w nk n 1} F a;b is a code. 2. F u;v and primitive words In [1], Fan and Shyr have proved that the Fibonacci languages F a;b and F a;b are subsets of Q. Now, we shall characterize non-empty words u and v such that F u;v Q. Lemma 1 (Lyndon and Schutzenbuger [8]). (1) Let xy = p i, x; y X +, p Q, i 1. Then yx = q i for some q Q. (2) For x; y X +, xy = yx implies that x = y. Lemma 2 (Shyr and Yu [11]). Let xq m = g k for some m; k 1; x X + ;q Q and g Q; with x q +. Then q g and lg (g) lg (q m 1 ).
S.S. Yu, Y. Zhao / Discrete Mathematics 224 (2000) 215 223 217 Proposition 3. Let u; v X +. Then uvvuv Q if and only if u = v. If uvvuv Q; then v Q. Proof. If u = v, say u = q for some q Q, then clearly uvvuv qq + ; hence uvvuv Q. Now, suppose that uvvuv Q. By Lemma 1, vuvuv Q. There exist g Q and k 2 such that v(uv) 2 =g k. By Lemma 2, lg (g) lg (uv). Thus, k =2. This implies that there exist v 1 ;v 2 X + such that v=v 1 v 2 and g=vuv 1 =v 2 uv, i.e., v 1 v 2 uv 1 =v 2 uv 1 v 2. Since lg (vuv 1 )=lg(v 2 uv), lg (v 1 )=lg(v 2 ). As v 1 v 2 uv 1 = v 2 uv 1 v 2, v 1 = v 2 and v 1 u = v 2 u = uv 1. By Lemma 1, v 1 = u. Thus, v = v 1 v 1 = v 1 = u and v Q. Proposition 4. For u; v X + ; there exists q Q such that F u;v q + or (F u;v \{u; v; uv; vuv}) Q. Proof. If u = v, say u = q for some q Q, then clearly F u;v q +. Remark that w 1 = u, w 2 = v and w i = w i 2 w i 1 for i 3. Suppose u v. Clearly, v uv and uv vuv. That is, wk w k+1 for 16k63. As w i =w i 2 w i 1 =w i 2 w i 3 w i 2 = w i 4 w i 3 w i 3 w i 4 w i 3 for every i 5, by (1) of Proposition 3, w 5 ;w 6 ;w 7 Q. Again, by (2) of Proposition 3, w j Q for every j 8. Proposition 5. For u; v X + ;F u;v Q if and only if u; v; uv; vuv Q. Proof. If F u;v Q, then clearly u; v; uv; vuv Q. Now, let u; v; uv; vuv Q. Since {u; v; uv; vuv} F u;v and F u;v * q + for any q Q, by Proposition 4, F u;v Q. Proposition 6. For u; v X + ;F u;v = F u;v if and only if u = v. Proof. If F u;v = F u;v, then uv = vu. By Lemma 1, u = v. Now suppose that u = v. Then there exist q Q and i; j 1 such that u = q i and v = q j. One has that F u;v q + and F u;v q +. For every k 1, since lg (w k )=lg(w k ), w k = w k. Therefore, F u;v = F u;v. For z X + and x; y X,ifz = xy, then x is called a prex of z and y is called a sux of z, denoted by x6 p z and y6 s z, respectively. If x z (y z), then x (y) is said to be a proper prex (proper sux) ofz, denoted by x p z (y s z). Proposition 7. Let u; v X +. Then w i 6 p w i+1 for any i 3 if and only if u = v. Proof. Suppose there exists i 3 such that, w i 6 p w i+1. Then w i =w i 2 w i 1 and w i+1 = w i 1 w i = w i 1 w i 2 w i 1. Since w i 2 w i 1 = w i 6 p w i+1 = w i 1 w i 2 w i 1, w i 2 w i 1 = w i 1 w i 2. Thus, w i 2 = w i 1. This implies that w i 2 6 p w i 1. Thus, one must have that w i 3 = w i 2. Finally, we shall get that u = w 1 = w 2 = v.
218 S.S. Yu, Y. Zhao / Discrete Mathematics 224 (2000) 215 223 Let q= u.if u= v, then F u;v q +. Thus, w i =q r and w i+1 =q s for some r; s 1 and s r. Then w i 6 p w i+1. From Propositions 3, 6 and 7, we have the following conclusion: Theorem 8. Let u; v X +. Then the following are equivalent: (1) u = v; (2) F u;v = F u;v; (3) uvvuv Q; (4) w i 6 p w i+1 for some i 3. 3. F a;b and d-primitive properties This section is dedicated to the studing of d-primitive and palindrome properties of Fibonacci words. Consider the Fibonacci language F a;b. First, we are going to investigate the relationship between i and j such that w i D(j). Lemma 9. For i 4; w i+1 y 1 y 2 w i+1 for every non-empty prex y 1 and sux y 2 of w i. Proof. Suppose there exist i 4 and y 1 ;y 2 X + such that y 1 6 p w i, y 2 6 s w i and w i+1 y 1 = y 2 w i+1. Then lg (y 1 )=lg(y 2 ). Case i: lg (y 1 )6lg (w i 1 ). Since w i+1 = w i 1 w i 2 w i 1, y 2 w i 1 w i 2 w i 1 = y 2 w i+1 = w i+1 y 1 = w i 1 w i 2 w i 1 y 1. This implies that there is z X such that w i 1 = zy 1 = y z for some y X +. Then lg (y )=lg(y 1 ). As lg (y 2 )=lg(y 1 )=lg(y ) and y 2 6 p w i 1, y 2 =y, i.e., w i 1 =zy 1 =y 2 z. Thus, y 2 y 2 zw i 2 zy 1 =y 2 w i 1 w i 2 w i 1 =w i 1 w i 2 w i 1 y 1 = y 2 zw i 2 y 2 zy 1, i.e., y 2 zw i 2 = zw i 2 y 2. By Lemma 1, y2 = zw i 2. One has that w i 1 w i 2 = y 2 zw i 2 Q. By Lemma 1, w i = w i 2 w i 1 Q. This contradicts the fact that w i Q for every i [3]. Case ii: lg (y 1 ) lg (w i 1 ). As w i = w i 2 w i 1 and y 2 6 s w i, there exist x 1 ;x 2 X such that w i 2 = x 2 x 1 and y 2 = x 1 w i 1, where lg (x 1 )6lg (w i 2 ) lg (w i 1 ). Again, w i = w i 2 w i 1 and y 1 6 p w i imply that there is x 3 X + such that y 1 = w i 2 x 3 and x 3 6 p w i 1. There is z 1 X such that w i 1 =x 3 z 1. Since w i+1 y 1 =w i+1 w i 2 x 3 =y 2 w i+1 = y 2 w i 1 w i 2 w i 1, x 3 6 s w i 1. There is z 2 X such that w i 1 = z 2 x 3. Subcase ii(1): z 2 1. From the equation w i+1 y 1 = w i 1 w i 2 w i 1 w i 2 x 3 = w i 1 w i 2 z 2 x 3 w i 2 x 3 =y 2 w i+1 =x 1 w i 1 w i 1 w i 2 w i 1 =x 1 w i 1 z 2 x 3 w i 2 d 2 x 3, one has that z 2 x 3 w i 2 =x 3 w i 2 z 2. By Lemma 1, z 2 = x 3 w i 2. Thus, w i 1 w i 2 =z 2 x 3 w i 2 Q. By Lemma 1, w i = w i 2 w i 1 Q, a contradiction. Subcase ii(2): z 2 = 1. Then x 3 = w i 1 and y 1 = w i 2 w i 1 = w i. Since lg (y 2 )=lg(y 1 ) and y 2 6 s w i, y 2 = w i. One has that w i+1 w i = w i+1 y 1 = y 2 w i+1 = w i w i+2. By Lemma 1, wi+1 = w i. Again, w i+2 = w i w i+1 Q, a contradiction.
S.S. Yu, Y. Zhao / Discrete Mathematics 224 (2000) 215 223 219 Proposition 10. For i 4; w i = x(yx) j for some x; y X and j 0 with lg (x) lg (w i 2 ) if and only if (1) x = w i or (2) x = w i 2 ;y= w i 3 and w i = xyx. Proof. Let i 4. If (1) x = w i and y = 1 or (2) x = w i 2 and y = w i 3, then clearly w i = x or w i = xyx. Conversely, by the observation of w 1 = a, w 2 = b, w 3 = ab, w 4 = bab, w 5 = abbab and w 6 = bababbab, the result is true for i =4; 5; 6. Now, let i 7 and w i = x(yx) j for some x; y X and j 0 with lg (x) lg (w i 2 ). If x = w i, then clearly w i = x(yx) j for y = 1 and j = 0. Since w i = w i 2 w i 3 w i 2 and lg (w i 3 ) lg (w i 2 ), if x = w i 2, then w i = x(yx) j implies that y = w i 3, j = 1 and w i = xyx. Consider the case that x w i 2 and x w i.asw i = w i 2 w i 3 w i 2 = x(yx) j and lg(x) lg(w i 2 ), j = 1 and w i = xyx. By the condition lg(x) lg(w i 2 ), there exist a non-empty proper prex y 1 and a non-empty proper sux y 2 of w i 3 such that x = w i 2 y 1 = y 2 w i 2.Asi 7, i 3 4. This contradicts the result w i 2 y 1 y 2 w i 2 obtained in Lemma 9. Theorem 11. (1) {a; b; ab} D(1); (2) for i 4; w i D(j); where j = i=2. Proof. By the observation of w 1 = a, w 2 = b, w 3 = ab, w 4 = bab and w 5 = abbab, {a; b; ab} D(1) and {w 4 ;w 5 } D(2). Let i 6. As w i = w i 2 w i 3 w i 2, if there is x X + such that lg(x) lg(w i 2 ), x6 p w i and x6 s w i, then by Proposition 10, x = w i 2 or x = w i. Also, as w i = w i 2 w i 3 w i 2, for every x X with lg(x) lg(w i 2 ), x6 p w i and x6 s w i imply that x6 p w i 2 and x6 s w i 2. Thus, if w i 2 D(k) for some j 1, then w i D(k + 1). Therefore, for i 4, w i D(j), where j = i=2. Two words x; y X + are non-overlapping if every non-empty prex of x is not a sux of y, and vice versa. For u; v X +,if{u; v} D(1) and u; v are non-overlapping, one can also show a similar result for w i F u;v as the result obtained in Theorem 11. Next, we are going to nd out the relationship between the Fibonacci language F a;b and R. Proposition 12. F a;b R = {a; b; bab}. Proof. By [1], F a;b R 2 = F a;b \{a; b; ab; bab}. In [13], we show that R 2 (R Q)=, where 1 Q. In [1], it is shown that F a;b Q. Since a; b; bab R and ab R, F a;b R = {a; b; bab}. Remark that for x; z X + and y X, if xyz R and lg(x) = lg(z), then ˆx = z and y R. In [6], it is shown that for all n 3, ŵ n = n d n, where n R and d n = ab if n is even and d n = ba if n is odd. This property implies that for all n 2, ŵ 3 ŵ 2n R [5]. Proposition 13. F a;b F a;b R = {aa; bb; aba; babbab; w 4 w 6 } {w 2n w 3 n 1}.
220 S.S. Yu, Y. Zhao / Discrete Mathematics 224 (2000) 215 223 Proof. By [5], it is shown that ({aa; bb; aba; babbab; w 4 w 6 } {w 2n w 3 n 1}) R. Here, we shall show that ( F a;b F a;b R ) \({aa; bb; aba; babbab; w 4 w 6 } {w 2n w 3 n 1}) =. We consider the following cases of w i w j for i; j 1: Case 1: j = 1 and i 1. Clearly, w 1 w 1 = aa R and w 3 w 1 = aba R. From [6], one has that b6 p w i for every even number i 4 and w 2 = b. Since w j = w 1 = a, w i w j = w i a R for every even number i. From [6], again, one has that w i = ab i for every odd number i 5, where i R. Remark that i contains at least one a for every i 5. If w i w j = ab i a R, then b i R. Thus, b i = i b. By Lemma 1, b = b = i. That is, i b + which is impossible for every odd number i 5. Thus w 2 w 1 R and w i w 1 R for every i 4. Case 2: j 2 and i =2k 1 for k 1. Since b6 s w j for every j 2 and a6 p w i for every odd number i, w i w j R. Therefore, in the following cases, we only consider the case of even numbers i. Case 3: j = 2 and i =2k for k 1. Clearly, w 2 w 2 = bb R. From [6], one has that w i = ba i for every even number i 4, where i R. Remark that i contains at least one b for every i 4. If w i w j = ba i b R, then a i R. Thus a i = i a. By Lemma 1, a = a = i. That is, i a + which is impossible for every even number i 4. Case 4: j = 3 and i =2k for k 1. For every even number i 2, by [1], w i w j R. Case 5: j = 4 and i =2k for k 1. Clearly w 2 w 4 = bbab R and w 4 w 4 = babbab R. For every even number i 6, since w 6 6 p w i and w 6 = bababbab, w i = baba i b for some i X +. Since a i b R for every i X +, w i w 4 = baba i bbab R for every even number i 6. Case 6: j = 5 and i =2k for k 1. Clearly, w 2 w 5 = babbab R. By Proposition 12, w 4 w 5 = w 6 R. For every even number i 6, since w 6 6 p w i and w 6 = bababbab, w i =babab i for some i X +.Aslg(babab)=lg(w 5 ) and ŵ 5 =babba babab, w i w 5 = babab i w 5 R for every even number i 6. Case 7: j = 6 and i =2k for k 1. Clearly, w 2 w 6 = bbababbab R and w 4 w 6 = babbababbab R. For every even number i 6, since w 6 6 p w i, w i = w 6 x i for some x i X. By Proposition 12, w 6 R. Thus, w i w 6 = w 6 x i w 6 R. Case 8: j 7 and i =2k for k 1. For every j 7, w 6 6 s w j. And for every j 7, w 5 6 p w j if j is odd and w 6 6 p w j if j is even. Thus, for j 7, there is x j X such that w j = w 5 x j w 6 = w 5 x j bababbab if j is odd and w j = w 6 x j w 6 = w 6 x j bababbab if j is even. Thus, b6 p w j if j is even. Now, we consider the following subcases: Subcase 8(i): i =2. If j is even, then bb6 p bw j = w 2 w j.asab6 s w j, w 2 w j R. If j = 7, then w 2 w 7 = b(abbabbababbab)=(babbab)ba(babbab) R. Ifj 9 is odd, then w j =w 5 w 6 j w 6 for some j X. Thus, w 2 w j =bw 5 w 6 j w 6 =(babbab)w 6 j ba(babbab). As b6 p w 6, w 6 j ba R. This implies that w 2 w j R. Subcase 8(ii): i = 4. For odd number j 7, w 4 w j = w 4 w 5 x j w 6 = w 6 x j w 6. Since w 6 R, w 4 w j = w 6 x j w 6 R. For even number j 8, w 4 w j = w 4 w 6 x j w 6 =(bab) (bababbab)x j (babbabab)=(bab)bababbabx j babba(bab) R. Subcase 8(ii): i =2k for k 3. For i =2k and k 3, w 6 =w 4 w 5 6 p w i. Then w i =w 6 y i for some y i X. Thus w i w j = w 6 y i w 5 x j w 6 or w i w j = w 6 y i w 6 x j w 6.Asw 6 R, w i w j R for every even number i 6.
S.S. Yu, Y. Zhao / Discrete Mathematics 224 (2000) 215 223 221 4. F u;v related to formal language theory A language L is said to be regular free (context-free free) if every innite subset of L is not a regular (context-free) language. Of course, if a language is context-free free, then it is also regular free. It is known that if L is an innite context-free language, then there exist x 1 ;x 2 ;x 3 ;x 4 ;x 5 X,lg(x 2 x 4 ) 1 such that {x 1 x n 2 x 3x n 4 x 5 n 0} L (see [2]). A language of the form {x 1 x n 2 x 3x n 4 x 5 n 0} is called a context-free component. Theorem 14. For any u; v X + ;F u;v is context-free free. Proof. Suppose on the contrary that F u;v is not context-free free. Then there is an in- nite context-free subset of F u;v. That is, there exist x 1 ;x 2 ;x 3 ;x 4 ;x 5 X,lg(x 2 x 4 ) 1, such that {x 1 x2 nx 3x4 nx 5 n 0} F u;v. Remark that w 1 = u, w 2 = v, w i = w i 2 w i 1 for i 3, F u;v = {w i i 1} and lg(w i ) lg(w i+1 ) for every i 2. There is k 3 such that w k = x 1 x j 2 x 3x j 4 x 5 for some j 1 and lg(w k 1 ) lg(x 2 x 4 ). This implies that lg(w k+1 )= lg(w k 1 )+lg(w k ) lg(x 1 x j+1 2 x 3 x j+1 4 x 5 ). Thus x 1 x j+1 2 x 3 x j+1 4 x 5 F u;v, a contradiction. Therefore, F u;v is context-free free. A word is said to be 4-powers free if it has no subword in the form x 4 for any word x X +. A language is called 4-powers free if every word in this language is 4-powers free. A language L is dense if for every x X, X xx L. IfX = {c} and u; v X +, then clearly, F u;v is dense. In the following proposition, we consider the case that X 2. Proposition 15. For u; v X + ;F u;v is not dense. Proof. By denition, every word in F u;v, except u and v, is a product of u and v. If u; v c + for c X, then F u;v c +. Clearly, in this case, F u;v is not dense. Now, suppose that the word uv contains at least two distinct letters. By [3], F a;b is 4-powers free. Every subword w of a Fibonacci word with lg(w)=4lg(uv) must contain at least one u and one v. This implies that every subword of a Fibonacci word with length longer than or equal to 4 lg(uv) containing at least two distinct letters. Thus, for any a X, the word a 4lg(uv) cannot be a subword of any word in F u;v. Thus F u;v is not dense. 5. The Fibonacci language F a;b and codes It is shown that languages F 1 1 = {w n n =2k 1;k 1} and F 1 2 = {w n n =2k; k 1} are codes [1], where w 1 = a, w 2 = b and w i = w i 2 w i 1, i 3. In this section, we are going to show that for k 2, the language F k = {w nk k 1} is also a code. Lemma 16. For every i 1; w i p w i+1.
222 S.S. Yu, Y. Zhao / Discrete Mathematics 224 (2000) 215 223 Proof. By observation, w 1 p w 2 and w 2 p w 3. Since a=a b= b, by Proposition 7, w i p w i+1 for every i 3. Moreover, from the denition of Fibonacci sequence w 1 ;w 2 ;:::;w n ;:::; we give the following remark: Remark 17. (1) If w i1 6 p w j and w i2 6 p w j for some i 1 ;i 2 ;j 1 with i 1 i 2, then w i2 6 p w i1. (2) w i 6 p w j implies that j i is an even number. Proposition 18. Let k 5. Then for 16i6k 4; w i 6 p w k implies that w i w i+1 w i+1 w i w i+1 6 p w k. Proof. Since w j =w j 2 w j 1 =w j 2 w j 3 w j 2 =w j 4 w j 3 w j 3 w j 4 w j 3 for every j 5, w 5 =w 1 w 2 w 2 w 1 w 2. We shall prove this proposition by induction on the number j. Now suppose we know the result for 56j6n. Consider the word w k.ifi = n 3 such that w i 6 p w n+1, by w n+1 = w n 3 w n 2 w n 2 w n 3 w n 2, w n 3 w n 2 w n 2 w n 3 w n 2 6 p w n+1. If there is i n 3 such that w i 6 p w n+1, then by Remark 17, 16i6n 5. Since w n+1 = w n 1 w n, w i 6 p w n 1 with i6(n 1) 4. By the induction hypothesis, w i w i+1 w i+1 w i w i+1 6 p w n 1. Thus w i w i+1 w i+1 w i w i+1 6 p w n+1. Proposition 19. For each k 2; w i w i p w k for every i k. Proof. Since w 1 = a, w 2 = b, w 3 = ab, w 4 = bab and w 5 = abbab, for 26k65, w i w i p w k for every i k. For k 5, suppose there is i k such that w i w i 6 p w k. Since w k = w k 2 w k 1 and w k 2 p w k 1, w k 2 w k 2 p w k. By Remark 17, i6k 4. By Proposition 18, w i 6 p w k and 16i6k 4 imply that w i w i+1 w i+1 w i w i+1 6 p w k. Thus, w i 6 p w i+1, by Lemma 16, which is impossible. Theorem 20. For k 2; the language F k = {w nk n 1} is a code. Proof. As F2 1 is a code, it is true for every even number k. Now, let k 3 beanodd number. Suppose F k is not a code. Then there exist w i1 ;w i2 ;:::;w in ;w j1, w j2 ;:::;w jm F k for some nite integers m; n 1 such that w i1 w j1 and w i1 w i2 w in = w j1 w j2 w jm. Since w i1 w j1, let i 1 j 1. Then w i1 6 p w j1. By the denition of F k, j 1 2k 6. By Remark 17 and k is an odd number, i 1 6j 1 2k6j 1 6. From Proposition 18, one has that w i1 w i1+1w i1+1w i1 w i1+16 p w j1. By Proposition 19, w i1+1w i1+1 p w i2. Thus, w i2 6 p w i1+1w i1+1; and hence w i2 6 p w i1+1. Since w i1+1 F k and w i1 p w i1+1, i 2 6 i 1 k6i 1 3, that is, i 2 6(i 1 +1) 4. Again, w i2 w i2+1w i2+1w i2 w i2+16 p w i1+1. Similarly, w i3 p w i2+1 and i 3 6(i 2 +1) 4. Since n is nite, there exists an integer 16r6n such that w ir p w ir+1. This contradicts the condition that w i1 w i2 w in = w j1 w j2 w jm. By a similar proof, one can derive that for every k 2 and m 1, the language F k = {w nk+m n 0} is a code. This result extends the results, F1 1 and F1 2 being codes, obtained in [1].
S.S. Yu, Y. Zhao / Discrete Mathematics 224 (2000) 215 223 223 Acknowledgements The author would like to thank the referee for his careful reading of the manuscript and valuable suggestions. References [1] C.M. Fan, H.J. Shyr, Some properties of bonacci languages, Tamkang J. Math. 27 (2) (1996) 165 182. [2] J.E. Hopcroft, J.D. Ullman, Formal Languages and Their Relation to Automata, Addison-Wesley, Reading, MA, 1969. [3] J. Karhumaki, On cube-free!-words generated by binary morphism, Discrete Appl. Math. 5 (1985) 279 297. [4] D.E. Knuth, J.H. Morris, V.R. Pratt, Fast pattern matching in strings, SIAM J. Comput. 6 (1977) 323 350. [5] Y.Y. Lin, in: Properties of words and the related homomorphisms, Master Thesis, Institute of Applied Mathematics, Chung-Yuan Christan University, Chung-Li, Taiwan, 1995. [6] A. De Luca, A combinatorial property of bonacci words, Inform. Process Lett. 12 (1981) 193 195. [7] A. De Luca, On the combinatorial problems in free monoids, Discrete Math. 38 (1982) 207 225. [8] R.C. Lyndon, M.P. Schutzenberger, The equation a M = b N c P in a free group, Michigan Math. J. 9 (1962) 289 298. [9] G. Rozenberg, A. Salomaa, The Mathematical Theory of L Systems, Academic Press, New York, 1980. [10] H.J. Shyr, Free monoids and languages, 2nd Edition, Hon Min Book Company, Taichung, Taiwan, 1991. [11] H.J. Shyr, S.S. Yu, Non-primitive words in the language p + q +, Soochow J. Math. 20 (4) (1994) 535 546. [12] S.S. Yu, d-minimal languages, Discrete Appl. Math. 89 (1998) 243 262. [13] S.S. Yu, Palindrome words and reverse closed languages, Internat. J. Comput. Math. (2000), in press.