Rational Tree Morphisms and Transducer Integer Sequences: Definition and Examples

Zoran Šunić ^{1} Department of Mathematics Texas A&M University College Station, TX 77843-3368 USA

                      sunic@math.tamu.edu

Abstract

The notion of transducer integer sequences is considered through a series of examples (the chosen examples are related to the Tower of Hanoi problem on 3 pegs). By definition, transducer integer sequences are integer sequences produced, under a suitable interpretation, by finite transducers encoding rational tree morphisms (length and prefix preserving transformations of words that have only finitely many distinct sections).

1 Introduction

It is known from the work of Allouche, Bétréma, and Shallit (see [1, 2]) that a squarefree sequence on 6 letters can be obtained by encoding the optimal solution to the standard Tower of Hanoi problem on 3 pegs by an automaton on six states. Roughly speaking, after reading the binary representation of the number i as input word, the automaton ends in one of the 6 states. These states represent the six possible moves between the three pegs; if the automaton ends in state q_{xy}, this means that the one needs to move the top disk from peg x to peg y in step i of the optimal solution. The obtained sequence over the 6-letter alphabet { q_{xy} | 0 ≤ x, y ≤ 2, x ≠ y } is an example of an automatic sequence.

We choose to work with a slightly different type of automata, which under a suitable interpretation, produce integer sequences in the output. The difference with the above model, again roughly speaking, is that not only the final state matters, but the output depends on every transition step taken during the computation and both the input and the output words are interpreted as encodings of integers. The integer sequences that can be obtained this way are called transducer integer sequences. We provide some examples that illustrate the notion of a transducer integer sequence. The chosen examples are related to the Tower of Hanoi problem on 3 pegs, but one could certainly provide and study a variety of different examples. The choice was guided by the need for relatively familiar and appealing setting that is, at the same time, mathematically challenging and interesting.

1Partially supported by NSF grant DMS-0600975.

In recent years, a very fruitful line of research in group theory has led to the notion of a self-similar group [20] (also known as automata groups [10] or state closed groups [22]). Many challenging problems have been solved by using finite automata to encode groups of tree automorphisms with interesting properties, leading to solutions to outstanding problems. To name just a few, examples include first Grigorchuk group [9], solving the problem of Milnor on existence of groups of intermediate growth and the Day-von Neumann problem on existence of amenable but not elementary amenable groups; the Basilica group [18, 7], providing an example of amenable but not subexponentially amenable group; Wilson groups [25], solving the problem of Gromov on existence of groups of non-uniform exponential growth; the realization of the lamplighter group L_{2} by an automaton [17], leading to the solution of the Strong Atiyah Conjecture on L^{2}-Betti numbers [15], and the recent solution to Hubbard’s twisted rabbit problem in holomorphic dynamics [5]. The geometric language and insight coming from the interpretation of the action of the automata as tree automorphisms greatly simplifies the presentation and helps in the understanding of the underlying phenomena, such as self-similarity, contraction, branching, etc (see [10, 4, 3, 20] for definitions, examples, and details).

In the current article we use automata in the sense of transducers. As such, they generate self-similar groups (or semigroups) of tree automorphisms (or endomorphisms). In the same time, the input and the output words are interpreted as encodings of integers, bringing the topic closer to the topic of automatic sequences. Thus, it is not surprising that the concrete examples of transducer integer sequences that are exhibited here all gave high level of self-similarity and can be defined as limits of certain iterations of sequences.

2 Rational tree morphisms and finite transducers

For k ≥ 2 denote X_{k} = {0, 1, …, k − 1}. The free monoid X_{k}^{∗} has the structure of a k-ary rooted tree X_{k}^{∗} in which the empty word ∅ is the root, the words of length n constitute level n and each vertex v has k children, namely vx, for x a letter in X_{k} (see Figure 1 for the ternary tree). The tree structure imposes order on X_{k}^{∗}, which is the well known prefix order. Namely, we say that u ≤ v if u is a vertex on the unique geodesic from ∅ to v in X_{k}^{∗}, which is equivalent to saying that u is a prefix of v. A map μ : X_{k_{1}}^{∗} → X_{k_{2}}^{∗} is a tree morphism if it preserves the word length and the prefix relation, i.e

|μ(u)| = |u| and μ(u) ≤ μ(uw),

for all words u and w over X_{k_{1}}. In the case when k_{1} = k_{2}, morphisms are called endomorphisms and bijective endomorphisms are called automorphisms.

[figure: ∅; 0; 1; 2; 00; 01; 02; 10; 11; 12; 20; 21; 22; …; …; …; …; …; …; …; …; …]

Figure 1: Ternary rooted tree

Every tree morphism μ : X_{k_{1}}^{∗} → X_{k_{2}}^{∗} can be decomposed as

μ = π_{μ}(μ_{0}, …, μ_{k_{1}−1})

where π_{μ} : X_{k_{1}} → X_{k_{2}} is a map called the root transformation of μ and μ_{x} : X_{k_{1}}^{∗} → X_{k_{2}}^{∗}, x in X_{k_{1}}, are tree morphisms called the sections of μ. The root permutation and the sections of μ are uniquely determined by the recursive relation

μ(xw) = π_{μ}(x)μ_{x}(w),

which holds for every letter x and word w over X_{k_{1}}. Thus the sections describe the action of μ on the k_{1} subtrees hanging below the root in X_{k_{1}}^{∗} and the root transformation π_{μ} describes the action of μ at the root.

The tree morphisms act on the left and the composition is performed from right to left, yielding the formula

μν = π_{μ}(μ_{0}, …, μ_{k_{1}−1})π_{ν}(ν_{0}, …, ν_{k_{1}−1}) = π_{μ}π_{ν}(μ_{π_{ν}(0)}ν_{0}, …, μ_{π_{ν}(k_{1}−1)}ν_{k_{1}−1}).  (1)

The notion of a section of a tree morphism μ : X_{k_{1}} → X_{k_{2}} can be recursively extended to all vertices of the tree X_{k_{1}}^{∗} by setting μ_{∅} = μ and μ_{wx} = (μ_{w})_{x}, for w a word over X_{k_{1}} and x a letter in X. A tree morphism is rational if it has only finitely many distinct sections.

A quite efficient way of defining rational tree morphisms is by using finite synchronous transducers. A finite k_{1} to k_{2} synchronous transducer is a 5-tuple A = (Q, X_{k_{1}}, X_{k_{2}}, τ, π), where Q is a finite set of states, X_{k_{1}} and X_{k_{2}} are the input and output alphabets, τ : Q×X_{k_{1}} → Q is a map called the transition map of A, and π : Q×X_{k_{1}} → X_{k_{2}} is a map called the output map of A. Every state q of the finite transducer A defines a tree morphism, also denoted q by setting q_{x} = τ(q, x), for x ∈ X_{k_{1}}, and π_{q} : X_{k_{1}} → X_{k_{2}} to be the restriction of π defined by π_{q}(x) = π(q, x). Thus, for each state q of A we have

q(∅) = ∅ and q(xw) = π_{q}(x)q_{x}(w),  (2)

for x a letter in X_{k} and w a word over X_{k}. When started at state q, the transducer reads the first input letter x, produces the first letter of the output according to the transformation π_{q} and changes its state to q_{x}. The state q_{x} then handles the rest of the input and output. The states of a k-ary transducer (transducer in which k_{1} = k_{2} = k) define k-ary tree endomorphisms.

An invertible k-ary transducer is a transducer in which k_{1} = k_{2} = k and the transformation π_{q} is a permutation of X_{k}, for each state q in Q. The states of an invertible k-ary transducer define k-ary tree automorphisms.

When k_{1} ≤ k_{2} and, for each state q, the vertex transformation π_{q} is injective then every state of the transducer A is an embedding of the k_{1}-ary tree into the k_{2}-ary tree. We call such a transducer an injective transducer. When A = (Q, X_{k_{1}}, X_{k_{2}}, τ, π) is injective transducer one can define a partial inverse transducer A^{−1} = (Q^{−1}, X_{k_{2}}, X_{k_{1}}, τ^{−1}, π^{−1}) in which Q^{−1} = {q^{−1} | q ∈ Q}, and τ^{−1} : Q^{−1} × X_{k_{2}} → Q^{−1} and π^{−1} : Q^{−1} × X_{k_{2}} → X_{k_{1}} are partial maps, defined by τ^{−1}(q^{−1}, y) = p^{−1} and π^{−1}(q^{−1}, y) = x whenever τ(q, x) = p and π(p, x) = y. For a state q in Q and words u in X_{k_{1}}^{∗} and v in X_{k_{2}}^{∗} we then have

q(u) = v if and only if q^{−1}(v) = u.

Moreover, the composition q^{−1}q : X_{k_{1}}^{∗} → X_{k_{1}}^{∗} is the identity map on X_{k_{1}}^{∗} and the composition qq^{−1} : q(X_{k_{1}}^{∗}) → q(X_{k_{1}}^{∗}) is the identity map on the range q(X_{k_{1}}^{∗}) of the morphism q in X_{k_{2}}^{∗}. The partial morphism q^{−1} is not defined at any vertex of X_{k_{2}}^{∗} that is not in the range q(X_{k_{1}}^{∗}) of q. For such an input word w, starting at the state q^{−1}, the work of the partial inverse transducer A^{−1} stops before reading the whole input word, because not all possible transition steps are defined. In this sense, the partial inverse transducer may be used to recognize the range of the injective morphism q. Namely, the transducer A^{−1} accepts the word w if and only if it can read it completely, in which case the output word is precisely q^{−1}(w).

The boundary ∂X_{k}^{∗} of the k-ary tree X_{k}^{∗} consists of all infinite (to the right) words over X_{k}. The boundary has a structure of an ultrametric space homeomorphic to a Cantor set. The recursive definition (2) applies to both finite and infinite words w. The action of a state q of a k-ary transducer on the boundary ∂X_{k}^{∗} is by continuous maps, while the action of an invertible k-ary transducer is by isometries.

More on relations between rational morphisms of rooted trees and transducers can be found in [10].

There are two common ways to represent finite k_{1} to k_{2} transducers by labeled directed graphs such as the ones in Figure 2. The graph on the left represents an invertible ternary transducer. The vertices are the states, each state q is labeled by its corresponding root transformation (in this case permutation) π_{q}, and the edges labeled by the letters from X_{3} define the transition function τ (for every q in Q and x in X_{3} there exists an edge from q to q_{x} = τ(q, x) labeled by x). The graph on the right represents a non-invertible ternary transducer. The vertices are the states and for each pair (q, x) in Q × X_{3} an edge labeled by x | π_{q}(x) connects q to q_{x}. One can easily switch back and forth between the two formats. We refer to the second form (the one in which the output is indicated on the edges) as the Moore diagram of the transducer.

For 0 ≤ i < j ≤ 2, the ternary tree automorphisms a_{ij} from the transducer A_{H} are

[figure: (01); 0; 1; 2; a_{01}; (); 0,1,2; id; (02); 2; 0; 1; a_{02}; A_{H}; (12); 1; 2; 0; a_{12}; 2/1; 0/0; 1/1; α; 0/1; 1/1; 2/0; β; A_{L}]

Figure 2: An invertible ternary transducer A_{H} and a non-invertible ternary transducer A_{L}

defined recursively by

\begin{cases}a_{ij}(∅) = ∅, \\ a_{ij}(iw) = jw, \\ a_{ij}(jw) = iw, \\ a_{ij}(xw) = xa_{ij}(w), & x ∉ \{i, j\}, \end{cases}

for a word w over X_{3}. In simple terms, the only effect the transformation a_{ij} has on a word w over X_{3} is that it changes the very first appearance of either of the symbols i or j in w to the other symbol, if such an appearance exists. To simplify the notation, we write

a = a_{01},  b = a_{02},  and c = a_{12}.

The state labeled by id does not change any input word and represents the identity automorphism of the ternary tree. It is clear that a, b and c are self-invertible transformations of X_{3}^{∗}, i.e a^{2} = b^{2} = c^{2} = id.

The 3 to 2 tree morphisms defined by the transducer A_{L} are defined recursively by

α(∅) = ∅, α(0w) = 0α(w), α(1w) = 1α(w), α(2w) = 1β(w),
β(∅) = ∅, β(0w) = 1α(w), β(1w) = 1β(w),  β(2w) = 0β(w).

Definition 2.1. The semigroup (group) of k-ary tree endomorphisms (automorphisms) generated by all the states of an (invertible) k-ary transducer A is called the semigroup (group) of A and is denoted by S(A) (G(A)).

The group G(A_{H}) is introduced in [14], where it is called the Hanoi Towers group on 3 pegs (in fact, one Hanoi Towers group H^{(k)} is introduced for each number of pegs k ≥ 3). The name is derived from the fact that the group H^{(3)} models the well-known Tower of Hanoi problem on 3 pegs.

To recall, the Tower of Hanoi problem on 3 pegs and n disks is the following. In a valid n disk configuration, disks of different size, labeled by 1, 2, …, n according to their size, are placed on three pegs, labeled 0,1 and 2, in such a way that no disk is placed on top of a smaller disk. In a single move the top disk from one peg can be moved and placed on top of another peg, as long as the newly obtained configuration is still valid. Initially all n disks are placed on peg 0 and the problem asks for an optimal algorithm that moves all disks to another peg.

Each valid configuration of n disks can be encoded by a word of length n over X_{3}. The word x_{1} … x_{n} represents the unique valid configuration in which disk i is placed on peg x_{i}. The ternary tree automorphism a_{ij} then represents a move between peg i and peg j (in either direction). For example the move between peg 0 and peg 2 illustrated in Figure 3 is encoded by a_{02}(10212) = 12212.

Figure 3: A move between peg 0 and peg 2

The action of H^{(3)} on the ternary tree is level transitive, meaning that it is transitive on the levels of the tree. This is equivalent to the statement that any valid configuration on n disks can be obtained from any other valid configuration on n disks by legal moves.

Consider the stabilizer P_{n} of the vertex 0^{n} in H^{(3)}. The group H^{(3)} acts on the set H^{(3)}/P_{n} of left cosets of P_{n}. The action is described by the corresponding Schreier graph Γ_{n} = Γ_{n}(H^{(3)}, P_{n}, S) of P_{n} with respect to the generating set S = {a, b, c}. The vertices are the cosets of P_{n} and there is an edge connecting hP_{n} to shP_{n} for every coset hP_{n} and generator s in S. Since h′ ∈ hP_{n} if and only if h′(0^{n}) = h(0^{n}) the vertices of the Schreier graph Γ_{n} can be encoded by the vertices of the n-th level of the ternary tree (the coset hP_{n} is labeled by h(0^{n})) and two vertices are connected if and only if one is the image of the other under s, for some generator s in S. The Schreier graph Γ_{3} corresponding to level 3 of the ternary tree is given in Figure 4. Since all generators have order 2, no directions are indicated on the edges.

The sequence of graphs {Γ_{n}} converges to an infinite graph Γ in the space of pointed graphs based at 0^{n} (see [16] for definitions of this space), which is the Schreier graph Γ = Γ(H^{(3)}, P, S), where P = ∩_{n=0}^{∞}P_{n} is the stabilizer of the infinite ray 0^{∞} = 000 … on the boundary of the ternary tree. One can think of the limiting graph both as the Schreier graph of the action of H^{(3)} on the orbit of the infinite ray 0^{∞} in ∂X_{3}^{∗} or as the model of Tower of Hanoi problem representing all valid configurations that can be reached from the configuration in which (countably) infinitely many disks are placed on peg 0 (this configuration corresponds to the infinite word 0^{∞}). We denote this graph by Γ_{0^{∞}}.

Graphs similar to Γ_{n}, modeling the Tower of Hanoi problem are well known in the literature, but there is a subtle difference. Namely, the difference with the corresponding graphs in [19] modeling the Tower of Hanoi problem is that the edges in Γ_{3} are labeled (by the corresponding tree automorphisms) and our graphs have loops at the corners (corresponding to situations in which all disks are on one peg and the generator corresponding to a move between the other two pegs does not change anything), which turn them into 3-regular graphs.

[figure: 111; b; 011; b; a; 211; c; 021; c; 201; a; 221; c; b; 121; b; a; 101; a; c; 001; b; 220; a; 002; c; 120; a; c; 020; b; 202; c; b; 102; a; 100; a; c; b; 010; b; a; c; 212; c; b; a; 122; a; c; b; 000; b; c; 200; a; 210; c; 110; b; 112; a; 012; c; 022; b; 222; a]

Figure 4: The Schreier graph of H^{(3)} at level 3

Finite dimensional permutational representations of H^{(3)} based on the action on the levels of the ternary tree were used in [14] to calculate the spectrum of the graphs Γ_{n} as well as the limiting infinite graph Γ. Among interesting properties of H^{(3)} we mention that it is an amenable (but not subexponentially amenable), regular branch group over its commutator, it is not just infinite and its closure in the pro-finite group of ternary tree automorphisms is finitely constrained. Moreover, H^{(3)} is (up to conjugation) the iterated monodromy group of the finite rational map z ↦ z^{2} − \frac{16}{27z}, whose Julia set is the Sierpiński gasket. This explains the fact that the sequence of Schreier graphs {Γ_{0^{n}}} approximates the Sierpiński gasket. For more information on properties of H^{(3)} we refer the interested reader to [14, 13, 12, 11].

3 Transducer integer sequences

We first recall the well established notion of automatic sequence. The definition that follows (Definition 3.1) uses one of the equivalent formulations that can be found in [2] (see Definition 5.1.1 and Theorem 5.2.3).

A k-ary finite automaton with final state output (k ≥ 2) is a 6-tuple A = (Q, X_{k}, Y, s, τ, π), where Q is a finite set, called set of states, X_{k} = {0, …, k − 1} is the input alphabet, Y is a finite set called the output alphabet, s is an element in Q called the initial state, τ : Q×X → Q is a map called transition map and π : Q → Y is a map called final state output map. For every input word w over X_{k}, the automaton A produces a unique output symbol y_{w} from Y, defined as the image π(q) of the state q the automaton reaches after it reads the input word w starting from the initial state s. Thus y_{w} = π(τ(s, w)), where τ : Q × X^{∗} → Q is the recursive extension of τ on Q × X^{∗} defined by τ(q, ∅) = q and τ(q, xu) = τ(τ(q, x), u), for q a state in Q, x a letter in X_{k}, and u a word over X_{k}.

If, for every word w over X_{k} and every finite sequence 0^{m} of zeros, the output y_{w} is equal to the output y_{w0^{m}} we say that the automaton A tolerates trailing zeros. An automaton A that tolerates trailing zeros defines an infinite sequence y_{0}, y_{1}, y_{2}, … over the output alphabet Y, called the final state output sequence of A, as follows. For a natural number i ≥ 0 let [i]_{k} = i_{0} … i_{m} be any base k representation of i with i = ∑_{j=0}^{m} i_{j}k^{j} (thus the least significant digit is written first and we may have any number of trailing zeros). The term y_{i} in the final state output sequence is defined as the image π(q) of the state q the automaton reaches after it reads the input word [i]_{k} starting from the initial state s, i.e.,

y_{i} = π(τ(s, [i]_{k})).

Automata with final state output can be represented by labeled directed graphs similar to the ones representing transducers. The only significant difference is that each state q is labeled by the corresponding output letter π(q) and the initial state is indicated by an incoming arrow. As an example, consider the ternary automaton A_{0−2} in Figure 5.

[figure: 1; 0,1,2; a_{0}; 1; 0; 2; 1; a_{1}; -1; 0,1,2; a_{2}]

Figure 5: A ternary automaton with final state output A_{0−2}

Definition 3.1. A k-ary automatic sequence is an infinite sequence that can be obtained as the final state output sequence of some k-ary finite automaton that tolerates trailing zeros.

Note that Theorem 5.2.3 in [2] allows us to choose among several other, seemingly less restrictive, settings but we selected the one that reads integer representations starting from the least significant digit and that handles trailing zeros because it parallels what we are about to see (Definition 3.2) when we switch our attention to transducer integer sequences.

By Cobham’s theorem [8], a sequence over a finite alphabet is a k-ary automatic sequence if and only if it is an image under a coding of a fixed point of a k-uniform endomorphism.

Given a free monoid X^{∗} over a finite alphabet X, an endomorphism α : X^{∗} → X^{∗} can be uniquely defined by specifying the images of the letters in X under α. Suppose that, for all letters x in X, α(x) ≠ ∅ and that there exists a letter x in X such that α(x) = xw, where w is a non-empty word. Then, for all n ≥ 0, the n-th iterate α^{n}(x) is a proper prefix of the (n + 1)-th iterate α^{n+1}(x) = α(α^{n}(x)) and the limit lim_{n→∞}α^{n}(x) is a well defined infinite sequence over X. In the particular case when the length of all the words α(x), x ∈ X, is equal to k, the morphism α is called a k-uniform endomorphism.

The following example provides a cube-free automatic sequence that both illustrates the concept of automatic sequence and the claim of Cobham’s theorem. In addition, this example will play a role in our further considerations.

Example 3.1 (Cube-free automatic sequence). Let X = {1, −1} and denote by w_{α} the infinite binary sequence

w_{α} = lim_{n→∞}α^{n}(1) = 11 -1 11 -1 1 -1 -1 11 -1 11 -1 1 -1 -1 11 -1 1 -1 -1 1 -1 -1 …

obtained by iteration, starting from 1, of the endomorphism α : X^{∗} → X^{∗} given by (compare to sequence \underline{A080846}; all sequence references are to The On-Line Encyclopedia of Integer Sequences [24])

1 ↦ 11 -1 -1 ↦ 1 -1 -1.

A finite or infinite word w over an alphabet X is cube-free if it does not contain a subword of the form uuu, where u is a nontrivial finite word over X.

The infinite sequence w_{α} is cube-free. This claim can be easily verified by using the criterion of Richomme and Wlazinski [21], which only requires checking that

α(11 -1 -11 -11 -1 -11 -1 -111 -111 -11 -111 -1 -1)

is cube-free.

We offer two additional descriptions of w_{α}.

Define a sequence of words w_{[n]} of length 3^{n} by

w_{[0]} = 1,
w_{[n+1]} = w_{[n]}w_{[n]}w′_{[n]},

where w′_{[n]} is obtained from w_{[n]} by changing the middle symbol in w_{[n]} from 1 to -1. The limit lim_{n→∞}w_{[n]} is well defined and is equal to w_{α}.

For an integer i ≥ 0, let (i)_{k} = i_{0}i_{1} … be the sequence of digits in base k representation of i, where i = ∑_{j=0}^{∞} i_{j}k^{j} (the sequence ends in infinitely many 0’s).

Call a natural number i a 2-before-0 number if the least significant digit in the ternary representation (i)_{3} of i that is different from 1 is 2. Otherwise the number is called a 0before-2 number. Define an infinite sequence x_{0}, x_{1}, x_{2}, …, by

x_{i} = \begin{cases}1, & if i is a 0-before-2 number \\ −1, & if i is a 2-before-0 number \end{cases} .

The infinite binary sequence x_{0}, x_{1}, x_{2}, …, is equal to w_{α}.

We claim that the infinite sequence w_{α} is a ternary automatic sequence. It can be obtained as the final state output sequence of the automaton A_{0−2}. Indeed, the only time the automaton A_{0−2} produces -1 in the output is if it reaches the state a_{2}, which only happens if i is a 2-before-0 number.

We define now the notion of a transducer integer sequence.

Definition 3.2. A k_{1} to k_{2} transducer integer sequence is a sequence of integers {z_{i}}_{i=0}^{∞} such that there exists a k_{1} to k_{2} transducer A and a state q in A such that, for every i ≥ 0, the output word q((i)_{k_{1}}) is the base k_{2} representation of z_{i}.

Note that, by the above definition, not every transducer defines a transducer integer sequence, since some attention needs to be paid to trailing zeros. Namely, it is implicit in the definition that the state q of A maps the cofinal class of 0^{∞} in ∂X_{k_{1}}^{∗} to the cofinal class of 0^{∞} in ∂X_{k_{2}}^{∗} (the cofinal class of 0^{∞} is just the set of infinite words ending in 0^{∞}). We keep our attention only to this class since it is the one describing non-negative integers.

We should perhaps point out that the equivalent formulation of the definition of automatic sequence provided by Theorem 5.2.4 in [2] even more closely parallels our definition of transducer integer sequence than the one we gave in Definition 3.1.

Example 3.2. Let A_{T} be the ternary transducer in Figure 6. The state labeled by σ_{0} just

[figure: 0/1; 2/1; 1/0; σ_{1}; 0,1,2/0; σ_{0}]

Figure 6: A ternary transducer A_{T}

rewrites all digits to 0. Clearly,

σ_{1}(1^{n}0w) = σ_{1}(1^{n}2w) = 0^{n}10^{∞}

for any word w in the cofinal class of 0^{∞}. Since (0^{n}10^{∞})_{3} = 3^{n} the obtained integer sequence \{a_{n}\}_{n=0}^{∞} is (compare to sequence \underline{A038500})

1, 3, 1, 1, 9, 1, 1, 3, 1, 1, 3, 1, 1, 27, 1, 1, 3, 1, 1, 3, 1, 1, 9, 1, 1, 3, 1, ….

By thinking of the powers of 3 as an (infinite) alphabet, this sequence can be thought of as the fixed point of the iterations starting from 1 of the 3-uniform endomorphism defined by

x ↦ 1, 3x, 1 .

This sequence can also be defined by blocks a_{[n]} of length 3^{n} as

a_{[0]} = 1 a_{[n+1]} = a_{[n]}a′_{[n]}a_{[n]},

where a′_{[n]} is obtained from a_{[n]} by multiplying the middle term by 3.

The next example shows that there exist sequences of integers, and even bounded sequences of integers, that are not transducer integer sequences.

Example 3.3. The sign sequence (see \underline{A057427})

0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 …

is not a transducer integer sequence. Indeed, regardless of the cardinality of the chosen alphabets X_{k_{1}} and X_{k_{2}}, the fact that 0^{∞} must be mapped to 0^{∞} (this is simply because the 0 term of the sign sequence is 0) implies that the positive number k_{1}^{n} represented by 0^{n}10^{∞} must be mapped either to 0 or to a number of size at least k_{2}^{n}, which is greater than 1 for n ≥ 1. Here one sees in practice the important difference between the work of automata with final state output and the work of (synchronous) transducers. While the former can wait for the whole input before deciding on the output the latter must produce output at every transition step. In the above situation it is impossible for the transducer “to know in advance” if non-zero digits will be read at some point in the input and this makes it impossible to provide a correct output (since the correctness of the output crucially depends on the first digit of the output).

The following proposition provides a necessary condition for an integer sequence to be a transducer integer sequence.

Proposition 3.1. Let A = (Q, X_{k_{1}}, X_{k_{2}}, τ, π) be a finite k_{1} to k_{2} synchronous transducer, and let {z_{i}}_{i=0}^{∞} be the transducer integer sequence defined by choosing q in Q as the initial state. Then the growth of the sequence {z_{i}}_{i=0}^{∞} is at most polynomial. More precisely,

z_{i} < k_{2}^{|Q|} · i^{log_{k_{1}}(k_{2})},

for all i ≥ 0.

In particular, the growth of transducer integer sequences defined by rational tree endomorphisms is at most linear.

Proof. We may assume that all states of Q are accessible from q (otherwise we can delete the unnecessary states and get even tighter upper bound on the growth of {z_{i}}_{i=0}^{∞}).

A 0-path (cycle) in the Moore diagram of A is a directed path (cycle) in which each edge is labeled by 0|∗, where ∗ stands for arbitrary letters from X_{k_{2}}. Call such a path (cycle) nontrivial if at least one edge is labeled by 0|y for some nonzero y in X_{k_{2}}. It is clear that A does not have nontrivial 0-cycles (otherwise some elements in the cofinal class of 0^{∞} would be mapped to elements outside this class). Thus, the longest length of a non-trivial 0-path is |Q| − 1 (any longer path would have to repeat vertices and therefore would contain a cycle).

Therefore if n is the smallest number of digits needed to write i ≥ 0 in base k_{1}, then z_{i} can be written in base k_{2} by using no more than n + |Q| − 1 digits. This gives the estimate

z_{i} < k_{2}^{n+|Q|−1} = k_{2}^{|Q|} · k_{2}^{n−1} ≤ k_{2}^{|Q|} · k_{2}^{log_{k_{1}}(i)} = k_{2}^{|Q|} · i^{log_{k_{1}}(k_{2})}.

We end the section by considering another example of a transducer integer sequence (related to the transducer A_{L}).

Let N_{2} be the set of all non-negative integers whose base 3 representation does not use the digit 2 (they are listed in sequence \underline{A005836}). Define a sequence \{ℓ_{n}\}_{n=0}^{∞}, called L-sequence (see sequence \underline{A060374}), by

ℓ_{n} = ℓ_{n}^{−} + ℓ_{n}^{+}

where ℓ_{n}^{−} and ℓ_{n}^{+} are the unique non-negative integers such that ℓ_{n}^{−}, ℓ_{n}^{+}, ℓ_{n}^{−} + ℓ_{n}^{+} ∈ N_{2} and n = ℓ_{n}^{+}−ℓ_{n}^{−} (the L^{−}-sequence \{ℓ_{n}^{−}\}_{n=0}^{∞} is the sequence \underline{A060373} and the L^{+}-sequence \{ℓ_{n}^{+}\}_{n=0}^{∞} is the sequence \underline{A060372})

Theorem 3.2. The L-sequence is a ternary transducer integer sequence. It is generated by the transducer A_{L} with initial state α.

Proof. In fact, we will prove that in addition to the L-sequence, both the L^{−}-sequence and the L^{+}-sequence are ternary transducer sequences, and they are generated by the transducers A_{L^{−}} and A_{L^{+}} in Figure 7 (in both cases with initial state α). Define the sequences {r_{n}^{−}}_{n=0}^{∞},

[figure: 2/1; 0/0; 1/0; α; 0/0; 1/1; 2/0; β; A_{L^{−}}; 2/0; 0/0; 1/1; α; 0/1; 1/0; 2/0; β; A_{L^{+}}]

Figure 7: Ternary transducers A_{L^{−}} and A_{L^{+}}

{r_{n}^{+}}_{n=0}^{∞}, and {r_{n}}_{n=0}^{∞} to be the integer sequences defined by the transducers A_{L^{−}}, A_{L^{+}}, and in A_{L}, respectively.

Observe that all three transducers have the same transition function (they only differ in the output function). The following table contains the information on all three transducers

α  β
input  0 1 2 0 1 2 n
A_{L^{−}} 0 0 1 0 1 0 r_{n}^{−}
output A_{L^{+}} 0 1 0 1 0 0 r_{n}^{+}
A_{L} 0 1 1 1 1 0 r_{n}
transition  α α β α β β

For example, the middle column under α, indicates that when each of the transducers is in state α and the input digit in n is 1 then the output digit in A_{L^{−}}, A_{L^{+}}, and A_{L} (and therefore the corresponding digit in r_{n}^{−}, r_{n}^{+}, and r_{n}) is 0, 1, and 1, respectively, and each of the transducers stays in the state α.

Since all three transducers use only the digits 0 and 1 in the output, it is clear that r_{n}^{−}, r_{n}^{+}, r_{n} ∈ N_{2}, for all n ≥ 0.

Further, it is easy to see that r_{n} = r_{n}^{−} + r_{n}^{+}, for all n ≥ 0. Indeed, by checking the entries in the above table, we see that each output digit in the row corresponding to r_{n} is exactly the sum of the two output digits in the rows corresponding to r_{n}^{−} and r_{n}^{+} (there is never a carryover in the calculation r_{n}^{−} + r_{n}^{+} = r_{n}).

Next, we see that n + r_{n}^{−} = r_{n}^{+}, for all n ≥ 0. Note that the state α corresponds to the case when there is no carryover and the state β corresponds to the case when there is a carryover of 1 for the next digit. For instance, when the transducers are in state α and the input digit is 2, then the output digit in r_{n}^{−} is 1, the output digit in r_{n}^{+} is 0 and the transition entry indicates that all three transducers move to the carryover state β (note that 2 + 1 = 3). When the transducers are in the carryover state β and the input digit is 0, then the output digit in r_{n}^{−} is 0, the output digit in r_{n}^{+} is 1, and all three transducers move back to the state α (note that 0 + 0 + 1 = 1; the last 1 in this sum comes from the carryover). The other 4 cases in the table are just as easy to verify.

Thus the sequences defined by the transducers A_{L^{−}}, A_{L^{+}}, and A_{L} satisfy the requirements in the definition of L^{−}-sequence, L^{+}-sequence, and L-sequence, respectively. Let us prove a triple of sequences that satisfies these requirements is unique.

By way of contradiction, assume that two distinct triples of sequences {h_{n}^{−}}_{n=0}^{∞}, {h_{n}^{+}}_{n=0}^{∞}, and {h_{n}}_{n=0}^{∞}, as well as {s_{n}^{−}}_{n=0}^{∞}, {s_{n}^{+}}_{n=0}^{∞}, and {s_{n}}_{n=0}^{∞} satisfy the definition. Consider some n at which these two triples of sequences differ from each other.

Without loss of generality, assume that s_{n}^{−} = h_{n}^{−} + m, for some non-negative integer m. Then s_{n}^{+} = n + s_{n}^{−} = n + h_{n}^{−} + m = h_{n}^{+} + m and s_{n} = s_{n}^{−} + s_{n}^{+} = h_{n}^{−} + h_{n}^{+} + 2m = h_{n} + 2m. Since the triples differ, m must be positive.

Note that there is no carryover in the ternary representation of the additions h_{n} = h_{n}^{−}+h_{n}^{+} and s_{n} = s_{n}^{−} + s_{n}^{+} (only the digits 0 and 1 are used). This means that the only possible pairs of digits appearing in the same position in the ternary representations of h_{n}^{−} and h_{n}^{+} (as well as s_{n}^{−} and s_{n}^{+}) are (0, 0), (0,1), and (1, 0). Indeed, if the pair (1, 1) appeared, then the digit 2 = 1 + 1 would appear in the ternary representation of the sum h_{n} = h_{n}^{−} + h_{n}^{+}.

Let the least significant nonzero digit of m appear in position i and denote this digit by x. The following table describes all possible pairs of digits in position i for h_{n}^{−} and h_{n}^{+} as well as the corresponding pair of digits for s_{n}^{−} and s_{n}^{+}, depending on whether x = 1 or x = 2:

x = 1 x = 2
(h_{n}^{−}, h_{n}^{+}) (s_{n}^{−}, s_{n}^{+}) (s_{n}^{−}, s_{n}^{+})
(0, 0)  (1, 1) (2, 2)
(0, 1)  (1, 2) (2, 0)
(1, 0)  (2, 1) (0, 2)

We see that in each case, either the digit 2 appears in one of the ternary representations of s_{n}^{−} and s_{n}^{+} or the pair of digits (1, 1) appears in the same position in s_{n}^{−} and s_{n}^{+}, none of which is allowed.

Thus we have a contradiction and there is only one triple of integer sequences satisfying the definition of L^{−}-sequence, L^{+}-sequence and L-sequence, which then must be the triple {r_{n}^{−}}_{n=0}^{∞}, {r_{n}^{+}}_{n=0}^{∞}, and {r_{n}}_{n=0}^{∞} defined by the transducers A_{L^{−}}, A_{L^{+}}, and A_{L}, respectively.

Let {p_{n}}_{n=0}^{∞} be the sequence defined by

p_{0} = 0, p_{n} = ∑_{i=0}^{n−1} w_{i}a_{i}, for n ≥ 1

where the sequence {w_{n}}_{n=0}^{∞} providing the signs is the cube-free sequence generated by the automaton A_{0−2} and {a_{n}}_{n=0}^{∞} is the transducer integer sequence generated by A_{T}.

Proposition 3.3. The sequence {p_{n}} is equal to the L-sequence.

Proof. We have p_{0} = 0 = ℓ_{0} and, for n a positive integer and w a word over X_{3},

α(0w + 1) = α(1w) = 1α(w) = 0α(w) + 1 = α(0w) + 1,
α(1^{n}0w + 1) = α(21^{n−1}0w) = 11^{n−1}1α(w) = 1^{n}0α(w) + 3^{n} = α(1^{n}0w) + 3^{n},
α(1^{n}2w + 1) = α(21^{n−1}2w) = 11^{n−1}0β(w) = 1^{n}1β(w) − 3^{n} = α(1^{n}2w) − 3^{n},
α(2^{n}0w + 1) = α(0^{n}1w) = 0^{n}1α(w) = 10^{n−1}1α(w) − 1 = α(2^{n}0w) − 1,
α(2^{n}1w + 1) = α(0^{n}2w) = 0^{n}1β(w) = 10^{n−1}1α(w) − 1 = α(2^{n}1w) − 1.

In each case the change in the value of α(i) is exactly w_{i}a_{i}, i.e., for all i,

ℓ_{i+1} = α(i + 1) = α(i) + w_{i}a_{i} = ℓ_{i} + w_{i}a_{i}

and therefore the sequence of partial sums {p_{n}} is exactly the L-sequence.

The sequence {ℓ_{n}}_{n=0}^{∞} can also be described as a fixed point of an endomorphism over the alphabet consisting of the elements of N_{2}. The iterations start at 0 and the endomorphism is given by

0 ↦ 0, 1 x ↦ 3x + 1, 3x, 3x + 1, for x ≥ 1.

4 Relation to the Tower of Hanoi problem

In this section we exhibit a connection between the Tower of Hanoi problem, the automatic cube-free sequence {w_{n}} and the transducer integer sequence {a_{n}}.

Define a matrix K_{n} of size 3^{n} × n, n ≥ 1, with entries in X_{3} by

K_{1} = [\begin{matrix}0 \\ 1 \\ 2 \end{matrix}] , K_{n+1} = [\begin{matrix}K_{n} & 0_{n} \\ K_{n}^{R} & 1_{n} \\ K_{n} & 2_{n} \end{matrix}] ,

where the matrix K_{n}^{R} is obtained from the matrix K_{n} by flipping K_{n} along the horizontal axis, and 0_{n}, 1_{n} and 2_{n} are column vectors with 3^{n} entries equal to 0, 1 and 2, respectively. Denote the infinite limit matrix lim_{n→∞}K_{n} by K.

For example, the transpose of K_{3} is given by

K_{3}^{T} = [\begin{matrix}012 & 210 & 012 & 210 & 012 & 210 & 012 & 210 & 012 \\ 000 & 111 & 222 & 222 & 111 & 000 & 000 & 111 & 222 \\ 000 & 000 & 000 & 111 & 111 & 111 & 222 & 222 & 222 \end{matrix}]

The limiting matrix K is well defined due to the fact that K_{n} appears as the upper left corner in K_{n+1}. By definition, the indexing of the rows of K starts with 0 while the indexing of the columns starts with 1. For future use, denote the i-th row of K by k_{i}. We will think of k_{i} as of a right infinite word over X_{3}. Similarly, denote the i-th row of the matrix K_{n} by k_{i}^{(n)}. We will think of k_{i}^{(n)} as a word of length n over X_{3}. Note that, for i ∈ {0, …, 3^{n} − 1}, k_{i} = k_{i}^{(n)}0^{∞}, k_{i+2·3^{n}} = k_{i}^{(n)}20^{∞}, and k_{i+3^{n}} = k_{3^{n}−1−i}^{(n)}10^{∞}

A sequence w_{0}, …, w_{k^{n}−1} of words of length n over X_{k} is a k-ary Gray code of length n if all words of length n over X_{k} appear exactly once in the sequence and any two consecutive words differ in exactly one position. Note that the 3^{n} rows of the matrix K_{n} represent a ternary Gray code of length n.

By interpreting the rows of K as ternary representations of integers, we obtain the sequence

0, 1, 2, 5, 4, 3, 6, 7, 8, 17, 16, 15, 12, 13, 14, 11, 10, 9, …,

which is not included in The On-Line Encyclopedia of Integer Sequences (as of December 2006).

We observe that the successive rows in K are obtained from each other by applying the ternary tree automorphism a at odd steps and c at even steps (the automorphisms a and c are defined by A_{H} - the transducer generating the Tower of Hanoigroup).

Proposition 4.1. For j ≥ 0, define t_{2j} = (ca)^{j} and t_{2j+1} = a(ca)^{j}. Then

k_{i} = t_{i}(k_{0}).

Proof. Recall that the result of the action of the rational ternary tree automorphism a on any ternary word w is that the first occurrence of a letter from {0, 1} in w, if such an occurrence exists, is replaced by the other letter from that set, while the result of the action of c is that the first occurrence of a letter from {1, 2} in w, if such an occurrence exists, is replaced by the other letter from that set. As already observed, this implies that both a and c have order 2. Also, note that a and c change at most one letter in any word.

We will prove by induction on n that k_{i} = t_{i}(k_{0}), for 0 ≤ i ≤ 3^{n} − 1.

Since a(0^{∞}) = 10^{∞} and c(10^{∞}) = 20^{∞}, the claim is true for i ≤ 2.

Assume that the claim is true for all i ≤ 3^{n} − 1, for some n ≥ 1.

Since the last row in K_{n} is 2^{n}, we see that k_{3^{n}−1} = 2^{n}0^{∞}. This row is obtained from the previous row by applying c in step 3^{n} − 1. In the next step applying a to 2^{n}0^{∞} produces 2^{n}10^{∞}, which is equal to k_{3^{n}}. We wish to understand the next 3^{n} − 1 steps, starting at the word 2^{n}10^{∞}, in which c and a are applied alternately. By inductive assumption, starting at 0^{∞}, alternate applications of a and c (3^{n} − 1 total) change the word in the first n positions from 0^{n} to 2^{n} by going through the 3^{n} words in the rows of K_{n}. Since both c and a are self-inverse, starting at 2^{n}10∞, alternate applications of c and a (3^{n} − 1 total) backtrack the word in the first n positions from 2^{n} back to 0^{n} by going through the 3^{n} words in the rows of K_{n}^{R}. Moreover, during this backtracking, no part of the word beyond the position n is affected. This is simply because neither c nor a change more than 1 letter in any word. Thus, starting from 0^{∞}, alternate applications of a and c (3^{n} − 1 + 1 + 3^{n} − 1 = 2 · 3^{n} − 1 total) produce the first 2 · 3^{n} rows of K. The last taken step is a and therefore, in the next step, c takes 0^{n}10^{∞} to 0^{n}20^{∞}. Alternate applications of a and c then again change the word in the first n positions from 0^{n} to 2^{n} in 3^{n} − 1 steps by going through the 3^{n} words in the rows of K_{n} without affecting any letter beyond position n and eventually producing 2^{n+1}0^{∞} in 2 · 3^{n} − 1 + 1 + 3^{n} − 1 = 3^{n+1} − 1 steps.

It is clear that the rows of K constitute the whole cofinal class of 0^{∞}. Thus the subgroup ⟨a, c⟩ acts transitively on this class. Since the order of both a and c is 2 this means that ⟨a, c⟩ is the infinite dihedral group D_{∞}. The transitivity of the action of ⟨a, c⟩ on the cofinal class of 0^{∞} is equivalent to the known fact that any valid n disk configuration can be obtained from any other in a restricted version of Tower of Hanoi problem in which no disk can move between pegs 0 and 2 (in our terminology, applications of the automorphism b are not allowed). Figure 8 shows the path taken by (ca)^{13} from 000 to 222 in Γ_{3}.

[figure: 111; 011; a; 211; c; 021; c; 201; a; 221; c; 121; a; 101; a; c; 001; 220; a; 002; c; 120; a; c; 020; 202; c; 102; a; 100; a; c; 010; a; c; 212; c; a; 122; a; c; 000; 200; a; 210; c; 110; 112; a; 012; c; 022; 222]

Figure 8: The ternary Gray code path generated by a and c in H^{(3)} at level 3

Order all configurations (words in the cofinal class of 0^{∞}) according to their position in the matrix K (small configurations correspond to rows with small index). When b is applied to any configuration k_{i} the obtained configuration b(k_{i}) is either larger or smaller than k_{i}. Based on this alternative define an infinite sequence {d_{i}}_{i=0}^{∞} over X = {1, −1} by

d_{i} = \begin{cases}1, & if b(k_{i}) > k_{i} \\ −1, & if b(k_{i}) < k_{i} \end{cases} .

Call this sequence the b-direction sequence. Further, define an integer sequence {b̂_{i}}_{i=0}^{∞} by b̂_{i} = |i − j|/2, where j is the index of the configuration k_{j} = b(k_{i}). Call this sequence the b-change sequence.

Theorem 4.2. The b-direction sequence is exactly the cube-free automatic sequence {w_{n}} generated by A_{0−2} and the b-change sequence is exactly the transducer integer sequence {a_{n}} generated by A_{T}.

Proof. The proof is by induction on blocks of size 3^{n}.

For n = 1, the b-change sequence is 1, 3, 1 which coincides with the transducer integer sequence generated by A_{T}, while the b-direction sequence is 1, 1, −1, which coincides with the cube-free automatic sequence generated by A_{0−2}.

Assume that the b-change sequence {b̂_{i}} and the transducer integer sequence {a_{i}} defined by A_{T} agree up to index 3^{n} − 1, and that the b-direction sequence {d_{i}} and the automatic sequence {w_{i}} defined by A_{0−2} agree up to index 3^{n} − 1, for some n ≥ 1.

Note that this implies that for i ∈ {0, …, 3^{n} − 1}, i ≠ (3^{n} − 1)/2,

b̂_{i} = b̂_{3^{n}−1−i} and d_{i} = −d_{3^{n}−1−i}.

This is true simply because both claims are true for the transducer integer sequence {a_{i}} and the automatic sequence {w_{i}}. Also, note that for the middle term in this block we have

b̂_{(3^{n}−1)/2} = 3^{n} and d_{(3^{n}−1)/2} = 1.

Let i ∈ {0, …, 3^{n}−1}, i ≠ (3^{n}−1)/2. Note that the exception i ≠ (3^{n}−1)/2 corresponds to k_{i}^{(n)} = 1^{n} (the middle row of K_{n} consists entirely of 1’s). Since either 0 or 2 appears in k_{i}^{(n)} we know that the tree automorphism b acts on any ternary word that has k_{i}^{(n)} as a prefix by simply replacing the first occurrence of 0 or 2 in k_{i}^{(n)} by the other letter and leaving everything else unchanged. Therefore,

b(k_{i+2·3^{n}}) = b (k_{i}^{(n)}20^{∞}) = k_{i+d_{i}b̂_{i}}^{(n)}20^{∞} = k_{i+d_{i}b̂_{i}+2·3^{n}}.

This implies that

b̂_{i+2·3^{n}} = b̂_{i} and d_{i+2·3^{n}} = d_{i}.

Similarly,

b(k_{i+3^{n}}) = b (k_{3^{n}−1−i}^{(n)}10^{∞}) = k_{3^{n}−1−i+d_{3^{n}−1−i}b̂_{3^{n}−1−i}}^{(n)}10^{∞} = k_{3^{n}−1−i−d_{i}b̂_{i}}^{(n)}10^{∞} = k_{i+d_{i}b̂_{i}+3^{n}},

and this implies that

b̂_{i+3^{n}} = b̂_{i} and d_{i+3^{n}} = d_{i}.

We now handle the exceptional terms (those are the “middle” terms, i.e., the terms corresponding to the indices (3^{n} − 1)/2 + 3^{n} and (3^{n} − 1)/2 + 2 · 3^{n}).

Since

b(k_{(3^{n}−1)/2+2·3^{n}}) = b(1^{n}20^{∞}) = b(1^{n}00^{∞}) = k_{(3^{n}−1)/2}

we see that

b̂_{(3^{n}−1)/2+2·3^{n}} = 3^{n} = b̂_{(3^{n}−1)/2} and d_{(3^{n}−1)/2+2·3^{n}} = −1 = −d_{(3^{n}−1)/2}.

Further,

b(k_{(3^{n}−1)/2+3^{n}}) = b(1^{n}10^{∞}) = 1^{n+1}20^{∞} = k_{(3^{n+1}−1)/2+2·3^{n+1}},

and therefore

b̂_{(3^{n}−1)/2+3^{n}} = 3^{n+1} = 3 · b̂_{(3^{n}−1)/2} and d_{(3^{n}−1)/2+3^{n}} = 1 = d_{(3^{n}−1)/2}.

Thus the block of length 3^{n+1} of the b-change sequence is obtained by repeating the block of length 3^{n} three times and then changing the middle term by multiplying it by 3. This is exactly how the block of length 3^{n+1} of the sequence {a_{n}} is obtained from the block of length 3^{n}. Similarly, the block of length 3^{n+1} of the b-direction sequence is obtained by repeating the block of length 3^{n} three times and then changing the middle term in the third sub-block of length 3^{n} from 1 to -1. This is exactly how the block of length 3^{n+1} of the sequence {w_{n}} is obtained from the block of length 3^{n}.

This completes our induction step.

5 Geodesic configurations in the Tower of Hanoi problem

Define a matrix M_{n} of size 2^{n} × n, n ≥ 1, with entries in X_{2} by

M_{1} = [\begin{matrix}0 \\ 1 \end{matrix}] , M_{n+1} = [\begin{matrix}M_{n} & 0_{n} \\ M_{n}^{R} & 1_{n} \end{matrix}] ,

where the matrix M_{n}^{R} is obtained from the matrix M_{n} by flipping M_{n} along the horizontal axis, and 0_{n} and 1_{n} are column vectors with 2^{n} entries equal to 0 and 1, respectively. The 2^{n} rows of the matrix M_{n} represent a binary Gray code of length n. Denote the infinite limit matrix lim_{n→∞}M_{n} by M. For future use, denote the i-th row of M by m_{i} and the i-th row of

the matrix M_{n} by m_{i}^{(n)}. We will think of m_{i} as an infinite word and of m_{i}^{(n)} as a word of length n over X_{2}. Note that, for i ∈ {0, …, 2^{n} − 1}, m_{i} = m_{i}^{(n)}0^{∞}, m_{i+2^{n}} = m_{2^{n}−1−i}^{(n)}10^{∞}.

We observe that the successive rows in M are obtained from each other by applying the binary tree automorphism f at odd steps and the automorphism g at even steps, where f and g are given by the invertible transducer A_{D} given in Figure 9. The self-similar group G(A_{D}) defined by A_{D} and generated by f and g is the infinite dihedral group D_{∞}.

[figure: A_{D} :; (); 0,1; id; (01); 0; 1; f; (); 1; 0; g; A_{L_{2}} :; (); 0; 1; λ_{0}; (01); 1; 0; λ_{1}]

Figure 9: Two binary invertible transducers: A_{D} and A_{L_{2}}

Proposition 5.1. For j ≥ 0, define s_{2j} = (gf)^{j} and s_{2j+1} = f(gf)^{j}. Then

m_{i} = s_{i}(m_{0}).

Note that the previous result is just a binary analogue of Proposition 4.1 and can also be proved by a simple inductive argument.

Consider now the transducer in the right half of Figure 6. It is known [17] (see also [23, 6]) that the group G(A_{L_{2}}) is the lamplighter group L_{2} which is the wreath product of the cyclic group of order 2 (representing a switch) and the infinite cyclic group (representing moves between consecutive lamps). The realization of the lamplighter group L_{2} by the transducer A_{L_{2}} was used by Grigorchuk and Żuk [17] to calculate the spectrum of the Markov operator on the Cayley graph of L_{2}, which then lead to the solution of Strong Atiyah Conjecture in [15].

For i ≥ 0, denote by ⟨i⟩_{2}^{(n)} the length n binary representative (including leading zeros if necessary) in which the most significant digits are written first. Define, for i ∈ {0, …, 2^{n}−1}, \overline{m}_{i}^{(n)} to be the reversal of the word m_{i}^{(n)} (more generally, denote by \overline{w} the reversal of any word w).

Proposition 5.2. For i = 0, …, 2^{n} − 1,

λ_{0} (⟨i⟩_{2}^{(n)}) = \overline{m}_{i}^{(n)}.

Proof. We prove, by induction on n, that

λ_{0} (⟨i⟩_{2}^{(n)}) = \overline{m}_{i}^{(n)} and λ_{1} (⟨i⟩_{2}^{(n)}) = \overline{m}_{2^{n}−1−i}^{(n)},

for 0 ≤ i ≤ 2^{n} − 1.

The claim is correct for n = 1, since λ_{0}(0) = 0 = \overline{m}_{0}^{(1)}, λ_{0}(1) = 1 = \overline{m}_{1}^{(1)}, λ_{1}(0) = 1 = \overline{m}_{1}^{(1)}, and λ_{1}(1) = 0 = \overline{m}_{0}^{(1)}.

Assume that the claim is correct for some n ≥ 1.

Then, for 0 ≤ i ≤ 2^{n} − 1,

λ_{0} (⟨i⟩_{2}^{(n+1)}) = λ_{0} (0⟨i⟩_{2}^{(n)}) = 0λ_{0} (⟨i⟩_{2}^{(n)}) = 0\overline{m}_{i}^{(n)} = \overline{m_{i}^{(n)}0} = \overline{m}_{i}^{(n+1)},
λ_{1} (⟨i⟩_{2}^{(n+1)}) = λ_{1} (0⟨i⟩_{2}^{(n)}) = 1λ_{0} (⟨i⟩_{2}^{(n)}) = 1\overline{m}_{i}^{(n)} = \overline{m_{i}^{(n)}1} = \overline{m}_{2^{n+1}−1−i}^{(n+1)},

while for 2^{n} ≤ i ≤ 2^{n+1} − 1,

λ_{0} (⟨i⟩_{2}^{(n+1)}) = λ_{0} (1⟨i − 2^{n}⟩_{2}^{(n)}) = 1λ_{1} (⟨i − 2^{n}⟩_{2}^{(n)}) =
= 1\overline{m}_{2^{n+1}−1−i}^{(n)} = \overline{m_{2^{n+1}−1−i}^{(n)}1} = \overline{m}_{i}^{(n+1)},
λ_{1} (⟨i⟩_{2}^{(n+1)}) = λ_{1} (1⟨i − 2^{n}⟩_{2}^{(n)}) = 0λ_{1} (⟨i − 2^{n}⟩_{2}^{(n)}) =
= 0\overline{m}_{2^{n+1}−1−i}^{(n)} = \overline{m_{2^{n+1}−1−i}^{(n)}0} = \overline{m}_{2^{n+1}−1−i}^{(n+1)}.

We can define a variation on the notion of transducer integer sequences as sequences that can be obtained from transducers by reading the input starting from the most significant digit (and interpreting the output as starting from the most significant digit). Call these sequences SF transducer integer sequences (for significant first). Since the sequence of binary Gray code words can be obtained by feeding the binary representations of integers, most significant digit first, into A_{L_{2}} starting at λ_{0}, we see that the sequence \underline{A003188} of integers

0, 1, 3, 2, 6, 7, 5, 4, …

represented by the binary Gray code words is a SF binary transducer integer sequence.

We offer two 2 to 3 transducers each of which generates all the configurations on the three geodesic paths between the three regular configurations 0^{n}, 1^{n} and 2^{n} in the Schreier graph Γ_{n} modeling the Tower of Hanoi problem on 3 pegs and n disks (a geodesic path between two vertices is a path of shortest possible length connecting the vertices). Call such configurations geodesic configurations. The first transducer (see Theorem 5.3) uses the natural order, while the second one (see Theorem 5.4) uses the order implied by the binary Gray code.

Theorem 5.3. The 2 to 3 transducer O_{H} in Figure 10 generates the geodesic configurations in the Tower of Hanoi problem. More precisely, for x, y ∈ {0, 1, 2}, x ≠ y, starting at state q_{xy}, and feeding the length n binary representative ⟨i⟩_{2}^{(n)} of i (including leading 0’s if needed) into O_{H} produces the reverse of the length n ternary word representing the unique n disk configuration at distance i along the geodesic from x^{n} to y^{n} in the n-th level Schreier graph Γ_{n} of Tower of Hanoi group H^{(3)}.

[figure: O_{H} :; 0/0; q_{01}; 1/1; 1/2; q_{02}; 0/0; 1/1; q_{21}; 0/2; 0/1; q_{12}; 1/2; 0/2; q_{20}; 1/0; 1/0; q_{10}; 0/1]

Figure 10: A 2 to 3 transducer generating geodesic configurations

Proof. For any permutation x, y, z of the three letters in X_{3} the states of the transducer O_{H} have (as tree morphisms) the decomposition

q_{xy} = π_{xy}(q_{xz}, q_{zy}),

where π_{xy} : X_{2} → X_{3} is the map defined by π_{xy}(0) = x and π_{xy}(1) = y.

It is well known that the unique way to solve the Tower of Hanoi problem in which n, n ≥ 1, disks are moved from peg x to peg y in 2^{n} − 1 steps can be recursively described as follows. First, in 2^{n−1} − 1 steps move the top n − 1 disks from peg x to peg z (the third available peg). Then, in step number 2^{n−1}, move the largest disk from peg x to peg y. Then, in 2^{n−1} −1 steps, move the n−1 smallest disks from peg z to peg y. Observe that the largest disk is moved only once, in the middle step (step number 2^{n−1}).

Employing the encoding of configurations by words over X_{3}, we see that the unique geodesic path of length 2^{n} − 1 from x^{n} to y^{n} connects x^{n} to z^{n−1}x in the first 2^{n−1} − 1 steps, then in the next step it connects z^{n−1}x to z^{n−1}y, and in the last 2^{n−1} − 1 steps it connects z^{n−1}y to y^{n}.

Since the largest disk is moved only once, the last digit in the configurations on the geodesic from x^{n} to y^{n} is equal to x in the first 2^{n−1} configurations along the way, and it is equal to y in the last 2^{n−1} configurations.

Thus, if we denote by ξ_{xy}^{(n)}(i) the reversal of the word over X_{3} representing the vertex at distance i from x^{n} along the geodesic between x^{n} and y^{n} in Γ_{n}, we have, for n ≥ 2,

ξ_{xy}^{(n)}(i) = \begin{cases}xξ_{xz}^{(n−1)}(i), & 0 ≤ i ≤ 2^{n−1} − 1 \\ yξ_{zy}^{(n−1)}(i − 2^{n−1}), & 2^{n−1} ≤ i ≤ 2^{n} − 1 \end{cases} .

We can now easily prove that

q_{xy} (⟨i⟩_{2}^{(n)}) = ξ_{xy}^{(n)}(i),

by using induction on n.

Since q_{xy}(0) = π_{xy}(0) = x = ξ_{xy}^{(1)}(0) and q_{xy}(1) = π_{xy}(1) = y = ξ_{xy}^{(1)}(1), the claim is true for n = 1.

Assume that the claim is true for all integers smaller than some n, n ≥ 2.

Then, for 0 ≤ i ≤ 2^{n−1} − 1,

q_{xy} (⟨i⟩_{2}^{(n)}) = q_{xy} (0⟨i⟩_{2}^{(n−1)}) = π_{xy}(0)q_{xz} (⟨i⟩_{2}^{(n−1)}) = xξ_{xz}^{(n−1)}(i) = ξ_{xy}^{(n)}(i)

and, for 0 ≤ i ≤ 2^{n−1} − 1,

q_{xy} (⟨i⟩_{2}^{(n)}) = q_{xy} (1⟨i − 2^{n−1}⟩_{2}^{(n−1)}) =

= π_{xy}(1)q_{zy} (⟨i − 2^{n−1}⟩_{2}^{(n−1)}) = yξ_{zy}^{(n−1)}(i − 2^{n−1}) = ξ_{xy}^{(n)}(i).

Theorem 5.4. The 2 to 3 transducer O′_{H} in Figure 11 generates the geodesic configurations in the Tower of Hanoi problem. More precisely, for x, y ∈ {0, 1, 2}, x ≠ y, starting at state t_{xy}, and feeding the reversal \overline{m}_{i}^{(n)} of the length n row i binary Gray code word from M_{n} into O′_{H} produces the reverse of the length n ternary word representing the unique n disk configuration at distance i along the geodesic from x^{n} to y^{n} in the n-th level Schreier graph Γ_{n} of the Tower of Hanoi group H^{(3)}.

Proof. Observe that, for any permutation x, y, z of the three letters in X_{3} the states of the transducer O′_{H} have (as tree morphisms) the decomposition

t_{xy} = π_{xy}(t_{xz}, t_{yz}),

where π_{xy} : X_{2} → X_{3} is the map defined by π_{xy}(0) = x and π_{xy}(1) = y.

[figure: O′_{H} :; 1/1; 0/0; t_{01}; 1/2; 0/1; t_{12}; 1/0; 0/2; t_{20}; 1/2; 0/0; t_{02}; 1/0; 0/1; t_{10}; 1/1; 0/2; t_{21}]

Figure 11: A 2 to 3 transducer generating geodesic configurations

If we preserve the notation from the proof of Theorem 5.3, we have, for n ≥ 2,

ξ_{xy}^{(n)}(i) = \begin{cases}xξ_{xz}^{(n−1)}(i), & 0 ≤ i ≤ 2^{n−1} − 1 \\ yξ_{yz}^{(n−1)}(2^{n} − 1 − i), & 2^{n−1} ≤ i ≤ 2^{n} − 1 \end{cases} .

The reason that this formula is correct for 2^{n−1} ≤ i ≤ 2^{n} − 1 is simply that vertices that are distance i from x^{n} along the geodesic between x^{n} and y^{n} are distance 2^{n} − 1 − i from y^{n}.

One can then use induction on n just as in the proof of Theorem 5.3. The only small difference is in the inductive step for 0 ≤ i ≤ 2^{n−1} − 1, which now reads

t_{xy} (\overline{m}_{i}^{(n)}) = t_{xy} (\overline{m_{2^{n−1}−1−i}^{(n−1)}1}) = t_{xy} (1\overline{m}_{2^{n−1}−1−i}^{(n−1)}) =

= π_{xy}(1)t_{yz} (\overline{m}_{2^{n−1}−1−i}^{(n−1)}) = yξ_{yz}^{(n−1)}(2^{n−1} − 1 − i) = ξ_{xy}^{(n)}(i).

Observe that the X_{2}^{∗} → X_{3}^{∗} tree morphism defined by the state q_{xy} in the transducer O_{H} is just the composition of the binary tree automorphism X_{2}^{∗} → X_{2}^{∗} defined by the state λ_{0} with the X_{2}^{∗} → X_{3}^{∗} tree morphism defined by the state t_{xy} in the transducer O′_{H} (recall that λ_{0} translates from reversals of binary representations to reversals of Gray code words and the state t_{xy} in O′_{H} translates from reversals of Gray code words to reversals of geodesic configurations between x^{n} and y^{n}). This observation could be used to prove only one of the two theorems above and then claim the result in the other as a simple corollary.

The transducer O_{H}, started at q_{01}, generates the sequence \underline{A055661}

0, 1, 7, 8, 17, 15, 12, 13, …,

but only when all input words are adjusted by leading zeros to have odd length, and it gives the sequence

0, 2, 5, 4, 22, 21, 24, 26, …,

which does not appear in The On-Line Encyclopedia of Integer Sequences (as of December 2006), when the input words are adjusted to have even length. In fact, the former sequence records the integers whose ternary representations give the configurations in the Tower of Hanoi problem on the geodesic line in the infinite Schreier graph Γ_{0^{∞}} (recall the definition of the limiting graph Γ_{0^{∞}} in Section 2) determined by applying repeatedly the automorphisms a, b and c (in that order) and the latter records the integers whose ternary representations give the configurations on the geodesic line in Γ_{0^{∞}} determined by applying repeatedly the automorphisms b, a and c (in that order). There is nothing strange in this split, since it is known that the optimal solution transferring disks from peg 0 to peg 1 follows different paths depending on the parity of the number of disks. Namely, for odd number of disks, the optimal way to transfer the disks from peg 0 to peg 1 is to apply repeatedly the ternary tree automorphisms a, b and c (in that order), and for even number of disks, the optimal way is to apply repeatedly the ternary tree automorphisms b, a and c (in that order).

By flipping the input and the output symbol in the transducers O_{H} and O′_{H} we obtain the partial inverse transducers O_{H}^{−1} and O_{H}^{′−1} that can be used to recognize the geodesic configurations in the Tower of Hanoi problem and encode them either by using binary representations or by Gray code words.

Corollary 5.5. The 3 to 2 transducer O_{H}^{−1} in Figure 12 obtained by inversion from the 2 to 3 transducer O_{H}, recognizes the geodesic configurations in the Tower of Hanoi problem. More precisely, starting at the inverse state q_{xy}^{−1}, x, y ∈ X_{3}, x ≠ y, and feeding ternary words of length n into the inverse transducer O_{H}^{′−1}, only reversals of ternary words representing the configurations on the geodesic from x^{n} to y^{n} in Γ_{n} are read entirely by the transducer and, for such configurations, the output represents reversals of the binary representation of the distance to x^{n}.

Corollary 5.6. The 3 to 2 transducer O_{H}^{′−1} obtained by inversion from the 2 to 3 transducer O′_{H}, recognizes the geodesic configurations in the Tower of Hanoi problem. More precisely, starting at the inverse state t_{xy}^{−1}, x, y ∈ X_{3}, x ≠ y, and feeding ternary words of length n into the inverse transducer O_{H}^{−1}, only reversals of ternary words representing configurations on the geodesic from x^{n} to y^{n} in Γ_{n} are read entirely by the transducer and, for such configurations, the reversal of the corresponding binary Gray code word of length n is produced in the output.

For example, the configuration 10021 is not a geodesic configuration between 00000 and 11111. This follows from the fact that the reversal word 12001 is not accepted by O_{H}^{−1} starting from the state q_{01}^{−1} (the reading stops in state q_{20}^{−1} after reading the first 4 symbols and the transducer cannot read the last symbol).

On the other hand, starting from the state q_{01}^{−1} the word 12002 is read completely and it produces the output 10110, which says that the configuration 20021 is on the geodesic between 00000 and 11111 and its distance to 00000 is 2^{4} + 2^{2} + 2^{1} = 22. If we read 12002 starting from state q_{10}^{−1} we obtain the output 01001, which confirms that the configuration 20021 is on the geodesic between 11111 and 00000 and that its distance to 11111 is 2^{3}+2^{0} = 9 (note that 22 + 9 = 31 = 2^{5} − 1, which is the distance between 00000 and 11111).

6 Acknowledgements

I would like to thank the referee for the extremely careful reading of the manuscript and her/his numerous helpful remarks.

[figure: O_{H}^{−1} :; 0/0; q_{01}^{−1}; 1/1; 2/1; q_{02}^{−1}; 0/0; 1/1; q_{21}^{−1}; 2/0; 1/0; q_{12}^{−1}; 2/1; 2/0; q_{20}^{−1}; 0/1; 0/1; q_{10}^{−1}; 1/0]

Figure 12: A 3 to 2 transducer recognizing geodesic configurations

References

[1] J.-P. Allouche, J. Bétréma, and J. O. Shallit, Sur des points fixes de morphismes d’un monoïde libre, RAIRO Inform. Théor. Appl. 23 (1989), 235–249.

[2] J.-P. Allouche and J. Shallit, Automatic sequences, Cambridge University Press, 2003.

[3] L. Bartholdi, R. Grigorchuk, and V. Nekrashevych, From fractal groups to fractal sets, In Fractals in Graz 2001, Trends Math., Birkhäuser, 2003, pp. 25–118.

[4] L. Bartholdi, R. I. Grigorchuk, and Z. Šuniḱ, Branch groups, In Handbook of algebra Vol. 3, North-Holland, 2003, pp. 989–1112.

[5] L. Bartholdi and V. Nekrashevych, Thurston equivalence of topological polynomials, Acta Math. 197 (2006), 1–51.

[6] L. Bartholdi and Z. Šuniḱ, Some solvable automaton groups, In Topological and asymptotic aspects of group theory, Vol. 394 of Contemp. Math., Amer. Math. Soc., 2006, pp. pp. 11–29.

[7] L. Bartholdi and B. Virág, Amenability via random walks, Duke Math. J. 130 (2005), 39–56.

[8] A. Cobham, Uniform tag sequences, Math. Systems Theory 6 (1972), 164–192.

[9] R. I. Grigorchuk, On Burnside’s problem on periodic groups, Funktsional. Anal. i Prilozhen. 14 (1980), 53–54.

[10] R. I. Grigorchuk, V. V. Nekrashevich, and V. I. Sushchanskiĭ, Automata, dynamical systems, and groups, Tr. Mat. Inst. Steklova 231 (2000), 134–214.

[11] R. Grigorchuk, V. Nekrashevych, and Z. Šunić, Hanoi towers group on 3 pegs and its pro-finite closure, Oberwolfach Reports 25 (2006), 15–17.

[12] R. Grigorchuk, V. Nekrashevych, and Z. Šunić, Hanoi towers groups, Oberwolfach Reports 19 (2006), 11–14.

[13] R. Grigorchuk and Z. Šunić, Self-similarity and branching in group theory. In Groups St. Andrews 2005, I, Vol. 339 of London Math. Soc. Lecture Note Ser., Cambridge Univ. Press, 2007, pp. 36–95.

[14] R. Grigorchuk and Z. Šuniḱ, Asymptotic aspects of Schreier graphs and Hanoi Towers groups, C. R. Math. Acad. Sci. Paris 342, (2006), 545–550.

[15] R. I. Grigorchuk, P. Linnell, T. Schick, and A. Żuk, On a question of Atiyah, C. R. Acad. Sci. Paris Sér. I Math. 331 (2000), 663–668.

[16] R. I. Grigorchuk and A. Żuk, On the asymptotic spectrum of random walks on infinite families of graphs, In Random walks and discrete potential theory (Cortona, 1997), Sympos. Math., 39, Cambridge Univ. Press, 1999, pp. 188–204.

[17] R. I. Grigorchuk and A. Żuk, The lamplighter group as a group generated by a 2-state automaton, and its spectrum, Geom. Dedicata 87 (2001), 209–244.

[18] R. I. Grigorchuk and A. Żuk, On a torsion-free weakly branch group defined by a three state automaton, Internat. J. Algebra Comput. 12 (2002), 223–246.

[19] A. M. Hinz, The Tower of Hanoi, Enseign. Math. (2) 35 (1989), 289–321.

[20] V. Nekrashevych. Self-similar Groups, Vol. 117 of Mathematical Surveys and Monographs. Amer. Math. Soc., 2005.

[21] G. Richomme and F. Wlazinski, Some results on k-power-free morphisms, Theoret. Comput. Sci. 273 (2002), 119–142.

[22] S. Sidki, Automorphisms of one-rooted trees: growth, circuit structure, and acyclicity, J. Math. Sci. (New York) 100 (2000), 1925–1943.

[23] P. V. Silva and B. Steinberg, On a class of automata groups generalizing lamplighter groups, Internat. J. Algebra Comput. 15 (2005), 1213–1234.

[24] N. J. A. Sloane, The on-line encyclopedia of integer sequences.

http://www.research.att.com/~njas/sequences/.

[25] J. S. Wilson, On exponential growth and uniformly exponential growth for groups, Invent. Math. 155 (2004), 287–303.

2000 Mathematics Subject Classification: Primary 11Y55; Secondary 11B85, 20M20, 20M35.

Keywords: transducers, integer sequences, automatic sequences, self-similar groups, selfsimilar semigroups, Tower of Hanoi problem.

(Concerned with sequences \underline{A003188}, \underline{A005836}, \underline{A038500}, \underline{A055661}, \underline{A057427}, \underline{A060236}, \underline{A060372}, \underline{A060373}, \underline{A060374}, and \underline{A080846}.)

Received December 4, 2006; revised version received April 10 2007. Published in Journal of Integer Sequences, April 13 2007.

Return to Journal of Integer Sequences home page.