Preprint
Article

This version is not peer-reviewed.

Words and Numbers: A Dynamical Systems Perspective

A peer-reviewed version of this preprint was published in:
Axioms 2026, 15(4), 298. https://doi.org/10.3390/axioms15040298

Submitted:

09 March 2026

Posted:

10 March 2026

You are already at the latest version

Abstract
Along with some known and less known results, we discuss new insights relating combinatorics of words and the ordering of the rationals from a dynamical systems point of view, somehow continuing along the path started in [BI]. We obtain in particular a set of results that structure and enrich the correspondence between the Stern-Brocot (SB) ordering of rational numbers and the corresponding ordering of Farey-Christoffel (FC) words, a class of words that, since their appearance in literature at the end of the 18th century, have revealed numerous relationships with other fields of mathematics. Among the results obtained here is the construction of substitution rules that act on the FC words in a parallel way to the maps on the positive reals that generate the permuted SB tree both vertically and horizontally. A complete correspondence is obtained between the vertical and horizontal motions on the SB tree and the geodesic motions along scattering geodesics and the horocyclic motion along Ford circles in the upper half-plane, respectively.
Keywords: 
;  ;  ;  ;  ;  

1. Preliminaries

The Stern-Brocot (SB) tree T is binary rooted tree which provides a way to order (and thus to count) the elements of Q + , the set of positive rational numbers, so that every number appears (and thus is counted) exactly once (see [5,7,12,22]). To begin with, we say that a pair of nonnegative fractions a b < c d is a Farey pair if the unimodular relation b c a d = 1 holds (so that their distance is 1 / b d ). The basic operation needed to construct T associates to each Farey pair their mediant
a b c d = a + c b + d
One readily sees that the child  a b c d always lies somewhere in between its parents  a b and c d , forming Farey pairs with them. Moreover, among all the fractions lying strictly between a b and c d it is the one (and only one) with the smallest denominator, and is always in lowest terms whenever the parents do (see [25]).
Remark 1.  
Note that the mediant operation arises naturally in the following way: let L be the vertical half-line { x = 1 , y 0 } in R 2 , and denote by U the subspace of R 2 given by of all vectors u = ( q , p ) with positive integer coordinates. Let T : U Q + be the map given by T ( q , p ) = p / q , that is the ordinate of the intersection of u with L. Each reduced fraction on L is thus the image with T of a vector of U with coprime coordinates. Finally, given u 1 , u 2 U , we have
T ( u 1 + u 2 ) = T ( u 1 ) T ( u 2 )
Now, taking as initial pair 0 1 and 1 0 , we take their mediant 1 1 as the root of the tree. Then one writes one generation after the other using the above operation (a portion of this structure is depicted in Figure 1). As already observed, Q + and T are in bijection. To a given x Q + , we associate its depth, as the level of T it belongs to.
Lemma 1. ([5], Lemma 1.2)Let x Q + then
x = [ a 0 ; a 1 , , a n ] depth ( x ) = i = 0 n a i
Remark 2.  
Note that the sub-tree S of T having 1 2 as root node and vertex set Q + [ 0 , 1 ] (sometimes called Farey tree) can be obtained exactly in the same way as T taking as initial pair 0 1 and 1 1 instead of 0 1 and 1 0 . One easily sees ([5], Lemma 1.1) that ϕ ( T ) = S where ϕ : [ 0 , ) [ 0 , 1 ] is the invertible map defined by ϕ ( ) = 1 and ϕ ( x ) = x x + 1 .
One can also construct an equivalent tree whose vertex set is formed by binary strings, each fraction p / q T corresponding to a binary word w p q obtained by concatenation of its left and right parent as follows1.
Definition 1.(Farey-Christoffel (FC) words)Set
w 0 1 = 0 and w 1 0 = 1
If moreover p q and p q is a Farey pair and p q = p q p q , we define
w p q = w p q w p q
Some notations: for s { 0 , 1 } set s ^ = 1 s . Then, for w { 0 , 1 } * given by w = s 1 s n we set
w ^ = s ^ 1 s ^ n and w ˜ = s n s 1
Also denote by | w | the length of w and by | w | s the number of occurrence of the symbol s { 0 , 1 } in w.
The above construction establishes a one to one correspondence between Q + T and the set F of FC words.
Theorem 1.  
We have the following properties:
1.
given w F , we have w = w p q with p q = | w | 1 | w | 0 (so that | w | = p + q ) ;
2.
given p q T with p + q > 1 we have w p q = 0 c 1 for some c { 0 , 1 } * satisfying c = c ˜ ;
3.
given w p q = 0 c 1 , we have w q p = 0 c ^ 1 ;
4.
given w F with | w | > 1 , it can be uniquely factorized as w = u v , where u and v are non-empty palindrome words. Moreover if w = w p q = w p q w p q , then | u | = p + q and | v | = p + q .
Proof. 
The first assertion follows from the definition, whereas the third easily follows from the second. Let us then prove 2. We proceed by induction in the depth. For the root node 1 1 we get c = ϵ , the empty word, so that the assertion is trivial. Suppose it is true up to depth n > 1 , and consider γ T with depth ( γ ) = n . We have w γ = 0 c 1 with c = c ˜ . On the other hand γ is obtained as the child of a left and right parent, say α and β , one of depth n 1 and the other of depth n k , for some k = 2 , , n (the case in which one parent is an ancestor is left to the reader). Set w α = 0 a 1 and w β = 0 b 1 , with a = a ˜ and b = b ˜ . Therefore c = a 1 0 b = b ˜ 0 1 a ˜ . Now consider a child δ of γ . If δ is the right child then by construction w δ = 0 c 1 0 b 1 = 0 a 1 0 b 1 0 b 1 = 0 d 1 with d = a 1 0 b 1 0 b = b ˜ 0 1 a ˜ 1 0 b , which is clearly palindromic. If δ is the left child, the same argument yields w δ = 0 d 1 with d = a 1 0 b ˜ 0 1 a ˜ .
To show the last statement, we note that from the above it follows that for w = 0 c 1 F , the palindrome c has always the structure c = a 1 0 b = b ˜ 0 1 a ˜ , with a = a ˜ and b = b ˜ . Therefore we can write w = u v with u = 0 b ˜ 0 and v = 1 a ˜ 1 , which are both palindrome words. As for the uniqueness, let w = u v = t s with u , v , t , s all palindromes. Assume without loss that | u | > | t | , so u = t h and h v = s , with h ϵ . Since they are all palindromes, we have v u = s t , so that v t h = h v t . Then it readily follows that w = h k for some positive k N . But this is absurd, since it should be | w | 0 = k | h | 0 and | w | 1 = k | h | 1 , but we already know that | w | 0 = p and | w | 1 = q with p and q coprime, and the case k = 1 would imply w = u = s = h , absurd since | w | > 1 and it couldn’t be palindromic. This holds true for each w F , except for the leftmost and rightmost nodes at each level, for which the uniqueness of the factorization is trivial since w = 0 . . . 01 or w = 01 . . . 1 . □
Remark 3.  
The last statement of the above theorem yields two factorizations for w F with | w | > 1 : thepalindromic factorization w = u v , with u and v both palindromes, and the so calledstandard factorization w = w p q = w p q w p q , in terms of FC sub-words. Both of them are unique.
Remark 4.  
It follows from the definition that given a word with standard factorization w = u v , with w p q = u and w p q = v , then u ( u v ) and ( u v ) v are Christoffel words; in particular they are the children of w with the indicated standard factorization. Moreover, if | w | 3 , then either u is a proper prefix of v, and v = u v is the standard factorization of v, or v is a proper suffix of u, in which case u = u v .
Some rather immediate consequences of the above properties are formulated in the following corollaries (see also [2]).
Corollary 1.  
Let w = 0 c 1 be a FC word associated to some element of T . The FC words associated to its left and right children are given by
0 ( 0 c ) 1 = 0 ( c 0 ) + 1 and 0 ( 1 c ) 1 = 0 ( c 1 ) + 1
where u and u + are the shortest palindrome with suffix, respectively prefix, given by u.
Corollary 2.  
Let w = 0 c 1 be a FC word associated to some element of T . The maximum among all its cyclic permutations is realized by the word w ˜ = 1 c 0 .
Corollary 3.  
The number of FC words of length n is given by Euler totient function φ ( n ) = | { 0 < i < n : gcd ( i , n ) = 1 } | .
Proof. 
From Theorem 1 we have that w 1 = p , w 0 = q . The totient function gives us the number of distinct p which are relatively prime with n, which coincides with the number of possible pairs ( p , q = n p ) which are relatively prime. □
Figure 2. The first four level of the Christoffel words tree.
Figure 2. The first four level of the Christoffel words tree.
Preprints 202122 g002

2. Relation with Cutting and Sturmian Sequences

Now, given w F we call | w | 1 / | w | 0 the slope of w. This is motivated by the following facts. To a given binary word w = u 1 u n we can associate a stepwise walk on the lattice Z 2 constructed by moving by a vertical step upwards (resp. horizontal step oriented on the right) for each occurrence of the symbol 1 (resp. 0). Clearly, the walks corresponding to w = 0 c 1 and w ˜ = 1 c 0 meet at the origin ( 0 , 0 ) and at the point ( | w | 0 , | w | 1 ) . Moreover, letting α = | w | 1 / | w | 0 , the central sequence c is nothing but the cutting sequence of the ray having slope α , where one writes 0 each time the ray cuts a vertical line, and 1 each time it cuts a horizontal line, on the open interval ( 0 , | w | 0 ) .
By the way, the FC word of slope p / q can be defined from the very beginning as a sequence of unitary steps joining points of integer lattice from ( 0 , 0 ) to ( q , p ) so that (i) the corresponding path is the nearest path below the line segment joining these two points; (ii) there are no points of the integer lattice between the path and line segment (see [2]). When the slope is irrational, a similar definition leads to the notion of (infinite) Sturmian sequence.
In >Figure 3 we report the case with slope 3 / 5 (with r ( w ) w ˜ ).
>Figure 4 shows the cutting sequences of the two parents of 3 / 5 , namely 1 / 2 and 2 / 3 (when concatenating two finite cutting sequences, one has to interpose the word 10, which corresponds to a cut with a corner).
Remark 5.  
The standard factorization w = w p q = w p q w p q in terms of FC sub-words (cf. Remark 3), can be obtained geometrically by cutting the walk corresponding to w at the lattice point ( q , p ) closest to the segment joining ( 0 , 0 ) with ( q , p ) . The last property implies that p q q p = 1 and therefore p ( p + q ) = p ( p + q ) + 1 = 1 ( mod p + q ) . In the same way, we can show that q ( p + q ) = 1 ( mod p + q ) . We therefore see that the lengths of the factors | w p q | = p + q and | w p q | = p + q are the respective multiplicative inverses in { 0 , 1 , , p + q 1 } of p and q.
Now, putting together Remark 6 and, e.g., [6], Section 1 (or else [19], Chap. 6), one sees that the FC word w w α can also be characterized as the symbolic representation of the orbit { R β k ( 0 ) } k = 0 n 1 w.r.t. the partition S 1 = [ 0 , 1 β ) [ 1 β , 1 ) , with n = | w | and R β : S 1 S 1 the rotation of angle β = ϕ ( α ) , sometimes also called the Sturm sequence of β . More specifically, set
ϵ ( x ) = 0 , 0 x < 1 β 1 , 1 β x < 1
and note that x + β = R β ( x ) + ϵ ( x ) , which can be iterated to give
x + n β = R β n ( x ) + ϵ ( R β n 1 ( x ) ) + ϵ ( R β n 2 ( x ) ) + + ϵ ( x ) = R β n ( x ) + [ n β ]
Setting w = u 1 u n , we then have
u k = ϵ ( R β k ( x ) ) = [ k β ] [ ( k 1 ) β ] , k = 1 , , n .
Note that, since β ( 0 , 1 ) we have u k { 0 , 1 } . More precisely, if α > 1 ( β > 1 2 ) in w the symbol 0 is always isolated and between any two 0’s there are either [ α ] or [ α ] + 1 1’s. If instead α < 1 ( β < 1 2 ) in w the symbol 1 is isolated and between any two 1’s there are either [ 1 / α ] or [ 1 / α ] + 1 0’s. The opposite plainly happens to w ^ .
The above generation rule can be further rephrased as follows (closely mirroring the original construction by Christoffel). Let p / q T and set n = p + q . Define the group translation T p : Z n Z n as
T p : x x + p ( mod n )
Lemma 2.  
Let w = u 1 u n F , with n > 1 , and p q = | w | 1 | w | 0 (so that | w | = n = p + q ) be the corresponding element of T . Consider the partition Z n = Q 0 Q 1 with Q 0 = { 0 , 1 , , q 1 } and Q 1 = { q , q + 1 , , n 1 } .
u k = T p ( k 1 ) ( 0 ) Q , { 0 , 1 } , k = 1 , , n
Proof. 
From the geometric interpretation of the FC words given above, one deduces the following rule: for any k = 1 , , n we have u k = 0 if k · p ( mod n ) > ( k 1 ) · p ( mod n ) and u k = 1 in the opposite case.
Now note that, setting ( k 1 ) · p ( mod n ) = , if k · p ( mod n ) = + p then u k = 0 , whereas if k · p ( mod n ) = q then u k = 1 . In other words, u k = 0 if and only if ( k 1 ) · p ( mod n ) Q 0 and u k = 1 if and only if ( k 1 ) · p ( mod n ) Q 1 . □
Remark 6.  
If one works with the sub-tree S instead of T (see Remark 2), assigning the initial symbols 0 and 1 to 0 / 1 and 1 / 1 (instead of 1 / 0 ), then the above conclusions are unchanged provided p / q is replaced by ϕ ( p / q ) = p / ( p + q ) (and q / p by q / ( p + q ) ), so that the denominator of the corresponding fraction always equals the length of the FC word. Moreover, the algorithm of Lemma 2, remains unchanged provided we let T p act on Z q instead of Z p + q and we set Q 0 = { 0 , 1 , , q p 1 } and Q 1 = { q p , q p + 1 , , q 1 } .
Finally, we note that the map ϕ induces the substitution map on FC words given by 0 0 and 1 01 . A short reflection shows that this rule can be used to obtain the FC word w α = u 1 u n constructed above from the Sturm sequence of α itself, that is the word w α = v 1 v q , with q = | w | 0 and v k = [ k α ] [ ( k 1 ) α ] .

3. Relation with Continued Fractions

We have already seen (cf. Lemma 1) how the depth of each element x T is related to the partial quotients of its continued fraction expansion (c.f.e.) x = [ a 0 ; a 1 , , a n ] . This connection can be further expanded. One starts by constructing a matrix representation of the positive rationals as follows: given z C and X = n m t s S L ( 2 , Z ) set X ( z ) ( n z + m ) / ( t z + s ) and identify
X X ( 1 ) = n + m t + s Q +
Clearly m / s and n / t are but the parents of x. We have
1 2 1 0 1 1 = : A e 2 1 1 1 0 1 = : B
and moreover
n m t s 1 0 1 1 = m + n m s + t s m s m + n s + t
and
n m t s 1 1 0 1 = n m + n t s + t m + n s + t n t
Hence the matrices A and B, when acting from the right, move downwards on T , respectively to the left and to the right.
Putting together the above, along with Lemma 1, we get:
Proposition 1.  
Each p q = [ a 0 ; a 1 , , a n ] T , with depth ( p q ) > 1 , corresponds to a unique element X S L ( 2 , Z ) , for which there are only two possibilities:
  • n even X = B a 0 A a 1 A a n 1 B a n 1
  • n odd X = B a 0 A a 1 B a 2 A a n 1
Moreover, let p q = p q p q and w p q = w p q w p q be the corresponding FC word, then
X = | w p q | 1 | w p q | 1 | w p q | 0 | w p q | 0
For a given element x T , the matrix product X can be used to code the descending path which reaches x starting from 1 1 as a binary string σ ( x ) { 0 , 1 } * , where each symbol 0 corresponds to an occurrence of A (down left move) and each symbol 1 to an occurrence of B (down right move).
We may now ask what kind of relation can be established between σ ( x ) and its FC word w ( x ) F (a reverse relation yielding the c.f.e. of x from the corresponding FC word w is discussed in Section 4 below).
The sought relation can be readily obtained from Corollary 1. Indeed, given a palindromic word u { 0 , 1 } * and a symbol a { 0 , 1 } , we set
Φ a ( u ) = ( u a ) + = ( a u )
For example we have Φ 0 ( 0110 ) = 01100110 and Φ 1 ( 0110 ) = 011010110 . Note moreover that Φ a ( ϵ ) = a . A direct consequence of Corollary 1 is now the following rule.
Proposition 2.  
Let σ ( x ) = σ 1 σ k { 0 , 1 } * be the path of x T , and w ( x ) = 0 c 1 its FC word. Then we have
c = Φ σ k Φ σ k 1 Φ σ 1 ( ϵ )
Example. Taking x = 3 / 5 = [ 0 ; 1 , 1 , 2 ] , from Proposition 1 we have σ ( x ) = 010 . Thus, applying rule (5) we get
c = Φ 0 Φ 1 Φ 0 ( ϵ ) = Φ 0 Φ 1 ( 0 ) = Φ 0 ( 010 ) = 010010 .
Finally w ( x ) = 0 c 1 = 00100101 (to be compared with the portions of the trees T and F reproduced above).
Remark 7.  
The maps (4) have been introduced by Aldo de Luca in [13], who called thempalindromic closures. More generally, in combinatorial word theory literature the transformation mapping the word σ ( x ) to the central palindrome c of w ( x ) is usually encoded by a function P a l : { 0 , 1 } * { 0 , 1 } * defined recursively as follows [4]: set P a l ( ϵ ) = ϵ . If u = v z { 0 , 1 } * for some z { 0 , 1 } then P a l ( u ) = ( P a l ( v ) z ) + . Although the two approaches are of course equivalent, the one outlined above seems more transparently connected to the present construction.

3.1. Reversals and Duality

If we let A and B act on the left we get
1 0 1 1 n m t s = n m n + t m + s n + m n + m + t + s
and
1 1 0 1 n m t s = n + t m + s t s n + m + t + s s + t
That is, they move a fraction p q respectively to its left and right descendants p p + q and p + q q on T . Now, if we associate to a given fraction x T a matrix product X = i = 1 d M i where d = depth ( x ) , as above, then we can consider the involution x x ^ , where x ^ is the rational number represented by the reversed matrix product X ^ = i = d 1 M i . This map acts as a permutation on Q + and the corresponding permuted tree T ^ can be constructed starting from the root node 1 1 and writing under each vertex p q the set of its descendants { p p + q , p + q q } .
Note moreover that, according to Proposition 1, the following rule is in force: let x = [ a 0 ; a 1 , , a n ] , then
  • n even X ^ = B a n 1 A a n 1 A a 1 B a 0
  • n odd X ^ = A a n 1 B a n 1 A a 1 B a 0
and therefore,
  • n even x ^ = [ a n 1 ; a n 1 , , a 1 , a 0 + 1 ]
  • n odd x ^ = [ 0 ; a n 1 , a n 1 , , a 1 , a 0 + 1 ]
Definition 2.  
Let σ ( x ) = σ 1 σ k { 0 , 1 } * be the path of x T , and w ( x ) = 0 c 1 its FC word. The FC word w ^ = 0 c ^ 1 associated to x ^ , for which
c ^ = Φ σ 1 Φ σ 1 Φ σ k ( ϵ )
is called thedual wordto w. In the same vein, x and x ^ will be referred to asdual elementsin T .
It turns out (see [4]) that whenever w and w * are dual words associated to the irreducible fractions x = p q and x ^ = p ^ q ^ , we have p + q = p ^ + q ^ and p ^ and q ^ are the respective multiplicative inverses in { 0 , 1 , , p + q 1 } of p and q, that is p p ^ , q q ^ 1 ( mod n ) with n = p + q (these inverses exist because p and q are relatively prime and therefore are also relatively prime to n = p + q . Therefore p ^ and q ^ are relatively prime). A straightforward consequence of this property and the content of Remark 5 is the following:
Lemma 3.    
Let x = p q and x ^ = p ^ q ^ be dual elements in T . Then
p q = p q p q if and only if p ^ q ^ = p p q q

3.2. Motions on T ^ and F ^ .

We start recalling some results discussed in [5] about dynamics on T ^ . We start observing that the descendants of a fraction p q are just its pre-images w.r.t. the map F : R + R + given by
F : x x 1 x , 0 x 1 x 1 , x > 1
The map F can thus be used to generate “vertically” the permuted tree T ^ . Moreover, according to ([5], Proposition 2.3), T ^ can also be generated “horizontally” by means of the map R : R + R + given by R ( 0 ) = 1 , R ( ) = 0 and
R ( x ) = 1 1 x + 2 [ x ] , x R +
More precisely, denoting with r n the n-th rational number obtained by `reading’ T row by row, from left to right, starting from the root, and letting r n * be the element of the permuted tree T ^ corresponding to r n T , it holds r n ^ = R n 1 ( 1 ) (or else r n = R n ^ 1 ( 1 ) ).
Turning now to consider the permuted FC tree F ^ , an easy consequence of the construction outlined above (see also [2], Lemma 2.2) is the following:
Lemma 4.    
Let w be the FC word associated to some element p q T . The FC words associated to its descendants p p + q and p + q q are obtained by applying to w the substitution rules:
S 0 : ( 0 , 1 ) ( 0 , 01 ) S 1 : ( 0 , 1 ) ( 01 , 1 )
Now note that any FC word w of length n can be written in the form
w = 0 n 1 1 0 n 2 0 n p 1 , n i 1 , i = 1 p n i = q
whenever its slope | w | 1 / | w 0 | = p / q ( 0 , 1 ) , or else
w = 0 1 n 1 0 1 n 2 0 1 n q , n i 1 , i = 1 q n i = p
whenever p / q > 1 . As noted before (cf.remark after eq. (1), see also [21]) the integers n i may get only two values. They are [ q / p ] or [ q / p ] + 1 , if the slope p / q is smaller than one; [ p / q ] or [ p / q ] + 1 , otherwise. Following [21], we call the exponent [ q / p ] 1 (or [ p / q ] ) the value of w.
This naturally induces a decomposition of F (or F ^ ) as F = F < 1 F 1 (with obvious meaning of the notations), so that S 0 : F F < 1 and S 1 : F F 1 , in particular F < 1 consists of all the left nodes of F ^ , while F 1 consists of all the right node, plus the root.
We are now ready to introduce a map T on words which generates the “horizontal” motion on F ^ , namely the displacement row by row, from left to right, starting from the root, in a similar way to how R does it for T ^ .
Theorem 2.    
The map T that moves from a given word w F ^ to the next one, can be written as T = T 0 T 1 , where the maps T 0 : F < 1 F 1 and T 1 : F 1 F < 1 act as follows:
T 0 : ( 0 k + 1 1 , 0 k 1 ) ( ( 01 ) k 1 , ( 01 ) k 1 1 ) T 1 : ( 01 k + 1 , 01 k ) ( 0 k 1 , 0 k + 1 1 )
where k is the value of w.
Proof. 
Let w = 0 n 1 1 0 n 2 0 n p with:
n i = k o r k + 1 f o r i = 1 , , p , a n d i = 1 p n i = q .
Let w be the parent node of w and T ( w ) , we have that w is given by S 0 1 ( w ) and, recalling that 0 0 = ϵ , we have:
w = 0 n 1 1 10 n 2 1 1 0 n p 1 1 .
Then, thanks to S 1 , we have
T ( w ) = S 1 ( w ) = ( 01 ) n 1 1 1 ( 01 ) n 2 1 1 ( 01 ) n p 1 1 ,
and we have shown T 0 = T [ F < 1 ] .
Now we will show that T 1 = T [ F 1 ] by induction on the depth m of the word w. For m = 1 , that T ( 01 ) = T 1 ( 01 ) = 001 is trivial. Let’s then assume it holds true for each w at depth m, and we will prove it for m + 1 . Let w = 01 n 1 01 n 2 01 n q with:
n i = k o r k + 1 f o r i = 1 , , q , a n d i = 1 q n i = p .
Let w be the parent node of w, and w = T ( w ) the parent node of T ( w ) . Then T ( w ) = S 0 ( w ) . Clearly, w is given by
w = S 1 1 ( w ) = 01 n 1 1 01 n 2 1 01 n q 1 .
Now, let us consider the q subwords 01 n i 1 individually, and we call n ¯ i the complement of n i in the set { k , k + 1 } . Then, if k > 1 , we have, by the induction hypothesis, that w = T 1 ( w ) and so, by the action of T 1 , the subword 01 n i 1 becomes 0 n ¯ i 1 1 , and applying S 0 , we get:
T ( w ) = S 0 ( w ) = 0 n ¯ 1 10 n ¯ 2 1 0 n ¯ q 1
which we wanted to show.
On the other hand, if k = 1 , then the subword 01 n i 1 is either 0 or 01, so that w F < 1 and T ( w ) = T 0 ( w ) . Thus, applying T 0 , it is clear2 that i = 1 , , q for which n i 1 = 0 , we get 01, while i = 1 , , q for which n i 1 = 1 , we get 1. And, applying S 0 , we get that 01 becomes 001, while 1 become 01. So, putting it all together, we have
01 n i S 1 01 n i 1 T 0 n ¯ i 1 1 S 0 0 n ¯ i 1
which is what we needed to prove. □
The map T, defined for FC words, can be used to generate “horizontally" the tree F ^ as the map R can be used to generate “horizontally" the tree T ^ . Since R is defined on R + we would like to find an extension of T such that the correspondence with R is not limited to Q + .
Conjecture 3.    
The map T, defined in Theorem 2, can be extended to the set of Sturmian sequences3 (cf. Section 2) and it corresponds to the map R, in the sense that if w is the Sturmian sequence of slope x R + , then u, obtained as 0 u = T ( 0 w ) is the Sturmian sequence of slope R ( x ) .
By analyzing the frequencies of the letters 0 and 1 of 0 u = T ( 0 w ) , one finds that the ratio of 1’s and 0’s corresponds to R ( x ) . The problem is to show that T ( w ) is indeed a Sturmian sequence or, equivalently, that the set of Sturmian sequences is closed wrt T.
Remark 8.(Connection with S-adic systems)
On the permuted tree T ^ one can introduce a symmetric random walk ( Z k ) k 1 in the following way: set Z 1 = 1 1 and if Z k = p q then either Z k + 1 = p p + q or Z k + 1 = p + q q , both with probability 1 2 . In [5] it is proved that this process enters any non empty interval I = ( a , b ) R + almost surely (Thm. 1.12) and, more specifically, it does it with asymptotic frequency ρ ( I ) = a b d ρ ( x ) (Corollary 3.7), where ρ : R ¯ + [ 0 , 1 ] encodes the infinite path of x R ¯ + by interpreting it as the binary expansion of a real number in [ 0 , 1 ] . Differently said, ρ ( 0 ) = 0 , ρ ( ) = 1 and, if x = [ a 0 ; a 1 , a 2 , ] , then
ρ ( x ) = 0 . 11 1 a 0 00 0 a 1 11 1 a 2
A similar study can be pursued on the permuted tree F ^ , starting from the observation that the substitutions S 0 and S 1 defined in Lemma 4, whose incidence matrices coincide with A and B, define a so called S-adic system (see [20], pp. 87-109, and [3]), which, however, are rarely considered as generating a random process. For an interesting analysis of the spectral properties of S-adic random system arising from an i.i.d. sequence of unimodular substitutions, see [23]. Besides, it would be also interesting to study the dynamics induced by the map T defined in Thm. 2 from a statistical point of view (see the next Section for some results for the map R).
Remark 9.(FC words and musical scales)
FC words that are dual to one another deserve an important role in the theory of well-formed scales in music theory [8] (see also [14]). Loosely speaking, we first say that a scale isgeneratedif its elements can be obtained by an iterated application of a generator4, i.e. a fixed transposition on a given pitch class, and then we say that a generated scale iswell-formed, if each generating interval spans the same number of scale steps (including the return to origin interval). A remarkable property brought into light by the recent developments in music and combinatorics on words [11] starts from the observation that, for example, the FC word w = 0001001 , corresponding to the fraction 2/5, is the sequence of intervals corresponding to the ancient mixolydian (descending) mode B’-A-G-F-E-D-C-(B) (or else to the ascending lydian mode as a medieval ecclesiastical mode), where 0 stands for a tone and 1 for a semi-tone. If we now take the slope 4/3, where 4 and 3 are the multiplicative inverses of respectively 2 and 5 modulo 7, the dual Christoffel word w ^ = 0101011 corresponds to the same mode B’-E-A-D-G-C-F-(Bb) but in a different presentation, where now 0 stands for a descending perfect fifth (the generator) and 1 for an ascending perfect fourth (the generator’s complement within the octave), so that the pitches reached thereby all lie within the octave under the initial B’. The two presentations are respectively called thescale-step patternand thescale foldingof the mode. The other seven diatonic modes forming of the diatonic 7-notes family can be obtained from this mode by conjugation, where we say that two elements w and w of { 0 , 1 } * areconjugateif there exist words u and v such that w = u v and w = v u (or equivalently if they are conjugated in the free group < 0 , 1 > ). In the same vein can be treated other musical scales, such as the pentatonic scales (starting from the scale-step pattern 01011, whose dual is 00101), or the so called `tetractys’ (starting with 011, which is self-dual). This quick sketch can hopefully give a sense of the richness lying in the folds of the interaction between these domains. One interpretation of this richness may come from thinking of the FC words as divisions into “almost equal” parts (cf. section 17.3 in [24]), in the following sense: if d < n are relatively prime, then n = d q + r with positive remainder r. Therefore n is not divisible into d equalintegerparts. On the other hand, the second-best solution is to divide n into d r equal parts of size q, and the remaining r parts of size q + 1 . By writing these parts as a word of length d, as evenly as possible, one obtains a FC word (cf. the geometric interpretation presented at the beginning of Section 2 and in Figure ).

4. Ordering and Dynamical Systems

We shall now discuss some further aspects of the relation between the c.f.e. of a given element of x T and its FC word w F . To this end we recall that any FC word w of length n can be written in the form shown in (8) or (9) depending on its slope (cf. Section 3.2).
Then, we can construct a derived word  w via the following algorithm: suppose that the slope p / q of w is smaller than one and its value is k (that is [ q / p ] = k ). Then the symbol 1 is isolated and we perform the substitution 0 0 and 0 k 1 1 . If, instead, the slope p / q is larger than one, and [ p / q ] = k , then the symbol 0 is isolated and we perform the substitution 1 1 and 01 k 0 . We keep iterating this procedure until we end up with a single symbol, 0 or 1, while recording the values a 0 , a 1 , , a n of the derived sequences5. We have the following:
Proposition 3.  
Let x T and w F be the corresponding FC word. The values of the successively derived words w , w , coincide with the partial quotients of the c.f.e. of x.
Proof. 
The proof amounts to noting that the reduction procedure corresponds to repeated applications to the slope of the map F : R + R + given by
F : x x 1 x , 0 x 1 x 1 , x > 1
whose action of c.f.e.’s is6
F : [ a 0 ; a 1 , a 2 , ] [ 0 ; a 1 1 , a 2 , ] , a 0 = 0 [ a 0 1 ; a 1 , a 2 , ] , a 0 > 0
More precisely, if w has slope x and value k then the derived sequence w has slope F k ( x ) , and value either [ F k ( x ) ] or [ 1 / F k ( x ) ] . □
Example. For p / q = 3 / 5 = [ 0 ; 1 , 1 , 2 ] and w = 00100101 we get the following table.
derivation step FC word slope value
0 00100101 3 / 5 1
1 01011 3 / 2 1
2 001 1 / 2 2
3 1 1 / 0
Now, any p q T of depth d 1 is the descendant of another fraction p q T of depth d 1 , which we call its antecedent, given by the following rule: if p > q then q = q and p = p q ; if instead q > p then p = p and q = q p . Differently said, p q = F ( p q ) . Therefore, according to what we have said in Section 3.1, the binary coding σ ( x ) = σ 1 σ k of an element x T of depth k + 1 can be computed in terms of the symbolic orbit of x with the map F:
σ i ( x ) = 0 , F i 1 ( x ) 1 , 1 , F i 1 ( x ) > 1 , i = 1 , , k
This rule can be immediately checked for the already discussed example x = 3 / 5 . For a less trivial example consider the fraction x = 65 / 19 , whose c.f.e. is [ 3 ; 2 , 2 , 1 , 2 ] . It has depth 3 + 2 + 2 + 1 + 2 = 10 and from Proposition 1 its symbolic coding is σ ( x ) = 111001101 . Without knowing the c.f.e. this binary sequence can be obtained from the antecedents, i.e. the F-images of x till the root of T . They are
65 19 , 46 19 , 27 19 , 8 19 , 8 11 , 8 3 , 5 3 , 2 3 , 2 1 , 1 1
and one easily checks that the sequence obtained applying rule (13) is just σ ( x ) written above.
We have said that the tree T enumerates the positive rationals, but what is the ordering induced on Q + ? Denoting again with r n the n-th rational number obtained by `reading’ T row by row, from left to right, starting from the root, we have
r 1 = 1 1 , r 2 = 1 2 , r 3 = 2 1 , r 4 = 1 3 , r 5 = 2 3 , r 6 = 3 2 , r 7 = 3 1 , r 8 = 1 4 ,
The general rule is in the following:
Theorem 4.  
Given 1 x T , let σ ( x ) = σ 1 σ k be its binary coding. Then we have x = r n with n = 2 k + l = 1 k σ l 2 k l .
Example. The number x = 65 / 19 yields n = 2 9 + 2 8 + 2 7 + 2 6 + 2 3 + 2 2 + 2 0 = 973 , namely 65 / 19 is the nine hundred seventy-third rational number in the Stern-Brocot ordering.
Proof. 
Let r n ^ be the element of the permuted tree T ^ corresponding to r n T (or else r n and r n ^ are dual elements in T ). Then n = 2 k + l = 1 k σ l 2 k l if and only if n ^ = 2 k + l = 1 k σ l 2 l 1 . According to the above, it holds r n ^ = R n 1 ( 1 ) (or else r n = R n ^ 1 ( 1 ) ), where R is the map defined in (7). Furthermore, an easy adaptation of ([5], Theorem 2.3) shows that R is topologically conjugated with the dyadic odometer (or von Neumann-Kakutani transformation [26]) K : [ 0 , 1 ] [ 0 , 1 ] , given by K ( 1 ) 0 and
K ( x ) x + 1 2 n 1 + 1 2 n 1 , 1 1 2 n 1 x < 1 1 2 n , n 1 ,
via the map ρ defined in (10), i.e.
R = ρ 1 K ρ .
Finally, it is well known (see, e.g., [17]) that the map K can be used to generate the Van der Corput sequence ω = ( t n ) , defined as follows: set first t 1 = 1 / 2 . Then, given n 2 , let n = 2 k + l = 1 k s l 2 l 1 be its dyadic expansion and set t n = 2 k 1 + l = 1 k s l 2 l . The first terms of ω are
t 1 = 1 2 , t 2 = 1 4 , t 3 = 3 4 , t 4 = 1 8 , t 5 = 5 8 , t 6 = 3 8 , t 7 = 7 8 , t 8 = 1 16 ,
Accordingly, we have t n = K n 1 ( 1 / 2 ) , n 1 , and one readily gets the claim. □
Remark 10.  
Note that the forward orbit of 1 with R is dense in R + , but it grows only logarithmically, as R 2 n 2 ( 1 ) = n . Moreover, according to [10] and [18], the following representation is in force: R n ( 1 ) = b ( n ) / b ( n + 1 ) , n 0 , where b ( n ) is the number ofhyperbinaryrepresentations of n, that is the number of ways of writing the integer n as a sum of powers of 2, each power being used at most twice. For instance 8 = 2 3 = 2 2 + 2 2 = 2 2 + 2 + 2 = 2 2 + 2 + 1 + 1 and thus b ( 8 ) = 4 .
The two maps F and R introduced above satisfy the following remarkable commutation rule:
Proposition 4.  
For all x R + we have
R m F n ( x ) = F n R 2 n m ( x ) , n , m 1
Proof. 
For the case n = m = 1 the proof amounts to a straightforward verification, either by direct inspection or through the action of F and R on c.f.e.’s, that is (12) and
R : [ a 0 ; a 1 , a 2 , ] [ 1 ; a 1 1 , a 2 , ] , a 0 = 0 [ 0 ; a 0 , 1 , a 1 1 , a 2 , ] , a 0 > 0
The general case easily follows by induction. □
Note that the map R is invertible, with inverse
R 1 ( x ) = 1 1 x + 2 1 x
On the other hand, the map F is two-to-one, with
F 1 ( x ) = x x + 1 , x + 1
In particular, the set of F-pre-images of x = p q coincides with the set of the descendants { p p + q , p + q q } considered above (cf. Section 3.1).
Therefore, as an ordered set, the tree T ^ can be generated both `horizontally’, as the set of successive R-images of 1, and `vertically’, as the set of successive F-pre-images of 1: T ^ = n 0 R n ( 1 ) = n 0 F n ( 1 ) , and, more specifically,
k = 0 2 n 2 R k ( 1 ) = k = 0 n 1 F k ( 1 ) , n 1 .
Regarding the ergodic properties of these maps, we start observing that F possesses an absolutely continuous invariant measure ν , which can be computed explicitly: first the invariance means that ν = ν F 1 where the latter is the measure which assigns to each measurable set A R + the number ν ( F 1 ( A ) ) . Second, expressing this measure as ν ( d x ) = h ( x ) d x , the invariance property translates into the following functional equation for the density h:
h ( x ) = y F 1 ( x ) h ( y ) | F ( y ) | = 1 ( 1 + x ) 2 h x 1 + x + h ( x + 1 )
and one immediately checks that a continuous solution is h ( x ) = 1 / x . Note that h L 1 ( R + , d x ) , that is ν is an infinite F-invariant a.c. measure. On the other hand, as the function ρ establishes a topological conjugacy between R and the dyadic odometer K (see (14)), it provides a topological conjugacy also between F and the doubling map D : [ 0 , 1 ] [ 0 , 1 ] (as shown in [5]), i.e.
F = ρ 1 D ρ , D ( x ) = 2 x ( mod 1 )
The map D acts as a shift on binary expansions and preserves the Lebesgue measure on the unit interval7.
Since Lebesgue measure is preserved also by the invertible map K, the conjugacies (14) and (18) ensure that both F and R leave invariant the probability measure d ρ .
On the other hand, all orbits { R i ( x ) : i 0 } , x R ¯ + being dense, the dynamical system ( R ¯ + , R ) is uniquely ergodic and therefore d ρ is its unique invariant measure. In a different guise, the map F possesses several invariant measures, two of which are d ν and d ρ , which are of course singular with respect to one another. In particular, as the entropy of the doubling map D with respect to the Lebesgue measure is log 2 , this same value is also the entropy of F with respect to the probability measure d ρ , which is therefore called the measure of maximal entropy for F.

4.1. An Alternative Ordering

Proposition 4 can be viewed as expressing the fact that the "horizontal" action of the map R respects the order induced by the "vertical" action of the map F on the tree. Moreover, the conjugation (18) between F and D can be obtained in two steps, passing via the map ϕ through the orientation preserving Farey map H ˜ , so that F = ϕ 1 H ˜ ϕ . We can ask whether there is an orientation reversing version of the above constructions. For instance, if we consider the standard Farey map H, then the map G = ϕ 1 H ϕ , given by
G : x x 1 x , 0 x 1 1 x 1 , x > 1
is conjugated via ρ with the tent interval map T, i.e. (18) is replaced by G = ρ 1 T ρ . Therefore, d ρ is the measure of maximal entropy for G as well. In addition, one easily verifies that G preserves also the a.c. measure with density 1 / ( x ( 1 + x ) ) . We also note that G ( Φ ) = Φ where Φ = ( 5 + 1 ) / 2 is the golden mean. Since | G ( Φ ) | = 1 + Φ is a repelling fixed point.
Now, what is the map S : R ¯ + R ¯ + which plays the role of R in this orientation reversing setting? A close inspection based on continued fraction expansions leads to the following expression:
S : x = [ a 0 ; a 1 , a 2 , ] t r i m = 0 m m 0 m m 2 m m 1 m m , c l i p t r i m = 0.5 m m 0 m m 2 m m 1 m m , c l i p t r i m = 0.5 m m 0 m m 2 m m 1 m m , c l i p t r i m = 0 m m 0 m m 2 m m 1 m m , c l i p [ 0 ; n + 1 , a n 1 , a n + 1 , ] , a 0 = a 1 = = a n 1 = 1 , a n > 1 [ a 1 ; a 2 , a 3 , ] , a 0 = 0 [ 0 ; + 2 ] , x = [ 1 ; 1 , , 1 1 , 2 ]
We also set S ( 0 ) = , S ( ) = 1 and S ( Φ ) = 0 . Now note that
[ 1 ; 1 , , 1 1 , 2 ] = F + 2 F + 1
where F be the -th Fibonacci number, given by
F 1 = 1 , F 0 = 0 and F = F 1 + F 2 , 1
We then construct the sequence ( x k ) k 0 as x k F k / F k 1 , whose first elements are
x 0 = 0 , x 1 = , x 2 = 1 , x 3 = 2 , x 4 = 3 2 , x 5 = 5 3 ,
and observe that S is continuous everywhere but at the points x k , k 1 , where it is right-continuous. An alternative expression for S is thus the following:
S : x F k x F k + 1 ( k F k F k 1 ) x k F k + 1 + F k , x C k
where
C 2 r = [ x 2 r , x 2 r + 2 ) , C 2 r + 1 = [ x 2 r + 3 , x 2 r + 1 ) , r 0
One checks that for all x R + it holds
S m G n ( x ) = G n S 2 n m ( x ) , n , m 1 .

5. Motions on the Modular Surface

F can be obtained as the factor map of a first return map for the geodesic flow on the modular surface. Let us briefly recall what does this mean.
Let H = z = x + i y : x R , y R + be the upper half-plane, viewed as a Riemmanian manifold with hyperbolic metric d s 2 = ( d x 2 + d y 2 ) / y 2 . Set moreover M = Γ H = { Γ z : z H } , with Γ = P S L ( 2 , Z ) , endowed with the quotient topology. We recall that the Fuchsian group Γ has two generators U and V, which can be chosen as U = 0 1 1 0 and V = U B 1 = A U = 0 1 1 1 . It holds moreover U 2 = V 3 = I (so that Γ is not a free group).
Let φ t : S M S M be the geodesic flow on the unit tangent bundle of M, and let us construct a subset of S M which is met infinitely many times by each φ t -orbit. To this end set
I = z = x + i y : x = 0 , y R + H
and consider the section C made by the projections on S M of all vectors of S H having base point on I and right-oriented, that is vectors of the form v = ( z , θ ) with z I and θ ( π , 2 π ) . One easily sees that the elements thus selected are all distinct. There are however φ t -orbits which do not visit C infinitely often. These are exactly the projections of geodesics which either start or end in a cusp of P S L ( 2 , Z ) , that is a rational point on the real line. On S M these orbits converge towards (or come from) the cusp at infinity and for this reason they are called scattering geodesics. They form of course a set of zero measure.
Now, a vector v S H whose projection lies in C can be described by the two asymptotic coordinates u and w which identify the geodesic γ ( v , t ) having tangent vector v at t = 0 . Whence,
C ( u , w ) : u < 0 < w
In turn C can be decomposed as C = C 1 C 2 where
C 1 = { ( u , w ) : u < 0 < w < 1 } , C 2 = { ( u , w ) : u < 0 , w > 1 }
The next figure shows a geodesic γ such that the projection on S M of γ I belongs to C 2 .
Figure 5.
Figure 5.
Preprints 202122 g005
We now construct the first return map  T C : C C which sends each intersection of a φ t -orbit with C to the next one. To this end, we consider the geodesic triangle G with vertices 0, 1 and , that is
G = { z H | 0 < Re z < 1 , | z 1 2 | > 1 2 }
Its three sides are equivalent w.r.t. P S L ( 2 , Z ) : 01 ^ and 1 ^ are mapped to I by the transformations U V 2 A 1 : z z / ( 1 z ) and U V B 1 : z z 1 respectively. Now, suppose that the projection of v S H lies in C and has coordinates ( u , w ) . There are two possibilities: if the projection of v lies in C 2 (so that the geodesic γ determined by v leaves G through 1 ^ ), then it is mapped by B 1 to ( u 1 , w 1 ) ; if instead the projection of v lies in C 1 (so that γ leaves G through 01 ^ ), then it gets mapped by A 1 to ( u 1 u , w 1 w ) . Therefore the first return map on C = C 1 C 2 is
T C : ( u , w ) u 1 u , w 1 w , ( u , w ) C 1 ( u 1 , w 1 ) , ( u , w ) C 2
The action of T C on the second coordinate finally yields the factor map F : R + R + given by (6).
Figure 6.
Figure 6.
Preprints 202122 g006
Now, referring to the figure above, one can produce a tessellation of H by taking all the images of the geodesic triangle G with the isometries A and B (acting as Möbius transformations). Moreover, a direct consequence of the generating rule (13) is that, given x = p / q , the matrix product X dealt with in Proposition 1, as well as the corresponding binary sequence σ ( x ) { 0 , 1 } * , are in a one-to-one correspondence with the coding w.r.t. the above tessellation of the scattering geodesic c p / q which converges to p / q , the central cusp of the geodesic triangle X ( G ) (see [16]).
Figure 7.
Figure 7.
Preprints 202122 g007
In a similar fashion as finite paths on T correspond to scattering geodesics on H , we can establish a correspondence between FC words and Ford circles. These are a countable family of circles orthogonal to the sides of the just mentioned geodesic triangles. Each of them, denoted C p q , is tangent to R in some rational point p / q , and has diameter 1 / q 2 . The largest circles have thus unit diameter and correspond to C n , n Z (the following picture shows C 0 , C 1 3 , C 1 2 , C 2 3 and C 1 ).
Figure 8.
Figure 8.
Preprints 202122 g008
Clearly, each Ford circle C p q with p q 0 corresponds to a unique FC word w with p q = | w | 1 | w | 0 , and vice versa.
Ford circles and scattering geodesics are related as follows:
first, the image with X p q = n m t s S L ( 2 , Z ) of the vertical geodesic I = { z = i e τ : τ R } is a geodesic connecting X p q ( 0 ) = m s and X p q ( ) = n t . X p q ( G ) is a Farey triangle with central cusp in p q = m + n s + t .
If, instead, we apply X p q to the positive and negative horocycles of v = ( i , 0 ) T H , namely the horizontal line H + = { z = i + τ : τ R } (B-invariant) and the circle H = { z = i 1 + i τ : τ R } (A-invariant) we obtain two Ford circles:
  • C n t , of diameter 1 t 2 and tangent to R in n t ,
  • C m s , of diameter 1 s 2 and tangent to R in m s ,
which touch each other at the point X p q ( i ) . The “child" circle C p q touches the cusp at p q , and the “parents" circles C n t and C m s at X p q B ( i ) and X p q A ( i ) , respectively. Finally, the geodesics that cross C p q perpendicularly (in particular c p q ) converge at the cusp.
Example. X 1 2 = A = 1 0 1 1 , C 1 2 = A 2 ( H + ) = A B ( H ) (see the figure above).
One easily checks that two Ford circles C p q e C p q , with p q < p q , are either tangent to each other or they do not intersect, and the former situation occurs whenever p q p q = 1 . Moreover, three Ford circles C p q , C p q and C p q with p q < p q < p q are tangent to each other if and only if p q = p q p q (see, e.g., Theorems 5.6 and 5.7 in [1]).
We can say more, but first we briefly present the classical correspondence between a matrix X PSL ( 2 , R ) and v = ( z , θ ) S H . Given v = ( z , ζ ) S H , with z H and ζ T z H C , we can identify S H with PSL ( 2 , R ) by corresponding v to the unique element g PSL ( 2 , R ) such that z = g ( i ) and ζ = d g ( ζ 0 ) = g ( z ) ζ 0 , where ζ 0 is the unit vector tangent to the imaginary axis. One can also write the unit tangent vector as ζ = Im ( z ) e i ( θ + π 2 ) where θ is the angle formed by ζ with the vertical line, measured counterclockwise. By identifying ζ with θ , we obtain the parametrization v = ( z , θ ) for the points in S H , and
( z , θ ) = g ( i ) , β g ( 0 )
where g = a b c d is given by
z = g ( i ) = b + i a d + i c , θ = β g ( 0 ) = 2 arg ( d + i c ) = 2 tan 1 c d
In this way, the action of the positive and negative horocyclic flow  h t + and h t on PSL ( 2 , R ) corresponds to the right multiplication by one-parameter subgroups of matrices
n t + = 1 t 0 1 , h t + g n t + a n d n t = 1 0 t 1 , h t g n t
This also assures us of the commutativity between isometries and flows, since the former act from the left while the latter act from the right. Finally we can say the following: consider the correspondence between an element x T and X SL ( 2 , Z ) , given by (2), and the correspondence between a matrix X SL ( 2 , Z ) , viewed as an element of PSL ( 2 , R ) , and v = ( z , θ ) S H , given by (24). This gives a correspondence between elements in T and points z H , as follows:
x = m s n t X = n m t s v = X ( i ) , β X ( i ) X ( i )
recalling that β X ( i ) = 2 tan 1 ( t / s ) .
However, this correspondence is not a bijection since the same point in H can be associated to multiple point in S H and hence to multiple X SL ( 2 , Z ) which are not even associated to some x T . But considering the direction from x T to z H , which is well defined, we get a correspondence between x and z = X ( i ) .
Moreover, for our scope, we just need to prove that:
X 1 = n m t s a n d X 2 = m n s t
correspond to v 1 , v 2 S H with z 1 = z 2 and opposite vectors θ 1 and θ 2 .
But this is easily shown considering:
n + m i t + s i = n + m i t + s i · i i = m + n i s + t i
and, recalling that tan 1 ( x ) + tan 1 ( 1 x ) = ± π 2 ,
2 tan 1 t s + 2 tan 1 s t = 2 tan 1 t s + tan 1 s t = ± π .
So, we have a direct way to determine both x and z from X PSL ( 2 , Z ) , where z is obtained in the canonical way, and
x = m s n t = n t m s n t m s
Example. As in the previous example, we have C 1 2 = A 2 ( H + ) = A B ( H ) , which indeed is the negative horocycle for v 1 = ( z 1 , θ 1 ) , with z 1 A 2 1 3 and the positive horocycle for v 2 = ( z 2 , θ 2 ) , with z 2 A B 2 3 (see Figure ).
With the elements presented thus far, we can show that the horizontal movement on T corresponds to horocyclic flows along Ford circles. To this end we present first the following.
Lemma 5.  
The horocyclic flow with unit time on a Ford circle moves from a tangency point with another Ford circle to the next one.
Proof. 
From the content of this section, we know that the Ford circles associated with 1 0 (the horizontal line) and 0 1 can be mapped to any other Ford circle C x via an isometry. We can consider the Ford circle C x associated with p q and the tangency point with another Ford circle C x associated with p q . Then, both horocyclic flows, with either negative or positive unit time, are mapped to the respective flows on the Ford circles C 1 0 and C 0 1 . For these, it can be directly checked that, moving with unit time (positive or negative), we are moving from the starting tangency point z = i to the next one in the corresponding direction along the corresponding horocycle. This proves the lemma. □
To state the next result, for any positive integer t we set:
A t 1 0 t 1 h t , D t B t = 1 t 0 1 h t +
so that, in particular, A 1 = h t = 1 = A and D D 1 = h t = 1 + = B 1 .
Then, the horocyclic flows with time t correspond to either A t or B t , as in (25). Moreover, as shown in (26) and (27), we recall that each fraction x in T (and T ^ ) corresponds to the tangency point between the parents of the Ford circle C x , and vice versa.
We can now state the following:
Theorem 5.  
The horizontal displacement on T , starting at the root 1 and moving from left to right on each level, corresponds to clockwise motion along Ford circles. More precisely, assume that we reached x = r m , the m-th element of T , as in Theorem 4, with d e p t h ( x ) = n . Then, the move to the next element y = r m + 1 corresponds to the following displacement (via horocyclic flow) on Ford circles:
  • if x is the rightmost element in a level, i.e. m = 2 n 1 , then moving to y corresponds to applying D n 1 A n for n even, and A n 1 D n for n odd;
  • if, instead, x is either the leftmost or an inner element in a level, i.e. m = 2 n 1 + ( k 1 ) for some 1 k < 2 n 1 and k = 2 p 1 ( mod 2 p ) , with 1 p n 2 , then moving to y corresponds to applying A 1 + 2 ( p 1 ) if n = k ( mod 2 ) , D 1 + 2 ( p 1 ) otherwise.
Proof. 
Firstly, it is important to note that when considering the horocyclic flows, each time we move from one Ford circle to another tangent to it, the vector switches direction from inward to outward, or vice versa. This means that, since the movement is clockwise, we transition from the positive horocyclic flow with negative time h t + D t (to the left of the vector) to the negative horocyclic flow with positive time h t A t (to the right of the vector), or vice versa, from h t A t to h t + D t . Since each level n > 1 of the tree contains an even number of elements, as we move along the level, we perform an odd number of swaps between horocycles before reaching the last element n 1 T . This element corresponds to z = ( n 1 ) + i H , i.e. the point of tangency between C 1 0 and C n 1 1 (the parents of C n 1 ). As a result, the vector v n 1 will point in the opposite direction compared to v n 1 1 w.r.t. C 1 0 . Therefore, when moving from one level to the next, say from n to n + 1 , we alternate between D n 1 A n , when n is odd, and A n 1 D n , when n is even. In this way, the direction of the vector v is reversed two more times, and the next level n + 1 start from 1 n + 1 with the vector in the opposite direction compared to 1 n . Thus, the horocyclic flow that begins at the start of a level n of the tree correspond to A if n is odd, and to D if n is even.
Now let x = r m , where m = 2 n 1 + ( k 1 ) ,with 1 k 2 n 1 , so that it is the k-th element of the n-th level of T . If we want to move horizontally to the next element r m + 1 , we have two possibilities: either k < 2 n 1 , in which case we move to position k + 1 on the same level, or r m + 1 is the first element of the next level n + 1 . However, we have already discussed this case, so, from now on, we will consider k < 2 n 1 .
If k is odd, then x is the left child of its parent node x , and r m + 1 is the right child. In H , each of these two corresponds to the tangency points between the Ford circle C x of x and the Ford circle of the other parent. Therefore, as in Lemma 5, moving from one point to the next along C x corresponds to the horocyclic flow with | t | = 1 , which, depending on the orientation of the vector v, corresponds to A if n is odd, or D if n is even.
If, instead, k is even, then we have a right child, and its parent is different from the parent of r m + 1 . Indeed, we need to go back at least two levels to find a common ancestor. Considering the structure of the tree, one can see that for k = 1 , 2 , 3 , , 2 n 2 , , 2 n 1 , the number of steps needed to reach the common ancestor is 1, 2, 1, 3, 1, 2, 1, 4 , , 1 , n 1 , 1, …, 1. In general, for k = 2 p 1 ( mod 2 p ) , for 1 p n 2 we need p steps. This can be easily proven by induction on the level of the tree. For n = 2 , it is trivially true. Assuming the formula holds for levels up to n, it follows that, by construction, for all the new left children, which correspond to k = 1 ( mod 2 ) = 2 0 ( mod 2 1 ) , the formula holds. For a given right child x, the common ancestor with the node directly to its right, which coincides with the common ancestor of its parent x with the node to its right, is one step further than the number of steps required from its parent x . By induction, from x , corresponding to k = 2 p 1 ( mod 2 p ) , we need p steps, so from x we will need p + 1 . From one level to the next the nodes duplicate, and x will be at the position k = 2 k so that k = 2 p ( mod 2 p + 1 ) , as required.
We have that both r m and r m + 1 correspond to points on the Ford circle associated with the (nearest) common ancestor y T , specifically to the points of tangency with their respective parent. On the horocycle, between them, there are 2 ( p 1 ) points, where p is the number of steps required to reach the common ancestor. Indeed, all the nodes traversed while moving up from r m to the ancestor form a Farey pair with y, as do the nodes traversed to reach down to r m + 1 , and, by the properties of T and the Ford circles, these are all and only the points that lie between them. Thus, following the ideas in the proof of Lemma 5, this movement corresponds to the horocyclic flow with time | t | = 1 + 2 ( p 1 ) . The exact one, A or D, depends on m, and, more directly, on n and k. As we have seen, for n even, odd k corresponds to D and even k corresponds to A, while the reverse is true when n is odd. □
We already showed how the scattering goedesics in H are correlated with the vertical movement on the Stern-Brocot tree T . With this theorem, we established a parallel between Ford horocycles, which are orthogonal to the geodesics defined in the Farey tessellation, and the horizontal movement on T .
Remark 11.  
The repeated horizontal movement on T can be interpreted geometrically as a cyclical movement along the upper arcs of the Ford circles and, dynamically, as a repeated composition of horocyclic flows. This corresponds to a repeated right multiplication of matrices, expressed as:
( A ) D ( A D 2 ) A D 3 A ( D 2 A 3 ) D A 3 D A 5 D A 3 D ( A 3 D 4 ) A D 3 A D 5 A D 3 A D 7 A D 3 A D 5 A D 3 A ( D 4 A 5 )
where the brackets correspond to the jump to the next level on T , or equivalently, to the return to i in H and subsequent descent towards X 1 n + 1 ( i ) 1 n + 1 .
Remark 12.  
If one want to consider the horizontal movement on the n-th level of T as composition of horocyclic flows but always resetting and starting from ( i , 0 ) S H , we would have
( I 2 ) ( A ) D ( A 2 ) D A 3 D ( A 3 ) D A 3 D A 5 D A 3 D ; ( A 4 ) D A 3 D A 5 D A 3 D A 7 D A 3 D A 5 D A 3 D
which more clearly show the palindromic and symmetric nature of the movement along a level of T , obviously already present in Theorem 5.
To conclude, we provide figures to visualize the motions described in Theorem 5. In the first figure, we indicate the direction of traversal of the circles, which will be omitted in the subsequent figures, as it remains the same, i.e., clockwise. Additionally, clockwise is considered the negative direction along the horizontal line C 1 0 . After the first two figures we will omit vectors and points to reduce clutter. Moreover, in all figures, we color-code the horocyclic flows: red for the negative horocycle H , associated with positive time, and blue for the positive horocycle H + , associated with negative time. Specifically, red represents A t , and blue represents D t , where t 1 denotes the number of tangent points that must be surpassed to reach the end of the arc. A note is due: in the figures showing the movement on the n-th level, we have added, for completeness, the descent from 1 1 to the first element of the n-th level, which would not be included in the movement through the level. Visually, it correspond to the leftmost colored arc, descending from i along C 0 1 .
Figure 9. Movement on the second level of T and transition to the third.
Figure 9. Movement on the second level of T and transition to the third.
Preprints 202122 g009
Figure 10. Movement on the third level.
Figure 10. Movement on the third level.
Preprints 202122 g010
Figure 11. Transition to the fourth level.
Figure 11. Transition to the fourth level.
Preprints 202122 g011
Figure 12. Movement on the fourth level.
Figure 12. Movement on the fourth level.
Preprints 202122 g012
1
Defining FC words by reversed concatenation does not really change matters. In particular, it is easy to show by induction that FC words defined as above (resp. by reversed concatenation) are also Lyndon words, i.e. they are minimal (resp. maximal) w.r.t. cyclic permutations. We should also notice that what we call here Farey-Christoffel words, to emphasize their relation with the Farey order of the rationals, are commonly called just Christoffel words [2] since they have been studied for the first time by Christoffel in 1875, see [9].
2
The definition of T 0 given by the theorem is equivalent to saying that for each subword 0 n 1 we substitute each of the first n 1 zeros with 01, while what remains, i.e. 01, we substitute with 1.
3
A Sturmian sequence is defined as a billiard sequence, and to apply T one must add a 0 as a prefix, which corresponds to considering the path on the lattice Z 2 instead of the cutting sequence.
4
Western music, since its Greek origins, has primarily used the fifth interval as a generator of harmonic systems.
5
If the slope of the initial sequence w is smaller than one we set a 0 = 0 . On the other hand the value of a single symbol can be taken to be (as it seems natural when passing to infinite sequences by indefinite repetition of the finite string).
6
In the first case, if a 1 = 1 one sets [ 0 ; a 1 1 , a 2 , ] = [ a 2 ; a 3 , a 4 , ] .
7
This in particular entails that F is chaotic : is topologically transitive, its periodic orbits are dense and has sensitive dependence on initial conditions.

References

  1. Apostol, T. M. Modular functions and Dirichlet series in number theory; Graduate Text in Mathematics; Springer-Verlag, 1976. [Google Scholar]
  2. Berstel, J; Lauve, A; Reutenauer, C; Saliola, F. Combinatorics on words: Christoffel words and repetitions in words; CRM Monograph Series; 2008; Volume 27. [Google Scholar]
  3. Berthé, V; Delecroix, V. Beyond substitutive dynamical systems: S-adic expansions. RIMS Lecture note Ko^kyu^rokuBessatsu 2014, B46, 81–123. [Google Scholar]
  4. Berthé, V; de Luca, A; Reutenauer, C. On an involution of Christoffel words and Sturmian morphisms. European Journal of Combinatorics 2008, 29, 535–553. [Google Scholar] [CrossRef]
  5. Bonanno, C; Isola, S. Orderings of the rationals and dynamical systems. Colloquium Mathematicum 2009, 116, 165–189. [Google Scholar] [CrossRef]
  6. Bugeaud, Y; Conze, J-P. Calcul de la dynamique de transformations linéaires contractantes mod 1 et arbre de Farey. Acta Arithmetica LXXXVIII 1999, 3, 201–218. [Google Scholar] [CrossRef]
  7. A Brocot, Calcul des rouages par approximation, nouvelle méthode. Revue Chronométrique 1860, 6, 186–194.
  8. Carey, N.; Clampitt, D. Aspects of well-formed scales. Music Theory Spectrum 1989, 11, 187–206. [Google Scholar] [CrossRef]
  9. Christoffel, E B. Observatio arithmetica. Annali di Matematica Pura ed Applicata 1875, 6, 148–152. [Google Scholar] [CrossRef]
  10. Calkin, N; Wilf, H S. Recounting the rationals. Amer. Math. Monthly 2000, 107, 360–363. [Google Scholar] [CrossRef]
  11. Domínguez, M.; Clampitt, D.; Noll, T. WF Scales, ME Sets, and Christoffel Words; MCM 2007, CCIS 37; Klouche, T., Noll, T., Eds.; Springer-Verlag, 2009; Volume 37, pp. 477–488. [Google Scholar]
  12. Graham, R L; Knuth, D E; Patashnik, O. Concrete Mathematics; Addison-Wesley, 1990. [Google Scholar]
  13. A De Luca, Sturmian words: structure, combinatorics, and their arithmetics. Theoretical Computer Science 1997, 183, 45–82. [CrossRef]
  14. Isola, S. Su alcuni rapporti tra matematica e scale musicali, La Matematica nella Società e nella Cultura. Rivista dell’Unione Matematica Italiana, Serie I 2016, Vol. 1(N. 1), 31–50. [Google Scholar]
  15. Hellegouarch, Y. Gammes naturelles, first part in Gazette SMF 81 (1999) 25-39; second part in Gazette SMF 82 (1999), 13-25.
  16. Knauf, A. Number theory, dynamical systems and statistical mechanics. Reviews in Mathematical Physics 1999, 11, 1027–1060. [Google Scholar] [CrossRef]
  17. Kuipers, L; Neiderreiter, Neiderreiter. Uniform distribution of sequences; Wiley: New York, 1974. [Google Scholar]
  18. Newman, M. Recounting the rationals. Continued, Amer. Math. Monthly 2003, 110, 642–643. [Google Scholar]
  19. Fogg, N Pytheas. Substitutions in Dynamics, Arithmetics and Combinatorics; LNM 1794; Springer, 2002. [Google Scholar]
  20. Queffélec, M. Dynamical systems arising from substitutions; Springer Berlin Heidelberg: Berlin, Heidelberg, 1987. [Google Scholar]
  21. C Series, The geometry of Markoff numbers. The Mathematical Intelligencer 1985, 7, 20–29. [CrossRef]
  22. Stern, M. Über eine zahlentheoretische Funktion. Journal für die reine und angewandte Mathematik 1858, 55, 193–220. [Google Scholar]
  23. Solomyak, B. A note on spectral properties of random S-adic systems. 2025. Available online: https://arxiv.org/abs/2403.08884.
  24. Reutenauer, C. From Christoffel Words to Markoff Numbers; Oxford University Press, 2018. [Google Scholar]
  25. Richards, I. Continued fractions without tears. Mathematical Magazine 1981, 54(n. 4). [Google Scholar] [CrossRef]
  26. J Von Neumann, Zur Operatorenmethode in klassischen Mechanik. Ann. Math. 1932, 33, 587–642. [CrossRef]
Figure 1. The first five levels of the Stern-Brocot tree.
Figure 1. The first five levels of the Stern-Brocot tree.
Preprints 202122 g001
Figure 3.
Figure 3.
Preprints 202122 g003
Figure 4.
Figure 4.
Preprints 202122 g004
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.
Prerpints.org logo

Preprints.org is a free preprint server supported by MDPI in Basel, Switzerland.

Subscribe

Disclaimer

Terms of Use

Privacy Policy

Privacy Settings

© 2026 MDPI (Basel, Switzerland) unless otherwise stated