This article implements some combinatorial properties of the Fibonacci word and generalizations that can be generated from the iteration of a morphism between languages. Some graphic properties of the fractal curve are associated with these words; the curves can be generated from drawing rules similar to those used in L-systems. Simple changes to the programs generate other interesting curves.
1. Introduction
The infinite Fibonacci word,

is certainly one of the most studied words in the field of combinatorics on words [1–4]. It is the archetype of a Sturmian word [5]. The word  can be associated with a fractal curve with combinatorial properties [6–7].
 can be associated with a fractal curve with combinatorial properties [6–7].
This article implements Mathematica programs to generate curves from  and a set of drawing rules. These rules are similar to those used in L-systems.
 and a set of drawing rules. These rules are similar to those used in L-systems.
The outline of this article is as follows. Section 2 recalls some definitions and ideas of combinatorics on words. Section 3 introduces the Fibonacci word, its fractal curve, and a family of words whose limit is the Fibonacci word fractal. Finally, Section 4 generalizes the Fibonacci word and its Fibonacci word fractal.
2. Definitions and Notation
The terminology and notation are mainly those of [5] and [8]. Let  be a finite alphabet, whose elements are called symbols. A word over
 be a finite alphabet, whose elements are called symbols. A word over  is a finite sequence of symbols from
 is a finite sequence of symbols from  . The set of all words over
. The set of all words over  , that is, the free monoid generated by
, that is, the free monoid generated by  , is denoted by
, is denoted by  . The identity element
. The identity element  of
 of  is called the empty word. For any word
 is called the empty word. For any word  ,
,  denotes its length, that is, the number of symbols occurring in
 denotes its length, that is, the number of symbols occurring in  . The length of
. The length of  is taken to be zero. If
 is taken to be zero. If  and
 and  , then
, then  denotes the number of occurrences of
 denotes the number of occurrences of  in
 in  .
.
For two words  and
 and  in
 in  , denote by
, denote by  the concatenation of the two words, that is,
 the concatenation of the two words, that is,  . If
. If  , then
, then  ; moreover, by
; moreover, by  denote the word
 denote the word  (
 ( times). A word
 times). A word  is a subword (or factor) of
 is a subword (or factor) of  if there exist
 if there exist  such that
 such that  . If
. If  , then
, then  and
 and  is called a prefix of
 is called a prefix of  ; if
; if  , then
, then  and
 and  is called a suffix of
 is called a suffix of  .
.
The reversal of a word  is the word
 is the word  and
 and  . A word
. A word  is a palindrome if
 is a palindrome if  .
.
An infinite word over  is a map
 is a map  , written as
, written as  . The set of all infinite words over
. The set of all infinite words over  is denoted by
 is denoted by  .
.
Example 1
The word  , where
, where  if
 if  is a prime number and
 is a prime number and  otherwise, is an example of an infinite word. The word
 otherwise, is an example of an infinite word. The word  is called the characteristic sequence of the prime numbers. Here are the first 50 terms of
 is called the characteristic sequence of the prime numbers. Here are the first 50 terms of  .
.


Definition 1
There is a special class of words with many remarkable properties, the so-called Sturmian words. These words admit several equivalent definitions (see, e.g. [5], [8]).
Definition 2
 . Let
. Let  , the complexity function of
, the complexity function of  , be the map that counts, for all integer
, be the map that counts, for all integer  , the number of subwords of length
, the number of subwords of length  in
 in  . An infinite word
. An infinite word  is a Sturmian word if
 is a Sturmian word if  for all integer
 for all integer  .
.For example,  .
.









Since for any Sturmian word,  , Sturmian words have to be over two symbols. The word
, Sturmian words have to be over two symbols. The word  in example 1 is not a Sturmian word because
 in example 1 is not a Sturmian word because  .
.
Given two real numbers  ,
,  with
 with  irrational and
 irrational and  ,
,  , define the infinite word
, define the infinite word  as
 as  . The numbers
. The numbers  and
 and  are the slope and the intercept, respectively. This word is called mechanical. The mechanical words are equivalent to Sturmian words [5]. As a special case,
 are the slope and the intercept, respectively. This word is called mechanical. The mechanical words are equivalent to Sturmian words [5]. As a special case,  gives the characteristic words.
 gives the characteristic words.
Definition 3
On the other hand, note that every irrational  has a unique continued fraction expansion
 has a unique continued fraction expansion

where each  is a positive integer. Let
 is a positive integer. Let  be an irrational number with
 be an irrational number with  and
 and  for
 for  . To the directive sequence
. To the directive sequence  , associate a sequence
, associate a sequence  of words defined by
 of words defined by  ,
,  ,
,  ,
,  .
.
Such a sequence of words is called a standard sequence. This sequence is related to characteristic words in the following way. Observe that, for any  ,
,  is a prefix of
 is a prefix of  , which gives meaning to
, which gives meaning to  as an infinite word. In fact, one can prove that each
 as an infinite word. In fact, one can prove that each  is a prefix of
 is a prefix of  for all
 for all  and
 and  [5].
 [5].
3. Fibonacci Word and Its Fractal Curve
Definition 4
 defined inductively as follows:
 defined inductively as follows:  ,
,  , and
, and  , for
, for  . The words
. The words  are referred to as the finite Fibonacci words. The limit
 are referred to as the finite Fibonacci words. The limit|  | (1) | 
It is clear that  , where
, where  is the
 is the  Fibonacci number, recalling that the Fibonacci number
 Fibonacci number, recalling that the Fibonacci number  is defined by the recurrence relation
 is defined by the recurrence relation  for all integer
 for all integer  and with initial values
 and with initial values  . The infinite Fibonacci word
. The infinite Fibonacci word  is a Sturmian word [5]; exactly,
 is a Sturmian word [5]; exactly,  , where
, where  is the golden ratio.
 is the golden ratio.
Here are the first 50 terms of  .
.


Definition 5
The Fibonacci word  satisfies
 satisfies  and
 and  for all
 for all  .
.

Here are the first nine finite Fibonacci words.


Definition 6
The following proposition summarizes some basic properties about the Fibonacci word.
Proposition 1
- The words 11 and 000 are not subwords of the Fibonacci word.
- Let  be the last two symbols of be the last two symbols of . For . For , , if if is even and is even and if if is odd. is odd.
- The concatenation of two successive Fibonacci words is almost commutative; that is,  and and have a common prefix of length have a common prefix of length , for all , for all . .
 is a palindrome for all is a palindrome for all . .
- For all  , , , where , where ; that is, ; that is, exchanges the two last symbols of exchanges the two last symbols of . .
The Fibonacci Word Fractal
The Fibonacci word can be associated with a curve using a drawing rule. A particular action follows on the symbol read (this is the same idea as that used in L-systems [9]). In this case, the drawing rule is called “the odd-even drawing rule” [7].
Definition 7
 Fibonacci curve, denoted by
 Fibonacci curve, denoted by  , is the result of applying the odd-even drawing rule to the word
, is the result of applying the odd-even drawing rule to the word  . The Fibonacci word fractal is defined as
. The Fibonacci word fractal is defined as
The program LShow is adapted from [10] to generate L-systems.

Figure 1 shows an L-system interpretation of the odd-even drawing rule.

Figure 1. Interpretation of the odd-even drawing rule.

Here are the curves  for
 for  .
.


The next proposition about properties of the curves  and
 and  comes directly from the properties of the Fibonacci word from Proposition 1. More properties can be found in [7].
 comes directly from the properties of the Fibonacci word from Proposition 1. More properties can be found in [7].
Proposition 2
-   is composed only of segments of length 1 or 2. is composed only of segments of length 1 or 2.
- The number of turns in the  curve is the Fibonacci number curve is the Fibonacci number . .
-  The  curve is similar to the curve curve is similar to the curve . .
- The curve  is symmetric. is symmetric.
- The  curve is composed of five curves: curve is composed of five curves: , where , where is the result of applying the odd-even drawing rule to the word is the result of applying the odd-even drawing rule to the word . .
The next figure shows the curve  and the five curves; here
 and the five curves; here  .
.




Some Variations
The Fibonacci word and other words can be derived from the dense Fibonacci word, which was introduced in [7].
Definition 8
|  | (2) | 



Given a drawing rule, the global angle is the sum of the successive angles generated by the word through the rule. With the natural drawing rule,  ,
,  ,
,  , then
, then  .
.
For a drawing rule, the resulting angle of a word  is the function
 is the function  that gives the global angle. A morphism
 that gives the global angle. A morphism  preserves the resulting angle if for any word
 preserves the resulting angle if for any word  ,
,  ; moreover, a morphism
; moreover, a morphism  inverts the resulting angle if for any word
 inverts the resulting angle if for any word  ,
,  .
.
The dense Fibonacci word is strongly linked to the Fibonacci word fractal because  can generate a whole family of curves whose limit is the Fibonacci word fractal [7]. All that is needed is to apply a morphism to
 can generate a whole family of curves whose limit is the Fibonacci word fractal [7]. All that is needed is to apply a morphism to  that preserves or inverts the resulting angle.
 that preserves or inverts the resulting angle.
Here are some examples.



Here are some examples with other angles.


4. Generalized Fibonacci Words and Fibonacci Word Fractals
This section introduces a generalization of the Fibonacci word and the Fibonacci word fractal [11].
Definition 9

The 2-Fibonacci word is the classical Fibonacci word. Here are the first six  -Fibonacci words.
-Fibonacci words.




The following proposition relates the Fibonacci word  to
 to  .
.
Proposition 3
|  | (3) | 
Definition 10
The  -Fibonacci numbers are the Fibonacci numbers and the
-Fibonacci numbers are the Fibonacci numbers and the  -Fibonacci numbers are the Fibonacci numbers shifted by one. The following table shows the first terms in the sequences
-Fibonacci numbers are the Fibonacci numbers shifted by one. The following table shows the first terms in the sequences  and their reference numbers in the On-Line Encyclopedia of Sequences (OIES) [12].
 and their reference numbers in the On-Line Encyclopedia of Sequences (OIES) [12].


Proposition 4
- The word 11 is not a subword of the  -Fibonacci word, -Fibonacci word, . .
- Let  be the last two symbols of be the last two symbols of . For . For , , if if is even and is even and if if is odd, is odd, . .
- The concatenation of two successive  -Fibonacci words is almost commutative; that is, -Fibonacci words is almost commutative; that is, and and have a common prefix of length have a common prefix of length for all for all and and . .
 is a palindrome for all is a palindrome for all . .
- For all  , , , where , where . .
Theorem 1
For the proof, see [11]. This theorem implies that  -Fibonacci words are Sturmian words.
-Fibonacci words are Sturmian words.
Note that

where  is the golden ratio.
 is the golden ratio.
The  -Fibonacci Word Fractal
-Fibonacci Word Fractal
Definition 11
 Fibonacci curve, denoted by
 Fibonacci curve, denoted by  , is the result of applying the odd-even drawing rule to the word
, is the result of applying the odd-even drawing rule to the word  . The
. The  -Fibonacci word fractal
-Fibonacci word fractal  is defined as
 is defined as
Here are the curves  for
 for  .
.




Proposition 5
- The Fibonacci fractal  is composed only of segments of length 1 or 2. is composed only of segments of length 1 or 2.
- The  curve is similar to the curve curve is similar to the curve . .
- The  curve is composed of five curves: curve is composed of five curves: . .
- The  curve is symmetric. curve is symmetric.
- The scale factor between  and and is is . .
Other Characteristic Words
This section applies the above ideas to generate new curves from characteristic words (see
Definition 3).
Conjecture 1

Here are seven examples.














Acknowledgments
The first author was partially supported by Universidad Sergio Arboleda under grant number USA-II-2012-14. The authors would like to thank Borut Jurčič-Zlobec from Ljubljana University for his help during the development of this article.
References
| [1] | J. Cassaigne, “On Extremal Properties of the Fibonacci Word,” RAIRO—Theoretical Informatics and Applications, 42(4), 2008 pp. 701-715. doi:10.1051/ita:2008003. | 
| [2] | W. Chuan, “Fibonacci Words”, Fibonacci Quarterly, 30(1), 1992 pp. 68-76. www.fq.math.ca/Scanned/30-1/chuan.pdf. | 
| [3] | W. Chuan, “Generating Fibonacci Words,” Fibonacci Quarterly, 33(2), 1995 pp. 104-112. www.fq.math.ca/Scanned/33-2/chuan1.pdf. | 
| [4] | F. Mignosi and G. Pirillo, “Repetitions in the Fibonacci Infinite Word,” RAIRO—Theoretical Informatics and Applications, 26(3), 1992 pp. 199-204. | 
| [5] | M. Lothaire, Applied Combinatorics on Words (Encyclopedia of Mathematics and its Applications), Cambridge: Cambridge University Press, 2005. | 
| [6] | A. Blondin Massé, S. Brlek, A. Garon, and S. Labbé, “Two Infinite Families of Polyominoes That Tile the Plane by Translation in Two Distinct Ways,” Theoretical Computer Science, 412(36), 2011 pp. 4778-4786. doi:10.1016/j.tcs.2010.12.034. | 
| [7] | A. Monnerot-Dumaine, “The Fibonacci Word Fractal,” preprint, 2009. hal.archives-ouvertes.fr/hal-00367972/fr. | 
| [8] | J.-P. Allouche and J. Shallit, Automatic Sequences: Theory, Applications, Generalizations, Cambridge: Cambridge University Press, 2003. | 
| [9] | P. Prusinkiewicz and A. Lindenmayer, The Algorithmic Beauty of Plants, New York: Springer-Verlag, 1990. | 
| [10] | E. Weisstein. “Lindenmayer System” from Wolfram MathWorld—A Wolfram Web Resource. mathworld.wolfram.com/LindenmayerSystem.html. | 
| [11] | J. Ramírez, G. Rubiano, and R. de Castro, “A Generalization of the Fibonacci Word Fractal and the Fibonacci Snowflake,” 2013. arxiv:1212.1368v2. | 
| [12] | OEIS Foundation, Inc. “The On-Line Encyclopedia of Integer Sequences.” (Aug 9, 2013) oeis.org. | 
| J. L. Ramírez and G. N. Rubiano, “Properties and Generalizations of the Fibonacci Word Fractal,” The Mathematica Journal, 2014. dx.doi.org/doi:10.3888/tmj.16-2. | |
About the Authors
José L. Ramírez
Instituto de Matemáticas y sus Aplicaciones
Universidad Sergio Arboleda
Calle 74 no. 14 – 14 Bogotá, Colombia
josel.ramirez@ima.usergioarboleda.edu.co
Gustavo N. Rubiano 
Departamento de Matemáticas
Universidad Nacional de Colombia
AA 14490, Bogotá, Colombia
gnrubianoo@unal.edu.co

 NB
NB and
 and  be alphabets. A morphism is a map
 be alphabets. A morphism is a map  such that, for all
 such that, for all  ,
,  .
. be irrational,
 be irrational,  . For
. For  , define
, define  and
 and  ; then
; then  is called a characteristic word with slope
 is called a characteristic word with slope  .
. is defined by
 is defined by  and
 and  .
. be the map such that
 be the map such that  deletes the last two symbols.
 deletes the last two symbols.
 and the curve
 and the curve  have the following properties:
 have the following properties: comes from the Fibonacci word
 comes from the Fibonacci word  by applying the morphism
 by applying the morphism .
. -Fibonacci words are words over
-Fibonacci words are words over  defined inductively by
 defined inductively by  ,
,  , and
, and  , for
, for  and
 and  . The infinite word
. The infinite word -Fibonacci word.
-Fibonacci word. be the morphism defined by
 be the morphism defined by  and
 and  ,
,  ; then
; then .
. -Fibonacci number
-Fibonacci number  is defined recursively by
 is defined recursively by  ,
,  , and
, and  , for all
, for all  and
 and  .
. -Fibonacci word and the
-Fibonacci word and the  -Fibonacci word satisfy the following:
-Fibonacci word satisfy the following: be an irrational number, with
 be an irrational number, with  a positive integer; then
 a positive integer; then  .
. -Fibonacci word fractal and the curve
-Fibonacci word fractal and the curve  have the following properties:
 have the following properties: , then the curve displays the Fibonacci word fractal pattern.
, then the curve displays the Fibonacci word fractal pattern.