some kinds of primitive and non-primitive words

8
Acta Informatica DOI 10.1007/s00236-014-0200-3 ORIGINAL ARTICLE Some kinds of primitive and non-primitive words Cao Chunhua · Yang Shuang · Yang Di Received: 27 December 2013 / Accepted: 25 March 2014 © Springer-Verlag Berlin Heidelberg 2014 Abstract If the length of a primitive word p is equal to the length of another primitive word q , then p n q m is a primitive word for any n, m 1 and (n, m) = (1, 1). This was obtained separately by Tetsuo Moriya in 2008 and Shyr and Yu in 1994. In this paper, we prove that if the length of p is divisible by the length of q and the length of p is less than or equal to m times the length of q , then p n q m is a primitive word for any n, m 1 and (n, m) = (1, 1). Then we show that if u v, u are non-primitive words and the length of u is divisible by the length v or one of the length of u and u v is odd for any two nonempty words u and v, then u is a power of v. 1 Introduction Primitive words play a considerable role in the field of combinatorics on words, an area in discrete mathematics motivated in part by computer science (see [24, 811, 19, 21]). They also have important applications in information theory, coding theory and molecular biology (see[1, 5, 7, 13, 16, 22]). In 1962, it was shown by Lyndon and Schützenberger that every nonempty word can be expressed by a unique power of a unique primitive word (see [11]). So it is essential to present as many kinds of primitive words as possible in Formal Languages Theory. Many mathematicians have studied this topic (see [6, 11, 14, 1618, 20]). Let p and q be different primitive words. If n, m 2, then p n q m is a primitive word (see [11]). When n = 1, m 2 or n 2, m = 1, p n q m may not be a primitive word. For instance: let This work is supported by National Natural Science Foundation of China # 11261066 and Foundation for the Forth Yunnan University Key Teacher # XT412003. C. Chunhua · Y. Shuang School of Mathematics and Statistics, Yunnan University, Kunming, China Y. Di (B ) School of Information, Yunnan University of Finance and Economics, Kunming, China e-mail: [email protected]; [email protected] 123

Upload: yang

Post on 21-Jan-2017

220 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Some kinds of primitive and non-primitive words

Acta InformaticaDOI 10.1007/s00236-014-0200-3

ORIGINAL ARTICLE

Some kinds of primitive and non-primitive words

Cao Chunhua · Yang Shuang · Yang Di

Received: 27 December 2013 / Accepted: 25 March 2014© Springer-Verlag Berlin Heidelberg 2014

Abstract If the length of a primitive word p is equal to the length of another primitive wordq , then pnqm is a primitive word for any n, m ≥ 1 and (n, m) �= (1, 1). This was obtainedseparately by Tetsuo Moriya in 2008 and Shyr and Yu in 1994. In this paper, we prove thatif the length of p is divisible by the length of q and the length of p is less than or equal to mtimes the length of q , then pnqm is a primitive word for any n, m ≥ 1 and (n, m) �= (1, 1).Then we show that if uv, u are non-primitive words and the length of u is divisible by thelength v or one of the length of u and uv is odd for any two nonempty words u and v, thenu is a power of v.

1 Introduction

Primitive words play a considerable role in the field of combinatorics on words, an area indiscrete mathematics motivated in part by computer science (see [2–4,8–11,19,21]). Theyalso have important applications in information theory, coding theory and molecular biology(see[1,5,7,13,16,22]). In 1962, it was shown by Lyndon and Schützenberger that everynonempty word can be expressed by a unique power of a unique primitive word (see [11]).So it is essential to present as many kinds of primitive words as possible in Formal LanguagesTheory. Many mathematicians have studied this topic (see [6,11,14,16–18,20]). Let p andq be different primitive words. If n, m ≥ 2, then pnqm is a primitive word (see [11]). Whenn = 1, m ≥ 2 or n ≥ 2, m = 1, pnqm may not be a primitive word. For instance: let

This work is supported by National Natural Science Foundation of China # 11261066 and Foundation for theForth Yunnan University Key Teacher # XT412003.

C. Chunhua · Y. ShuangSchool of Mathematics and Statistics, Yunnan University, Kunming, China

Y. Di (B)School of Information, Yunnan University of Finance and Economics,Kunming, Chinae-mail: [email protected]; [email protected]

123

Page 2: Some kinds of primitive and non-primitive words

C. Chunhua et al.

p = ab and q = bababb where a, b are different letters, then p2q is a non-primitive word.If lg(p) = lg(q), then pnqm is a primitive word for any n, m ≥ 1 and (n, m) �= (1, 1) (see[14,20]). In this paper, we will show that if lg(q) | lg(p) and lg(p) ≤ m · lg(q), then pnqm

is a primitive word for any n, m ≥ 1 and (n, m) �= (1, 1).The paper is organized as follows. Some related definitions and preliminaries are presented

in Sect. 2. In Sect. 3, we give some kinds of primitive words when lg(q) | lg(p) or lg(p) ≤lg(q). We also show that if lg(q) | lg(p) and lg(p) ≤ m · lg(q) for two different primitivewords p, q , then pnqm is a primitive word for any n, m ≥ 1 and (n, m) �= (1, 1). Thisis a generalization of the results in [11,14,20]. In Sect. 4, we will prove that if uv, u arenon-primitive words and lg(v) | lg(u) or one of lg(u) and lg(uv) is odd, then u ∈ v+.

2 Preliminaries

Let X be a nonempty finite set of letters and |X | be the number of letters in X . Any finitestring over X is called a word. For example, w = ababbaaa is a word over {a, b}. The wordthat contains no letters is called the empty word, denoted by 1. The set of all words is denotedby X∗, which is a free monoid with concatenation. For example, the product of two wordsx = abb and y = abbbaa is the word xy = abbabbbaa. For any word w in X∗, let lg(w)

be the number of letters that occur in w and lg(1) = 0. Then lg(w) = 8 for the former wordw = ababbaaa. Let X+ = X∗ \ {1}. For u, v ∈ X∗, u is called a prefix of v, denoted byu ≤p v, if v = ux for some x ∈ X∗. If x ∈ X+, then u is a proper prefix of v, denoted byu <p v. Similarly, we have u ≤s v if and only if v = yu for some y ∈ X∗. If y ∈ X+, thenu <s v.

The powers of a word w ∈ X∗ are defined inductively: w0 = 1 and wn+1 = wnw forn ≥ 0. For instance, if w = aaaa where a ∈ X , we call it the fourth power of a and itslength is 4. A nonempty word u is a primitive word if u is not a power of any other nonemptyword. A nonempty word which is not a primitive word is called a non-primitive word or aperiodic word. Let Q be the set of all primitive words over X and let Q(i) = { f i | f ∈ Q}for any i ≥ 2. For any u ∈ X+, there exists a unique primitive word f and a unique integert ≥ 1 such that u = f t , and

√u = f is called the primitive root of u (see [11,16]). When

t ≥ 2, the word u is a non-primitive word. Every non-primitive word must be in some Q(i)

for some i ≥ 2 (see [16]).

Lemma 2.1 [11,16] Let p, q ∈ Q and p �= q. Then pnqm ∈ Q for all n, m ≥ 2.

Lemma 2.2 [16,18] Let u, v ∈ X+. If uv = f i for some f ∈ Q and i ≥ 1, then vu = gi

for some g ∈ Q. Specially, uv ∈ Q if and only if vu ∈ Q.

Lemma 2.3 [11,16] Let u, v ∈ X+. If uv = vu then u, v are powers of a common primitiveword.

The following is a Theorem of Fine and Wilf which is cited in [8–10,13,16,21].

Lemma 2.4 [16] Let u, v ∈ X+. If um and vn have a common initial segment of lengthlg(u) + lg(v), then u, v are powers of a common primitive word.

Definitions which are used in the paper but not stated here can be found in [13,16,21]. Inthis paper, we always let |X | ≥ 2.

123

Page 3: Some kinds of primitive and non-primitive words

Primitive and non-primitive words

3 Primitive words

Lemma 3.1 [14,20] Let p, q ∈ Q and p �= q. If lg(p) = lg(q), then pnqm ∈ Q forn, m ≥ 1 and (n, m) �= (1, 1).

Lemma 3.2 [20] Let p, q ∈ Q and p �= q. If pqm = gk for some m, k ≥ 2, g ∈ Q, thenone of the following is true.

(1) If lg(g) > lg(qm), then p = (xqm)k−1x for some x ∈ X+;

(2) If lg(g) < lg(qm), then p = (yx(x(yx) j+1)m−1)k−2 yx(x(yx) j+1)m−2xy, q =x(yx) j+1 for some x, y ∈ X+, x �= y and j ≥ 0.

Theorem 3.3 Let p, q ∈ Q and p �= q. If lg(q) | lg(p) and lg(p) ≤ m · lg(q), thenpnqm ∈ Q for n, m ≥ 1 and (n, m) �= (1, 1).

Proof If m, n ≥ 2, then pnqm ∈ Q by Lemma 2.1. If m = 1 and n ≥ 2, from lg(q) | lg(p)

and lg(p) ≤ m ·lg(q) = lg(q) it follows that lg(p) = lg(q). Hence pnq ∈ Q by Lemma 3.1.If n = 1 and m ≥ 2, suppose that pnqm = pqm /∈ Q. Then pqm = gk for some g ∈ Qand k ≥ 2. Since lg(p) ≤ m · lg(q) = lg(qm) and g ∈ Q, g �= qm , then lg(g) < lg(qm).By Lemma 3.2, we have p = (yx(x(yx) j+1)m−1)k−2 yx(x(yx) j+1)m−2xy, q = x(yx) j+1

for some x, y ∈ X+, x �= y, j ≥ 0. Let lg(x(yx) j+1) = n1, lg(yx) = n2. Then n1 =( j + 1)n2 + lg(x). Since 0 < lg(x) < n2, then n2 � n1 and n2 < n1. So lg(q) = n1 andlg(p) = 2n2 + n1(m − 1)(k − 2) + n2(k − 2) + n1(m − 2) = kn2 + n1[(k − 1)m − k]. Weconsider the following cases for k ≥ 2:

(1) If k ≥ 4, then (k − 1)m − k ≥ 3m − 4 ≥ m. So lg(p) ≥ kn2 + mn1 > m · lg(q), whichis a contradiction.

(2) If k = 3, then lg(p) = 3n2 + n1(2m − 3) = 3n2 + mn1 + n1(m − 3).

(2-1) If m ≥ 3, then lg(p) ≥ 3n2 + mn1 > m · lg(q), which is a contradiction.(2-2) If m = 2, then lg(p) = 3n2 + n1. So lg(q) < lg(p) ≤ 2lg(q). Since lg(q) | lg(p),

then lg(p) = 2lg(q). Therefore 3n2 + n1 = 2n1. Thus 3n2 = n1, which contradictsn2 � n1.

(3) If k = 2, then lg(p) = 2n2 + mn1 − 2n1 = n1(m − 2) + 2n2.

(3-1) If m ≥ 3, then (m − 2)n1 < n1(m − 2) + 2n2 = mn1 − 2(n1 − n2) < mn1. That(m−2)·lg(q) < lg(p) < m ·lg(q). Since lg(q) | lg(p), then lg(p) = (m−1)·lg(q).Hence 2n2 = n1, which also contradicts n2 � n1.

(3-2) If m = 2, then lg(p) = 2n2. Since n2 < n1, then lg(p) < 2lg(q). Since lg(q) |lg(p), then lg(p) = lg(q). Hence 2n2 = n1, which also contradicts n2 � n1.

From all above, we can obtain that pnqm ∈ Q for n, m ≥ 1, (n, m) �= (1, 1). �Corollary 3.4 Let p, q ∈ Q and p �= q. If lg(q) | lg(p) and lg(p) ≤ m · lg(q), thenpnqm pk ∈ Q for n, m, k ≥ 1.

Proof Since n +k ≥ 2, then pn+kqm ∈ Q by Theorem 3.3. So pnqm pk ∈ Q by Lemma 2.2.

Lemma 3.5 [20] Let q ∈ Q, u ∈ X+, u /∈ q+, lg(u) ≤ lg(q). If uqm = gk for some g ∈ Qand m, k ≥ 2, then k = 2, m = 2, u ∈ Q, u = yxxy, q = x(yx) j+1 for some x, y ∈ X+and x �= y, j ≥ 0. Moreover, x and y are not powers of a common word.

123

Page 4: Some kinds of primitive and non-primitive words

C. Chunhua et al.

Lemma 3.6 [20] Let p, q ∈ Q and p �= q. Then |p+q+ ⋂(⋃

i≥2 Q(i))| ≤ 1.

Theorem 3.7 Let p, q ∈ Q and p �= q. If lg(q) | lg(p) and lg(p) ≤ j · lg(q), thenpi q j (pr q j )m ∈ Q for m, r, j ≥ 1, i ≥ 0 and i �= r, (r, j) �= (1, 1).

Proof Since lg(q) | lg(p) and lg(p) ≤ j · lg(q), then pr q j ∈ Q by Theorem 3.3. Weconsider the following cases:

(1) If i = 0, then pi q j (pr q j )m = q j (pr q j )m . Let q j (pr q j )m = gn where g ∈ Q andn ≥ 1. Then pr gn = pr q j (pr q j )m = (pr q j )m+1 ∈ Q(m+1) for m + 1 ≥ 2. Sopr gn /∈ Q. We want to prove that n = 1. Suppose n ≥ 2. When m = 1, we haveq j pr q j = q j (pr q j )m = gn /∈ Q. But by Corollary 3.4, we know q j pr q j ∈ Q. This isa contradiction. When m ≥ 2, let u = q j . Since u(pr q j )m = q j (pr q j )m = gn wherem, n ≥ 2, lg(q j ) < lg(pr q j ), q j /∈ (pr q j )+ and pr q j ∈ Q, then by Lemma 3.5 wehave u = q j ∈ Q, so j = 1, and m = n = 2, q = yxxy, pr q j = pr q = x(yx)k+1

for some x, y ∈ X+, x �= y, k ≥ 0. Let n2 = lg(xy) and n1 = lg(x(yx)k+1). Sincen1 = (k + 1)n2 + lg(x) and 0 < lg(x) < lg(xy) = n2, then n2 � n1. So lg(q) � lg(pr q).But as lg(q) | lg(p) then lg(q) | lg(pr q). This is also a contradiction. Thus n = 1, thatis to say q j (pr q j )m ∈ Q.

(2) If i ≥ 1, since we know q j (pr q j )m ∈ Q by (1), then p �= q j (pr q j )m . By Lemma 3.6,we have |p+[q j (pr q j )m]+ ⋂

(⋃

s≥2 Q(s))| ≤ 1. Since pr q j (pr q j )m ∈ Q(m+1) wherem + 1 ≥ 2, then pi q j (pr q j )m ∈ Q for any i �= r .

From all above, we obtain that pi q j (pr q j )m ∈ Q for m, r, j ≥ 1, i ≥ 0 and i �= r . �If u ∈ X+ and u /∈ a∗ for some a ∈ X , then one of ua, u must be primitive (see [16]). If

u, v ∈ X+ and u /∈ v∗ with lg(v) | lg(u), then one of uv, u must be primitive (see [12]). Letv ∈ X+ and |v|a denote the number of the letter a ∈ X occurring in the word v. Then wewill show that if |v|a = 0 and lg(v) ≤ lg(u) < 2lg(v), then one of the words ua, uv mustbe primitive.

Proposition 3.8 Let u, v ∈ X+ and |v|a = 0 for a ∈ X. If lg(v) ≤ lg(u) < 2lg(v), thenone of the words ua, uv must be primitive.

Proof Suppose ua and uv are non-primitive words. Let ua = yi+1 for some y ∈ Q andi ≥ 1. Let y = xa for some x ∈ X∗. Then u = (xa)i x . Hence lg(u) = (i + 1)lg(x) + i .By lg(u) < 2lg(v), we have lg(x) < lg(v). Since uv /∈ Q, let uv = f j for some f ∈ Qand j ≥ 2. Let u = f j−m−1 f1 and v = f2 f m where f = f1 f2, f1, f2 ∈ X∗ andj − m − 1, m ≥ 0. Then (xa)i x = u = f1( f2 f1)

j−m−1 and v = ( f2 f1)m f2. Because a

occurs in u, it must be in f1 or f2. If a is in f2 then it is also in v, a contradiction. If a is inf1 and m > 0 then it is also in v, the same contradiction. If a is in f1 and m = 0 then v = f2

and u = ( f1v) j−1 f1. Since lg(u) = ( j − 1) · lg(v) + j · lg( f1) < 2lg(v), then j must be 2.Then u = f1v f1 = (xa)i x and each subword of u which is longer than x must contain theletter a, so also for v which is a contradiction. Thus one of the words ua and uv is primitive.

�Lemma 3.9 [15] For every u ∈ X+ and a, b ∈ X where |X | ≥ 2 and a �= b, at least one ofthe words ua and ub is primitive.

Proposition 3.10 Let u ∈ X+ with lg(u) > 1 and k > lg(u). Then there exists x ∈ X+such that ux is a primitive word and lg(ux) ≥ k.

123

Page 5: Some kinds of primitive and non-primitive words

Primitive and non-primitive words

Proof By Lemma 3.9, we know ua or ub is a primitive word. By the same process we get aword x ∈ X+ such that ux is primitive where lg(ux) ≥ k. �

It is known that if uv is primitive, then vu is also primitive by Lemma 2.2. Thus for anyu ∈ X+ there exists x ∈ X+ such that ux and xu are primitive words with any length greaterthan the length of u.

Lemma 3.11 [20] Let u ∈ X+, q ∈ Q and u /∈ q+. If lg(u) < lg(q), then uqm ∈ Q for anym ≥ 3.

Theorem 3.12 Let u ∈ X+, q ∈ Q and u /∈ q+. If lg(u) ≤ lg(qm−2), then uqm ∈ Q forany m ≥ 3.

Proof Suppose uqm /∈ Q for some m ≥ 3. Then qm−1uq /∈ Q by Lemma 2.2. Henceqm−1uq = gn for some g ∈ Q and n ≥ 2. We consider the following three cases:

(1) If lg(g) < lg(q), then q = gi g1 = g2gi , i ≥ 1 where g1 <p g, g2 <s g and lg(g1) =lg(g2), g1, g2 ∈ X+. Hence gg1 = g2g.

(1-1) If lg(g1) ≤ 12 lg(g), let g = g1zg2 for some z ∈ X∗. Then g1zg2g1 = g2g1zg2. So

g1 = g2. If z = 1, then g = g21 , which contradicts g ∈ Q. If z ∈ X+, then zg1 = g1z.

Therefore, by Lemma 2.3, we have g1 and z are powers of a common word, whichcontradicts g ∈ Q.

(1-2) If lg(g1) > 12 lg(g), let g = g1z1 = z2g2 where z1, z2 ∈ X+ and lg(z1) = lg(z2).

Then g1z1g1 = g2z2g2. So g1 = g2 and z1 = z2. Hence g = g1z1 = z1g1. So g1

and z1 are powers of a common word, which contradicts g ∈ Q.

(2) If lg(q) ≤ lg(g) ≤ lg(qm−1), let g = q j q1 = z3q where 1 ≤ j ≤ m − 1 andq1 ≤p q and z3 ≤s u. If q1 = 1, then g = q j . Thus u ∈ q+ by qm−1uq = gn , whichcontradicts u /∈ q+. If q1 ∈ X+, let q = q1q2 for some q2 ∈ X+. Then qm−1uq1q2 =gn−1q j−1q1q2q1. Thus q1q2 = q2q1. So q1 and q2 are powers of a common word, whichcontradicts q ∈ Q.

(3) If lg(g) > lg(qm−1), then lg(uq) > lg(g) by qm−1uq = gn and n ≥ 2. Hencelg(uq) > lg(qm−1). However, since lg(u) ≤ lg(qm−2), then lg(uq) ≤ lg(qm−1). Thisis a contradiction.

Thus uqm ∈ Q for any m ≥ 3 when lg(u) ≤ lg(qm−2). �Proposition 3.13 Let a, b, c ∈ Q and am = bck where m ≥ k > 1 and (m, k) �= (2, 2). Iflg(b) ≤ lg(c), then a = c.

Proof Suppose a �= c. If lg(a) > lg(c) and m = k �= 2, since lg(b) ≤ lg(c), then lg(b) <

lg(a) < lg(bc). Let a = bc1 = c4c for some c1, c2, c3, c4 ∈ X+ and c = c1c2 = c3c4. Thenak−1 = c2ck−1 = bck−2c3. Since k − 2 ≥ 1, then c3c4 = c4c3, which contradicts c ∈ Q. Iflg(a) > lg(c) and m ≥ k + 1, then lg(am) = m · lg(a) ≥ (k + 1) · lg(a) > (k + 1) · lg(c) ≥k · lg(c) + lg(b), which contradicts lg(am) = k · lg(c) + lg(b). If lg(a) = lg(c), thena = c, which is a contradiction. If lg(a) < lg(c), let a = c2, am−1 = bck−1c1 for somec1, c2 ∈ X+ and c = c1c2. So cm−1

2 = bck−1c1 = bck−2c1c2c1. Suppose that bck−2c1 /∈ c+2 ,

then bck−2c1 = c j2c

′2 for some j ≥ 1, c

′2, c

′′2 ∈ X+ and c2 = c

′2c

′′2. Hence c2c1 = c

′′2cm− j−2

2

where m − j −2 ≥ 1. Then c′′2c

′2 = c

′2c

′′2, which contradicts c

′2c

′′2 = c2 = a =∈ Q. Therefore

bck−2c1 ∈ c+2 . Hence c1 ∈ c+

2 , which contradicts c = c1c2 ∈ Q. Thus a = c. �

123

Page 6: Some kinds of primitive and non-primitive words

C. Chunhua et al.

When (m, k) = (2, 2), the conclusion is not true. For example: let a = a2a1(a1a2)2a1,

b = a2(a1)2a2, c = (a1a2)

2a1, where a1, a2 ∈ X and a1 �= a2. Then a, b, c ∈ Q, anda2 = (a2a1(a1a2)

2a1)2 = a2a1(a1a2)

2a1a2a1(a1a2)2a1 = a2(a1)

2a2((a1a2)2a1)

2 = bc2.But a = a2a1(a1a2)

2a1 �= (a1a2)2a1 = c.

Theorem 3.14 Let p, q ∈ Q, p �= q and f ∈ X+, f �= p. If lg( f ) ≤ lg(p) = lg(q) and1 ≤ s < n ≤ m < 2n + s − 1, then f pmqs pnqs ∈ Q.

Proof Let f pmqs pnqs = f pm−n(pnqs)2. Since lg(p) = lg(q) and n > s ≥ 1, thenpnqs ∈ Q. If f pm−n /∈ Q, there exist h ∈ Q and r ≥ 2 such that f pm−n = hr . Sup-pose that h = pnqs . Since lg(p) = lg(q), then p = q , which is a contradiction. Henceh �= pnqs . So f pmqs pnqs = f pm−n(pnqs)2 = hr (pnqs)2 ∈ Q by Lemma 2.1. Supposethat f pmqs pnqs /∈ Q when f pm−n ∈ Q. Then there exist g ∈ Q and k ≥ 2 such thatf pm−n(pnqs)2 = gk . If k ≥ 3, from 1 ≤ s < n ≤ m < 2n + s − 1 it follows thatlg( f pm−n) ≤ (m − n + 1) · lg(p) ≤ (2n + s − 1 + n + 1) · lg(p) = (n + s) · lg(p) =lg(pnqs). Then by Proposition 3.13 we have g = pnqs . Hence f pm−n ∈ (pnqs)+.So p = q , which is a contradiction. If k = 2, then one of the following cases mustbe hold: g = f pm−n pt p1 = p2 pn−t−1qs pnqs for some t ≥ 1, p1, p2 ∈ X+ andp = p1 p2 or g = f pmq j q1 = q2qs− j−1 pnqs for some j ≥ 0, q1, q2 ∈ X+ andq = q1q2. If f pm−n pt p1 = p2 pn−t−1qs pnqs , f pm−n pt p1 = p2 pn−t−1qs pnqs forsome t ≥ 0, p1, p2 ∈ X+ and p = p1 p2, then q = p2 p1 by lg(p) = lg(q). Hencef p1(p2 p1)

m−n+t = p2 pn−t−1qs pnqs . So f p1(p2 p1)m−n+t−s = p2 pn−t−1qs pn . Suppose

m − n + t − s = 0. Then lg( f p1) ≤ 2lg(p) < lg(qs pn) ≤ lg(p2 pn−t−1qs pn), which is acontradiction. Hence m−n+t−s ≥ 1. Then p2 p1 = p1 p2. So p1 and p2 are powers of a com-mon primitive word, which contradicts p ∈ Q. If f pmq j q1 = q2qs− j−1 pnqs , when j ≥ 0,we have q2q1 = q1q2. So q1 and q2 are powers of a common primitive word, which contra-dicts p ∈ Q. When j = 0, let p = p3 p4 for some p1, p2 ∈ X+ such that lg(p4) = lg(q2).Then q = p4q1 when s = 1 or q = p4q1 = p4 p3 when s ≥ 2. Hence f p3(p4 p3)

m−s =q2qs−1(p3 p4)

n . Then p4 p3 = p3 p4. So p3 and p4 are powers of a common primitive word,which also contradicts p ∈ Q. Thus f pmqs pnqs ∈ Q when f pm−n ∈ Q.

Lemma 3.15 [14] Let y = xx1 ∈ Q for some x, x1 ∈ X+. Then (xx1)k x ∈ Q for any k ≥ 2.

Theorem 3.16 Let p, q ∈ Q and p �= q. If lg(p) ≤ lg(q), then pi q j pkq j ∈ Q for anyi, k ≥ 0, i �= k, j ≥ 3.

Proof If i > k, we consider the following cases:

(1) If k = 0, then pi q j pkq j = pi q2 j . When i ≥ 2, then pi q2 j ∈ Q by Lemma 2.1. Wheni = 1, since lg(p) ≤ lg(q) and 2 j ≥ 4, then pq2 j ∈ Q by Lemmas 3.1 and 3.11.

(2) If k ≥ 1, then i − k ≥ 1. Hence pi q j pkq j = pi−k(pkq j )2. When k = 1, sincelg(p) ≤ lg(q) and j ≥ 3, then pkq j = pq j ∈ Q by Lemmas 3.1 and 3.11. When k ≥ 2,then pkq j ∈ Q by Lemma 2.1. If i − k ≥ 2, then pi q j pkq j = pi−k(pkq j )2 ∈ Q. Ifi −k = 1, since p <p pkq j , then pi q j pkq j = p(pkq j )2 ∈ Q by Lemmas 3.15 and 2.2.

If i < k, then pkq j pi q j ∈ Q by the above case. Hence pi q j pkq j ∈ Q by Lemma 2.2. �

4 Non-primitive words

Lemma 4.1 [12] Let g, v ∈ X∗ and v /∈ (√

g)∗. If gmv = f n and f <p gm for some f ∈ Qand m, n ≥ 2, then there exist g1, g2 ∈ X+ such that g1g2 = g and f = gm−1g1, f n−1 =g2v. In addition, there exist w, z ∈ X+, k ≥ 0 such that wz �= zw and

123

Page 7: Some kinds of primitive and non-primitive words

Primitive and non-primitive words

f = [(wz)k+1w]m−1wz, v = zw[(wz)k+1w]m−2wz{[(wz)k+1w]m−1wz}n−2

where g1 = wz, g2 = (wz)kw.

Theorem 4.2 Let u, v ∈ X+ and u �= v. If uv, u /∈ Q and lg(v) | lg(u), then u ∈ v+.

Proof Let v = q j for some q ∈ Q and j ≥ 1. Since u /∈ Q, then there exist an primitiveword f and an integer m ≥ 2 such that u = f m . If f = q , since lg(v) | lg(u), thenj | m. Hence u ∈ v+. In the following, we consider the case f �= q . Suppose j ≥ 2,then uv = f mq j ∈ Q by Lemma 2.1, which contradicts uv /∈ Q. Thus v is a primitiveword. Since uv /∈ Q, then let uv = gn for some g ∈ Q and n ≥ 2. Hence f mv = gn .Then lg( f ) = lg(u)

m , lg(g) = lg(u)+lg(v)n . By lg(v) | lg(u), we have lg(v) ≤ lg(u). Hence

lg( f ) + lg(g) = lg(u)m + lg(u)+lg(v)

n ≤ ( 1m + 2

n )lg(u). We consider the following cases:

(1) If m, n ≥ 3, then lg( f ) + lg(g) ≤ lg(u). Hence f = g by Lemma 2.4. Since f mv =gn = f n , we have v = f . Thus u = f m = vm ∈ v+.

(2) If m = 2, then f 2v = gn where n ≥ 2. If v = f , then u = vm ∈ v+.If v �= f , since lg(v) ≤ lg(u) = lg( f 2) and n ≥ 2, then g <p f 2. ByLemma 4.1, there exist two words f1, f2 ∈ X+ and f1 f2 = f such that g =f f1, gn−1 = f2v. In addition, there exist w, z ∈ X+, k ≥ 0 such that wz �= zwand g = [(wz)k+1w]2−1wz = (wz)k+1wwz, v = zwwz[(wz)k+1wwz]n−2, f1 =wz, f2 = (wz)kw. Let lg([(wz)k+1w]) = n1, lg(wz) = n2. Thus n2 � n1. Sincelg(u) = 2n1, lg(v) = nn2 + (n − 2)n1 and lg(v) ≤ lg(u), then n ≤ 3. If n = 2,then lg(u) = 2n1 and lg(v) = 2n2. By lg(v) | lg(u), we have n2 | n1, which is acontradiction. If n = 3, then lg(u) = 2n1 and lg(v) = 3n2 + n1 > n1 = 1

2 lg(u).Since lg(v) | lg(u), then lg(v) = lg(u). Hence 3n2 = n1. Thus n2 | n1, which is also acontradiction.

(3) If n = 2, then f mv = g2. If v = f , then u = vm ∈ v+. If v �= f , since lg(v) ≤ lg(u) =lg( f m), then g <p f m . By Lemma 4.1, we have lg(u) = mn1 and lg(v) = 2n2 + (m −2)n1 where n1, n2 are just like before. If m ≥ 4, then m

2 ≤ (m − 2). So lg(u) < 2lg(v).Since lg(v) | lg(u), then lg(u) = lg(v). So n2 | n1, which is a contradiction. If m = 3,then lg(u) = 3n1 and lg(v) = n1 + 2n2. Hence n1 < n1 + 2n2 = lg(v) < 3n1. Bylg(v) | lg(u), we have lg(u) = 2lg(v) or lg(u) = lg(v). Hence n1 = 4n2 or n1 = n2,which is a contradiction.

�Theorem 4.3 Let u, v ∈ X+ and lg(v) ≤ lg(

√u). If uv, u /∈ Q and lg(u) or lg(uv) is odd,

then u ∈ v+.

Proof Since uv, u /∈ Q, then u = f m, uv = gn for some f, g ∈ Q and m, n ≥ 2.

(1) If lg(u) is odd, then m ≥ 3. So lg( f ) + lg(g) = lg( f ) + lg(u)+lg(v)n ≤ lg( f ) +

lg(u)+lg(v)2 ≤ lg( f ) + m·lg( f )+lg( f )

2 = m+32 · lg( f ) ≤ m · lg( f ) = lg(u), because

m+32 ≤ m when m ≥ 3. Therefore f = g by Lemma 2.4.

(2) If lg(uv) is odd, then n ≥ 3. So lg( f ) + lg(g) ≤ lg( f ) + lg(u)+lg(v)3 ≤ lg( f ) +

m·lg( f )+lg( f )3 = m+4

3 lg( f ) ≤ m · lg( f ) = lg(u), because m+43 ≤ m when m ≥ 2.

Therefore f = g by Lemma 2.4.

So v = f n−m . Then lg(v) = (n − m)lg( f ) ≤ lg(√

u) = lg( f ). Hence n − m = 1. Thusu = f m = vm ∈ v+. �

123

Page 8: Some kinds of primitive and non-primitive words

C. Chunhua et al.

5 Conclusion

In [11], it was shown that if p, q are primitive words and unequal, then pnqm is primitivefor n, m ≥ 2; in [14,20] that if p, q are primitive words and unequal but lg(p) = lg(q),then pqn is primitive for n ≥ 2. Here, we proved that if p, q are primitive and lg(q) | lg(p)

then pqn is primitive for n ≥ 2. In [1], we proved that if f g, g are p−primitive words andlg( f ) = lg(g), then f gn is a p−primitive word, so it is a primitive word for any n ≥ 2.It will be an interesting thing to consider whether the condition that f, g are p−primitivewords and lg(g) | lg( f ) implies that f gn is a p−primitive word or not.

On the other hand, it is known from [16] that if uv is a primitive word then {u, v} is acode, but the converse is not right. In the future, we will investigate whether the conditionthat u and uv are primitive words implies that {u, v} is a code or not.

Acknowledgments The authors would like to give great thanks to Professor Richard Botting for his someadvice and carefully checking English, who is in School of Computer and Engineering California StateUniversity San Bernardino. We also give our great thanks to the referees for their careful reading manuscriptand useful suggestion.

References

1. Cao, C.H., Yang, D., Liu, Y.: Disjunctive languages related to p−primitive words, 49, 437–444 (2012).2. Dömösi, P., Horváth, S., Ito, M.: Formal languages and primitive words. Publ. Math. Debr. 42, 315–321

(1993)3. Dömösi, P., Horváth, S., Ito, M., Kászonyi, L., Katsura, M.: Some combinatorial properties of words, and

the Chomsky-hierarchy. In: Ito, M. (ed.) Words, Languages and Combinatorics II. Proceedings of the 2ndInternational Conference, Kyoto, Japan, August 25–28, 1992, pp. 105–123. World Scientific, Singapore(1994)

4. Dömösi, P., Horváth, S., Ito, M., Kászonyi, L., Katsura, M.: Formal languages consisting of primitivewords. LNCS 710, 194–203 (1993)

5. Fan, C.M., Huang, C.C.: A note of prefix primitive words. Acta Inform. 47, 413–423 (2010)6. Hsiao, H.K., Yeh, Y.T., Yu, S.S.: A note of ins-primitive words. Int. J. Comput. Math. 81, 917–929 (2004)7. Ito, M., Schützenberger, M.P.: On an application of semigroup methods to some problems in coding. IRE

Transactions on Information Theory, IT-2, pp. 47–60 (1956)8. Ito, M., Lischke, G.: Generalized periodicity and primitivity for words. Math. Log. Quart. 53, 91–106

(2007)9. Lischke, G.: The primitivity distance of words. In: Ito, M., Kobayashi, Y., Shoji, K. (eds.) Automata,

Formal Languages and Algebraic Systems, pp. 125–137. World Scientific, Singapore (2010)10. Lischke, G.: Primitive words and roots of words. Acta Universitatis Sapientiae, Informatica 3(1), 5–34

(2011)11. Lyndon, G., Schützenberger, M.P.: On the equation aM = bN cP in a free group. Mich. Math. J. 9,

289–298 (1962)12. Li, Z.Z., Tasi, Y.S.: Some properties of the disjunctive languages contained in Q. Acta Inform. 48, 1–18

(2011)13. Lothaire, M.: Combinatorics on Words. Cambridge University Press, Cambridge (1997)14. Moriya, T.: Some results on primitive words, square-free words, and disjunctive languages. IEICE Trans.

Inf. Syst., E91.D, 2514–2516 (2008).15. Paun, G., Son, N.: On the robnstness of primitive words. Discret. Appl. Math. 117, 239–252 (2002)16. Shyr, H.J.: Free Monoids and Languages, 3rd edn. Hon Min Book Company, Taichung (2001)17. Shyr, H.J.: Some properties of disjunctive languages on a free monoid. Inf. Control 37, 334–344 (1978)18. Shyr, H.J., Thierrin, G.: Disjunctive languages and codes. In: Fundamentals of Computation Theory,

Proceedings of the 1977 Inter. FCT-Conference, Poznan, Poland, Lecture Notes in Computer ScienceNo.56 Springer, pp. 171–176 (1977).

19. Shyr, H.J., Tsai, Y.S.: Free submonoids in the monoid of languages. Discret. Math. 181, 213–222 (1998)20. Shyr, H.J., Yu, S.S.: Non-primitive words in the language p+q+. Soochow J. Math. 20, 535–546 (1994)21. Yu, S.S.: Languages and Codes. Tsang Hai Book Publishing Co., Taichung (2005)22. Zhao, C.K.: A characterization of prefix n-power words. J. Discret. Math. Sci. Cryptogr. 9, 165–176

(2006)

123