Next Article in Journal
Approximately Optimal Domain Adaptation with Fisher’s Linear Discriminant
Previous Article in Journal
Statistical Tests for Proportion Difference in One-to-Two Matched Binary Diagnostic Data: Application to Environmental Testing of Salmonella in the United States
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

The Ruler Sequence Revisited: A Dynamic Perspective

by
Juan Carlos Nuño
1,*,† and
Francisco J. Muñoz
2,†
1
Department of Applied Mathematics, Universidad Politécnica de Madrid, 28040 Madrid, Spain
2
Departamento de Matemática Aplicada, Ciencia e Ingeniería de los Materiales y Tecnología Electrónica, ESCET, Universidad Rey Juan Carlos, Móstoles, 28933 Madrid, Spain
*
Author to whom correspondence should be addressed.
These authors contributed equally to this work.
Mathematics 2024, 12(5), 742; https://doi.org/10.3390/math12050742
Submission received: 4 January 2024 / Revised: 25 February 2024 / Accepted: 28 February 2024 / Published: 1 March 2024

Abstract

:
The Ruler function or the Gros sequence is a classical infinite integer sequence that underlies some interesting mathematical problems. In this paper, we provide four new problems containing this type of sequence: (i) demographic discrete dynamical automaton, (ii) the middle interval Cantor set, (iii) construction by duplication of polygons and (iv) the horizontal visibility sequence at the accumulation point of the Feigenbaum cascade. In all of them, the infinite sequence is obtained through a recursive procedure of duplication. The properties of the ruler sequence, in particular, those relating to recursiveness and self-containing, are used to achieve a deeper understanding of these four problems. These new representations of the ruler sequence could inspire new studies in the field of discrete mathematics.
MSC:
00A05; 00A69; 11B99; 11Z99

1. Introduction

The Ruler sequence, also known as the ruler function, is referenced in the OEIS (On-Line Encyclopedia of Integer Sequences), specifically in Sequence A001511 [1], where various definitions are presented. This infinite integer sequence is commonly defined by its nth term, which represents the highest power of 2 that divides 2 n , for n = 1 , 2 , . It is also termed the Gros sequence by Hinz et al. [2], who tackled the so-called Baguenaudier or Chinese Ring Puzzle problem (involving the disentanglement of rings linked together in a wire) and obtained the first terms of the ruler sequence as a finite solution.
The initial terms of this sequence are given by 1 , 2 , 1 , 3 , 1 , 2 , 1 , 4 , 1 , 2 , 1 , 3 , 1 , 2 , 1 , , and the first 2 8 1 terms are visualized in Figure 1, resembling the ticks on a ruler. In this paper, we explore four additional problems in discrete mathematics where this sequence emerges as a characteristic of their recursive nature: (i) demographic automaton, (ii) the middle interval Cantor set, (iii) construction by duplication of polygons, and (iv) the horizontal visibility of the Feigenbaum cascade.
Many significant sequences arise as solutions to discrete dynamical models [3], where the sequence represents the variable’s value (e.g., population size) at each time step. The sequence forms the trajectory of the initial value problem, extending theoretically to an infinite number of time steps, given an initial condition. Perhaps one of the earliest historical examples of such a discrete model is the one leading to the Fibonacci sequence [4], where the nth term is the sum of the two preceding terms: X ( n ) = X ( n 1 ) + X ( n 2 ) for n > 2 , with initial conditions X ( 1 ) = X ( 2 ) = 1 . In contrast to this simple model, many population models incorporate spatial variables and individuals’ ages [5]. Cellular automata [6] provide a specific approach to handling such spatial demographic models.
Sharing equal significance with these discrete dynamical systems is the Cantor set, a cornerstone in number theory, combinatorics, and fractal theory [7,8]. It is often asserted that the Cantor set encapsulates essential elements of these mathematical disciplines [9]. Originating from the unit interval, the classical ternary Cantor set is recursively formed by dividing the resulting intervals into three subintervals, omitting the central one at each step. This process gives rise to one of the most renowned fractal sets.
Polygons, defined as planar figures bounded by three or more sides, are among the most extensively studied geometric shapes [10]. A polygon with s vertices or sides is referred to as an s-gon. The construction of polygons is a longstanding problem [11,12], and the manipulation of polygons is a popular subject in geometry [13]. Various problems aim to explore the properties of polygons and establish connections with other geometric figures. For instance, “chopping polygons into triangles” and related issues, such as frieze patterns, reveal collective properties emerging from simple local rules [13]. The duplication of sides of polygons inscribed within a unit radius circle can be employed to estimate the value of π [11]. This procedure is applicable to regular polygons, i.e., those with all sides and angles equal, but it is not a strict requirement.
A logistic map exhibits chaotic behavior for specific values of growth rate. In the classical model x n + 1 = r x n ( 1 x n ) , chaos emerges and disappears infinitely as the growth rate r increases from 1 to 4, following well-studied bifurcations [8,14,15]. The bifurcation diagram has been reinterpreted by applying the horizontal visibility algorithm [16], obtaining special types of graphs denominated Feigenbaum graphs [17]. Recently, new patterns in sequences derived from the horizontal visibility algorithm within the infinite cascades leading to chaos in this bifurcation diagram have been uncovered [18].
Common to all four problems is their capacity to generate the ruler or Gros sequence, acting as a distinctive fingerprint of their properties. In the following section, we provide a brief overview of the ruler function and its properties. Section three introduces an alternative procedure for obtaining the ruler sequence through duplication. The subsequent sections then apply this procedure to the four problems, where the ruler sequence is inherent. Finally, in Section 8, we present some concluding remarks.

2. Some Classical Descriptions of the Ruler Function

As highlighted in the introduction, the ruler sequence is recognized for its connection to classical problems such as the division of even numbers by powers of 2 or the Tower of Hanoi [2]. In the context of the first problem, the ruler sequence a ( n ) corresponds to the p-adic valuation of 2 n . In the case of the Tower of Hanoi, the ruler sequence aligns with the sequence of movements required for its solution; if we enumerate the discs on one of the three pegs in ascending order of diameter and encode the movements between pegs at each step, the resulting sequence coincides with the ruler sequence [2]. According to [2], this sequence can be recursively described by the function g:
g k = { 1 if k odd g k / 2 + 1 if k even
Another characterization of the ruler sequence, reflecting the corresponding property of the Gray code (numerical code in which consecutive integers are represented by binary numbers differing by only one digit), is given by [2]:
g 2 n = n + 1 if n N 0 g 2 n + k = g 2 n k if k [ 2 n 1 ]
A straightforward and practical method for generating a ruler sequence of size n m a x is demonstrated by the following script [19], implemented in R [20]:
  • nmax = 8;
  • r = 1;
  • for (n in 2:nmax){
  •  r =c(r,n,r)
  •  }
Figure 1 is generated using this algorithm, with n m a x = 8 .
Some authors consider the ruler sequence and Thomae’s function to be synonymous (see, for instance, [21]). In fact, the ruler sequence can be seen as a restriction of Thomae’s function to the dyadic rationals—those rational numbers whose denominators are powers of 2. If we define
h ( x ) = { 2 k if x = p 2 k with p odd 0 otherwise
the ruler sequence coincides, after a linear translation, with the sequence of the exponents of the image of the set of dyadic rationals by h, ordered from least to greatest. For instance, if we restrict the dyadic rationals to those that have a power n of less than 4, the ordered image of h is
1 2 4 , 1 2 3 , 1 2 4 , 1 2 2 , 1 2 4 , 1 2 3 , 1 2 4 , 1 2 , 1 2 4 , 1 2 3 , 1 2 4 , 1 2 2 , 1 2 4 , 1 2 3 , 1 2 4
whose sequence of exponents is
4 , 3 , 4 , 2 , 4 , 3 , 4 , 1 , 4 , 3 , 4 , 2 , 4 , 3 , 4
This sequence can be moved to yield positive integers by adding the largest absolute number plus 1, in this case, 4 + 1 = 5 , to all the members of the sequence:
1 , 2 , 1 , 3 , 1 , 2 , 1 , 4 , 1 , 2 , 1 , 3 , 1 , 2 , 1
The same transformation can be carried out for any n, and hence, we can obtain the infinite ruler sequence.
As mentioned in the Introduction, alternative descriptions of the ruler function can be found in [1]. This section concludes by highlighting some specific properties of the ruler sequence: it is self-containing, meaning it contains a proper subsequence that is identical to itself, and it is regular [22] and square-free [23]. However, according to Kimberling’s definition, it is not considered a fractal sequence [22]. Notably, this sequence verifies that after deleting the first occurrence of each positive integer, the remaining sequence is the same as the original. These attributes will become even more evident as we delve into the recursive definition and explore the problems presented in the following sections.

3. An Alternative Derivation of the Ruler Sequence

Let us consider a sequence of successive partitions of an interval I R , finite or infinite, obtained via duplication of exclusively the points included in the previous step (see Figure 2). If x n , k is the kth point of the partition appearing in step n, it gives rise to two new points in the next step n + 1 that satisfy
x n + 1 , i < x n , k < x n + 1 , j
In addition, both x n + 1 , i and x n + 1 , j must not overlap with the points inserted in the partition by duplicating other points, i.e., x n + 1 , i 1 < x n + 1 , i and x n + 1 , j < x n + 1 , j + 1 . The other points already present in previous steps, but that do not duplicate, are also added to this next step n + 1 .
The partition of the interval at each step is given by
X n = { x n , 1 , x n 1 , 1 , x n , 2 , , x 1 , 1 , , x n , 2 n 1 1 , x n 1 , 2 n 2 , x n , 2 n 1 }
For instance, as can be seen in Figure 2,
X 1 = { x 11 } , X 2 = { x 2 , 1 , x 11 , x 2 , 2 } , X 3 = { x 3 , 1 , x 2 , 1 , x 3 , 2 , x 1 , 1 , x 3 , 3 , x 2 , 2 , x 3 , 4 }
and
X 4 = { x 4 , 1 , x 3 , 1 , x 4 , 2 , x 2 , 1 , x 4 , 3 , x 3 , 2 , x 4 , 4 , x 1 , 1 , x 4 , 5 , x 3 , 3 , x 4 , 6 , x 2 , 2 , x 4 , 7 , x 3 , 4 , x 4 , 8 }
The schematic representation of the sequence construction depicted in Figure 2 can be viewed as a tree, i.e., a graph without cycles. However, it is important to note that, contrary to classical tree graphs, the nodes on the upper levels are also presented on lower levels with their corresponding indices. These trees share some similarities with the so-called Stern–Brocot trees, which provide positive rational numbers [24].
The sequence of indices at step n, r n , is formed by the index of each point of the partition at this step. Thus, as seen in Figure 2, r 1 = { 1 } , r 2 = { 1 , 2 , 1 } and r 3 = { 1 , 2 , 1 , 3 , 1 , 2 , 1 } . Once the partition has been updated, we assign the corresponding index to all points of the partition generated in this step as follows: 1 for the newly included points, and an increase of one unit for the rest of points that already belong to the partition. In so doing, the sequence of indices in step n is
r n = { 1 , 2 , 1 , 3 , , n , 3 , 1 , 2 , 1 }
As n tends to infinity, it becomes apparent that this sequence r n converges to the ruler sequence or Gros sequence [1].
It can be shown that the asymptotic relative frequency of each natural number k in the ruler sequence is f ( k ) = 2 k . Obviously, the sum of these relative frequencies must be 1, i.e.,
k 1 2 k = 1
Moreover, this relative frequency equals the frequency of any block or motif with a largest natural number k. For instance, the frequency of each of the blocks of size z = 5 whose largest natural number is k = 5 , i.e.,
5 1 2 1 3 1 5 1 2 1 2 1 5 1 2 1 2 1 5 1 3 1 2 1 5
is ν 5 ( 5 ) = 2 5 .
This pattern repeats for any digit k of the ruler sequence and for all blocks of size z. When arranging the blocks in such a way that the largest digit is positioned on the main diagonal, the resulting matrix is symmetric. The rows of this matrix contain the ruler sequence up to the term k 1 in a circular order, with the first row representing the natural order. Schematically, this can be illustrated as follows:
k 1 2 1 3 1 1 k 1 2 1 3 2 1 k 1 2 1 1 2 1 k 1 2 3 1 2 1 k 1 1 3 1 2 1 k
Let us now find the sum of the terms of the index sequence. For instance, s 1 = 1 , s 2 = 4 , and s 3 = 11 . It is not difficult to find a recursive formula for the sequence
s n + 1 = 2 s n + n + 1
for n = 1 , 2 , . This expression can be rewritten in terms of s 1 = 1 as
s n + 1 = 2 n 1 + n + 1 + 2 n + 2 2 ( n 1 ) + + 2 n 2 2
for n = 1 , 2 , .
As the partition is constructed, the size of the successive terms of the index sequence increases. It is straightforward to prove that the number of terms in the sequence in step n is
# r ( n ) N ( n ) = 2 n 1
which provide exponential growth.
It is also evident that the maximum integer in the nth-term is m a x ( r n ) = n . The ratio between the maximum integer and the length of the nth-term
λ ( n ) = m a x ( r n ) # r ( n )
can be expressed as a function of N as
λ ( N ) = log 2 ( N + 1 ) N

4. The Solution of Recursive Demographic Automaton

The process of point generation described in the preceding section draws a parallel with the self-reproduction dynamics within a population. In this analogy, the points generated can be likened to individuals situated in a one-dimensional array. Initially, a singular individual, positioned at a specific spatial location, gives rise to two new individuals placed on each side. Following a rule of duplication, individuals replicate only once, occurring in the subsequent step after their formation. Notably, this model assumes immortality among individuals, signifying the absence of any death rate. Consequently, at each time step, the population in the one-dimensional array undergoes expansion, with the age of individuals at step n denoted by the sequence index r n . Thus, the ruler or Gros sequence serves as a representation of the age distribution within the population situated in the one-dimensional array over infinite time (and infinite space).
The total population at step n, N ( n ) , follows an exponential growth model, as expressed by Equation (13). This dynamic behavior is derived from the solution of the discrete equation
N ( n + 2 ) = 2 N ( n + 1 ) N ( n ) + N ( n + 1 )
for n = 1 , 2 , and
N ( 1 ) = 1 ; N ( 2 ) = 2 N ( 1 ) + 1 = 3
The first term in Equation (14) signifies the duplication of individuals born in the previous step, while the second term accounts for the survival of all individuals from the previous step, each aging by one. Equation (14) can also be written as
N ( n + 2 ) = 3 N ( n + 1 ) 2 N ( n )
taking the form of the so-called Horadam sequences, which include, among others, the Fibonacci and Lucas sequences [25]. This discrete equation provides a mathematical representation of the population dynamics, where the total population at each step is influenced by both the reproduction and aging processes.
It can be easily demonstrated that the difference N ( n + 1 ) N ( n ) = 2 n for n = 1 , 2 , , indicating that, at each step n, 2 n 1 individuals in the population have the potential to reproduce, while the remaining population, 2 n 1 1 , ages by one unit. This observation highlights the distinct roles played by individuals in the population dynamics: a portion contributes to the expansion of the population through reproduction, while the remainder continues the aging process, maintaining the balance in the overall structure of the population.
It is interesting to note that these equations are equivalent to the discrete equation
N ( n + 1 ) = 2 N ( n ) + 1 n = 1 , 2 ,
with the initial term N ( 1 ) = 1 , which represents the number of movements required to completely move n discs from one peg to another, according to the rules of the Tower of Hanoi game [2].
The age distribution of the population is captured by the expression in Equation (10) and is visualized in the demographic pyramid shown in Figure 3.
The size of the sequences, r n , generated step by step, is a consequence of the spatial arrangement defined in the cellular automaton (refer to, for instance, [26]). As the population growth is unbounded, an array with an infinite number of components is required to represent the evolving sequence over time.
This demographic model can be adapted to account for the mortality of individuals at a specific age. For instance, one might consider dividing an individual’s lifespan into three periods: (i) fertility, (ii) maturity, and (iii) senescence. Under this modification, individuals die and are removed from the population after three time steps. Consequently, the original discrete model in Equation (14) is adjusted to accommodate this mortality effect:
r n = { 2 n 1 if n = 1 , 2 7 2 n 3 if n = 3 , 4 , 5 ,
The expression of Equation (17) for n = 3 , 4 , is the solution of the geometric equation
r n + 1 = 2 r n
This implies that, with this specific death rate, the population duplicates at each step. It is intriguing to note that, even though all individuals eventually succumb to mortality, the population size continues to grow limitlessly. Consequently, to maintain a bounded population, an additional assumption is necessary. This assumption could either reduce the growth rate or accelerate the rate at which individuals disappear. In either scenario, the age distribution is no longer characterized by the ruler sequence.

5. Middle Interval Indices of the Cantor Set

The Cantor set, referenced in [7,8,9], is a fractal subset within the interval [ 0 , 1 ] . Geometrically, starting with the unit interval, the classical Cantor set undergoes a process where three equal subintervals of length l 1 = 1 3 are obtained. These subintervals are positioned on each side of the middle open interval: i 11 = ( 1 3 , 2 3 ) , namely, [ 0 , 1 3 ] and [ 2 3 , 1 ] . The first term of the sequence of middle intervals is defined as C 1 = i 11 with the index of i 11 denoted as r 1 = { 1 } , indicating the number of steps since i 11 was formed (see Figure 4).
In the subsequent step, only the first and third intervals are further partitioned into three new subintervals, while the middle interval remains undivided. Consequently, the unit interval is divided into six new subintervals of length l 2 = 1 9 , with the previous middle interval now tripling in length: [ 0 , 1 9 ] , ( 1 9 , 2 9 ) , [ 2 9 , 1 3 ] , ( 1 3 , 2 3 ) , [ 2 3 , 7 9 ] , ( 7 9 , 8 9 ) , [ 8 9 , 1 ] . The three middle intervals are identified as i 21 = ( 1 9 , 2 9 ) , i 11 = ( 1 3 , 2 3 ) , and i 22 = ( 7 9 , 8 9 ) , with the indices i 21 = i 22 = 1 (indicating their first appearance) and i 11 = 2 (existing after 2 steps). The sequence of middle intervals in this step is denoted as C 2 = i 21 , i 11 , i 22 , and its corresponding index sequence is r 2 = { 1 , 2 , 1 } .
In the third step, four new middle open intervals emerge: i 31 = ( 1 3 3 , 2 3 3 ) , i 32 = ( 7 3 3 , 8 3 3 ) , i 33 = ( 17 3 3 , 18 3 3 ) , and i 34 = ( 25 3 3 , 26 3 3 ) . These, along with the previously identified intervals, form the third term of the sequence of middle intervals:
C 3 = { i 31 , i 21 , i 32 , i 11 , i 33 , i 22 , i 34 }
and the associated index sequence:
r 3 = { 1 , 2 , 1 , 3 , 1 , 2 , 1 }
For each step, the nth term of the sequence of middle intervals, C n , contains 2 n 1 elements (for n = 1 , 2 , ), with the corresponding index sequence r n . A general formula for the nth term of the sequence of intervals is expressed as
C n = { i n 1 , i ( n 1 ) 1 , i n 2 , i ( n 2 ) 1 , , i 11 , , i ( n 1 ) 2 ( n 2 ) , i n 2 n 1 }
and the associated index sequence is
r n = { 1 , 2 , 1 , 3 , , n , 3 , 1 , 2 , 1 }
It is noteworthy that the construction of the sequences r n is independent of the way intervals are chosen, relying solely on the number of divisions, which, in this case, is three per step, with a middle interval that remains undivided. As stated in Section 3, the ruler sequence r exclusively emerges through the defined process of subdivision.
The distribution of interval lengths is described by the corresponding index sequence, denoted as r n . For example, considering a case when n = 3 , there are four intervals of length 1 3 3 , two of length 1 3 2 , and one of length 1 3 . Therefore, the total length of the middle intervals forming the nth term of the interval sequence can be expressed as
L n = k l n 3 r n ( k ) 1
where l n represents the length of the nth subdivision, i.e., l n = 3 n , and the exponent r n ( k ) is interpreted as the kth coordinate of r n . Consequently, this expression can be simplified to
L n = k 3 r n ( k ) ( n + 1 )
For instance, the first three whole middle interval lengths are
L 1 = 1 3 ; L 2 = 1 3 2 + 1 3 1 + 1 3 2 = 5 9
L 3 = 1 3 3 + 0 + 1 3 3 1 + 1 3 3 + 0 + 1 3 3 3 + 1 3 3 + 0 + 1 3 3 1 + 1 3 3 0 = 19 27
This last expression can be also written as
L 3 = 4 1 3 3 + 2 1 3 2 + 1 3
In general, it can be proven that
L n = k = 1 n 2 k 1 1 3 k = 1 2 k = 1 n 2 3 k = 1 2 3 1 2 3 n 1
This sequence of total lenghts { L n } tends to 1 as n tends to infinity. Note that this limit coincides with the total length of the complementary of the Cantor set [9].

6. Vertex Indices of Infinite-Sided Polygons

In the introduction, we highlighted the classical problem of constructing polygons with any number of sides, which has yielded fundamental results in both geometry and number theory (see [11,12]). For the sake of simplicity, our focus is on regular s-gons with s vertices, where s is either a prime number, denoted as m, or a power of 2, i.e., s = 2 n , for n = 1 , 2 , . As an illustrative example, when each side is equally divided, we obtain a sequence of s-gons with s = 2 , 4 , 8 , and 16 vertices (refer to Figure 5). It is noteworthy that with each side division, the same number of vertices emerges.
For each s, we introduce the concept of the “vertex index”, defined as the number of p-gons with p s that share a common vertex. In Figure 5, for instance, the northernmost vertex has an index of 4 since it belongs to all s-gons for s = 2 , 4 , 8 , 16 . Importantly, at each step of the construction, newly generated vertices consistently have an index of 1. The sequence of vertex indices r n for each s-gon is formed from s 1 vertices, excluding the southernmost vertex. These vertices are selected in a specific order, starting from the vertex located to the left of the southernmost vertex and proceeding clockwise (see Figure 5). As an example, the vertex index sequence for s = 16 is r 4 = { 1 , 2 , 1 , 3 , 1 , 2 , 1 , 4 , 1 , 2 , 1 , 3 , 1 , 2 , 1 } , coinciding with the corresponding term of the ruler sequence. In the construction, as n tends to infinity, the sequence r n converges to the infinite ruler sequence.
It is crucial to emphasize the recursive nature underlying the generation of the ruler sequence: each s-gon encompasses all p-gons with p < s . This recursive property manifests itself in the iterative pattern of the infinite ruler sequence. Furthermore, as observed in previous cases, the process of side duplication need not be regular; in other words, the lengths of the sides do not have to be equal. Equivalently, this implies that the positioning of vertices on the circle is not required to be equally spaced. As clarified in Section 3, it is essential that the vertices never cross each other during this process.

7. Forward Horizontal Visibility at the Accumulation Point of the Feigenbaum Cascade

The visibility patterns underlying cascades to chaos have recently been explored and demonstrated in [18]. This paper focuses on the visibility properties observed in a bifurcation diagram of discrete maps, with a specific emphasis on unimodal maps [8,14,15]. In Figure 6, a horizontal visibility algorithm is depicted, showcasing the visibility pattern obtained as the period of the equilibrium orbits doubles. The corresponding visibility graph is presented for a series of size N = 4 × 10 3 .
An intriguing finding is revealed at the Feigenbaum accumulation point: the forward visibility sequence coincides with the Gros sequence multiplied by 2. Notably, this sequence precisely matches the one derived from the forward horizontal visibility procedure, wherein the horizontal visibility towards the future of the time series is considered. Figure 6 visually captures these visibility patterns and their significance in understanding the dynamics of discrete maps, especially in the context of unimodal maps and bifurcation diagrams.
As described in [18], the construction of the sequences r n follows a recursive process that considers the period doubling of the time series. Specifically, the visibility pattern for a period T = 2 n can be derived from the visibility patterns of the previous periods, as illustrated in Figure 7. The recursive relation is expressed as
P n = ( n + 1 ) P 0 P 1 P 2 P 3 P n 1
Here, P n 1 represents the visibility pattern for n = 1 , 2 , , and the base case is given by P 0 = { 1 } . This recursive formulation captures the evolution of visibility patterns as the period of the time series undergoes doubling, providing a systematic approach to understanding the intricate dynamics observed in the sequences r n . Figure 7 serves as a visual aid, elucidating the recursive nature of the construction process.
Note the recurrence law governing the generation of the nth visibility pattern P n for forward horizontal visibility: the largest visibility precedes the elementary block, { 1 } , and subsequently, all previous visibility patterns follow. This sequence continues until the one before, P n 1 , which contains all preceding visibility patterns. For example, for n = 3 , we have the following previous patterns:
P 0 = { 1 } ; P 1 = 2 P 0 = { 2 1 } ; P 2 = 3 P 0 P 1 = { 3 1 2 1 }
which yield:
P 3 = 4 P 0 P 1 P 2 = { 4 1 2 1 3 1 2 1 }
This construction can be algorithmically performed by the following recursive function:
  • VisPattern <- function(n){
  •  if(n==0){
  •   return(1)
  •  }else{
  •   s <- c()
  •   for(i in 1:n){
  •    s <- c(s, VisPattern(i-1))
  •   }
  •   return(c(n+1, s))
  •  }
  • }
Note that this function yields the same sequence as the iterative script proposed by Caroli to generate the ruler sequence, as explicitly depicted in Section 2. However, it is worth noting that VisPattern starts from the middle largest value for each n.
While one might initially perceive this procedure to be distinct from the definitions of the Gros sequence derived in the previous section, they are, in fact, related, as illustrated in Figure 6B. As the period doubles, the number of points forming the orbit in the stationary regime also doubles. The forward visibility of each of these points precisely corresponds to their indices, as defined in Section 3. In other words, the point index aligns with the visibility of each point in the periodic orbits occurring during the Feigenbaum cascade. At the accumulation point of this cascade, where the orbit becomes chaotic, even in the stationary regime, it is composed of an infinite number of points. Nevertheless, the visibility pattern retains the fingerprint of the period-doubling cascade, evident in the infinite ruler sequence.
By definition, the terms of the ruler function signify the connectivity of the vertices in the visibility graph. It has been established that the degree distribution of the visibility graph associated with a chaotic time series is exponential [16,27]. Consequently, the digit distribution of the ruler function is also exponential, as derived in Section 3. Notably, the exponent, when plotted on an ln-scale, surpasses the limit of ln ( 3 2 ) reported for the complete (forward and backward) visibility graphs of chaotic series [27]. This observation underscores the distinctive characteristics of the ruler function in capturing the complex connectivity patterns inherent in chaotic time series.

8. Concluding Remarks

The presented study has demonstrated the pervasive nature of the ruler function, also known as the Gros sequence, across various fundamental mathematical domains, spanning from number theory to data analysis and classical and fractal geometry. Building upon existing descriptions [1], we have contributed four novel perspectives to the understanding of this sequence. All descriptions share a common thread: the ruler sequence emerges through a recursive process based on the duplication of certain points at each step, be it intervals, vertices, or points. While the definition of the nth-term of the ruler sequence, a ( n ) , aligns with the highest power of 2 dividing 2 n , it is crucial to emphasize that this definition does not fully capture the recursive and self-containing properties, nor the fractal nature, of the sequence [22]. Notably, the definition in [22] seems too restrictive, as it does not hold for the ruler sequence despite its direct derivation from the fractal structure of the Cantor set. Notably, the ruler sequence is related to other well-known integer sequences [22]. Especially significant in this context is its relationship with Farey fractions through concepts like continued fractions and structures like the Stern–Brocot tree [28].
The dynamic perspective introduced in this paper is intriguing, offering a pioneering example of a demographic model sharing fractal properties. As illustrated in Figure 3, the age distribution, a, follows the law p ( a ) = 2 a . Notably, due to its self-containing property, an identical age distribution is obtained when the population initiates growth from any individual taken separately at a given time. We have derived a recursive formula for this discrete dynamical model (Equation (15)), providing a means to compute the population at step n + 1 based on the two preceding populations, N ( n ) and N ( n 1 ) . The solution to this equation yields exponential growth, N ( n ) = 2 n 1 . As discussed in Section 4, the model can be extended to account for the death of individuals at a specific age, resulting in an age distribution that does not follow the ruler function.
This generative process that underlies the ruler sequence is also evident in the sequence of vertex indices of the n-gons generated by size bisection. For each 2 n -gon generated by bisecting sides from the 2 n 1 -gon, where n = 1 , 2 , , a sequence of length 2 n 1 is associated. This sequence contains the number of previous polygons to which each vertex belongs, beginning from the left of the southernmost vertex and proceeding clockwise (see Figure 5). It should be noted that a similar duplication process is suggested in [17], although with a different motivation. Remarkably, what we have shown is that, in the limit of n tending to infinity when the n-gons tend to the circumference, the ruler sequence describes the indices of the infinite numbers that form the circumference.
It is noteworthy that the patterns derived in each step to construct r n differ between the Cantor set and the visibility map, stemming from variations in the definition of the division process. Indeed, the Gros sequence can also be derived from half of the Cantor set, utilizing only the left and middle intervals, leading to the same infinite sequence. The application of the complete visibility algorithm to Feigenbaum cascades yields a sequence that is twice the ruler sequence, demonstrating the temporal symmetry of the periodic series for each cascade period. Similar horizontal visibility sequences are observed in other periodic doubling bifurcations of unimodal maps, such as the period 3 cascade [29].
The ruler or Gros sequence, defined in the On-Line Encyclopedia of Integer Sequences (OEIS) [1], finds its roots in the division of even numbers by powers of 2. It is intricately linked to problems like the Tower of Hanoi and Chinese Rings. This paper underscores that the ruler sequence is not confined to abstract mathematical concepts; it manifests itself in classical problems such as population dynamics, Cantor set construction, polygon generation, and chaotic bifurcations. The common threads weaving through these diverse applications are the principles of duplication and recursiveness. We hope that this exploration inspires further investigation of this fundamental sequence across various scientific domains that complement its rich characterization.

Author Contributions

Conceptualization, J.C.N. and F.J.M.; methodology, J.C.N. and F.J.M.; software, J.C.N. and F.J.M.; formal analysis, J.C.N. and F.J.M.; investigation, J.C.N. and F.J.M.; writing—original draft preparation, J.C.N. and F.J.M.; writing—review and editing, J.C.N. and F.J.M. All authors have read and agreed to the published version of the manuscript.

Funding

J.C.N acknowledges financial support from project PRIORITY (PID2021-127202NB-C22), funded by MCIN/AEI/10.13039/501100011033 and “ERDF. A way of making Europe”.

Data Availability Statement

The data presented in this study are available on request from the corresponding author.

Acknowledgments

We want to acknowledge the referees’ comments that contributed to improving the quality of this paper.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Sloane, N.J.A. A001511 Sequence in The On-Line Encyclopedia of Integer Sequences. Available online: http://www.oeis.org (accessed on 3 January 2024).
  2. Hinz, A.M.; Klavzar, S.; Milutinovic, U.; Petr, C.; Stewart, I. The Tower of Hanoi: Myths and Maths; Birkhäuser: Basel, Switzerland, 2013. [Google Scholar]
  3. Salinelli, E.; Tomarelli, F. Discrete Dynamical Models; Springer International Publishing: Berlin/Heidelberg, Germany, 2014. [Google Scholar]
  4. Roberts, J. Lure of the Integers; The Mathematical Association of America: Washington, DC, USA, 1992. [Google Scholar]
  5. Keyfitz, N.; Caswell, H. Applied Mathematical Demography; Springer: Berlin/Heidelberg, Germany, 2005. [Google Scholar]
  6. Wolfram, S. (Ed.) Theory and Application of Cellular Automata; Addison-Wesley: Reading, MA, USA, 1986. [Google Scholar]
  7. Falconer, K. Fractal Geometry: Mathematical Foundations and Applications; Wiley: Hoboken, NJ, USA, 2014. [Google Scholar]
  8. Peitgen, H.O.; Jürgens, H.; Saupe, D. Chaos and Fractals New Frontiers of Science, 2nd ed.; Springer: Berlin/Heidelberg, Germany, 2004. [Google Scholar]
  9. Vallin, R.W. The Elements of Cantor Sets with Applications; Wiley: Hoboken, NJ, USA, 2013. [Google Scholar]
  10. Barnes, J. Gems of Geometry; Springer: Berlin/Heidelberg, Germany, 2012. [Google Scholar]
  11. Boywer, C.B.; Merzbach, U.C. A History of Mathematics; Wiley: Hoboken, NJ, USA, 2011. [Google Scholar]
  12. Kuh, D. Constructible Regular n-Gons; Whitman College: Walla Walla, DC, USA, 2013. [Google Scholar]
  13. Conway, J.H.; Guy, R.K. The Book of Numbers; Copernicus: New York, NY, USA, 1996. [Google Scholar]
  14. May, R.M. Simple mathematical models with very complicated dynamics. Nature 1976, 261, 459–467. [Google Scholar] [CrossRef] [PubMed]
  15. Strogatz, S.H. Nonlinear Dynamics and Chaos with Applications to Physics, Biology, Chemistry, and Engineering; Westview Press-CRC Press: Boulder, CO, USA, 2018. [Google Scholar]
  16. Luque, B.; Lacasa, L.; Ballesteros, F.J.; Robledo, A. Feigenbaum Graphs: A Complex Network Perspective of Chaos. PLoS ONE 2011, 6, e22411. [Google Scholar] [CrossRef] [PubMed]
  17. Flanagan, R.; Lacasa, L.; Nicosia, V. On the spectral properties of Feigenbaum graphs. J. Phys. Math. Theor. 2019, 53, 025702. [Google Scholar] [CrossRef]
  18. Nuño, J.C.; Muñoz, F.J. Universal visibility patterns of unimodal maps. Chaos 2020, 30, 063105. [Google Scholar] [CrossRef] [PubMed]
  19. Caroli, A. Available online: https://oeis.org/A001511 (accessed on 26 February 2016).
  20. R Core Team. R: A Language and Environment for Statistical Computing; R Foundation for Statistical Computing: Vienna, Austria, 2014; Available online: http://www.R-project.org/ (accessed on 3 January 2024).
  21. Dunham, W. The Calculus Gallery: Masterpieces from Newton to Lebesgue; Princeton University Press: Princeton, NJ, USA, 2018. [Google Scholar]
  22. Kimberling, C. Proper Self-Containing Sequences, Fractal Sequences, and Para-Sequences. J. Integer Seq. 2022, 25, 22.2.1. [Google Scholar]
  23. Allouche, J.P.; Shallit, J. Automatic Sequences: Theory, Applications, Generalizations; Cambridge University Press: Cambridge, UK, 2003. [Google Scholar]
  24. Graham, R.L.; Knuth, D.E.; Patashnik, O. Concrete Mathematics; Addison-Wesley: Reading, MA, USA, 1990. [Google Scholar]
  25. Larcombe, P.J.; Bagdasar, O.D.; Fennessey, E.J. Horadam sequences: A survey. Bull. Inst. Comb. Its Appl. 2013, 67, 49–72. [Google Scholar]
  26. Cobeli, C.; Prunescu, M.; Zaharescu, A. A growth model based on the arithmetic Z -game. Chaos Solitons Fractals 2016, 91, 136–147. [Google Scholar] [CrossRef]
  27. Lacasa, L.; Toral, R. Description of stochastic and chaotic series using visibility graphs. Phys. Rev. E 2010, 82, 036120. [Google Scholar] [CrossRef]
  28. Calero-Sanz, J.; Luque, B.; Lacasa, L. Haros graphs: An exotic representation of real numbers. J. Complex Netw. 2022, 10, cnac043. [Google Scholar] [CrossRef]
  29. Sloane, N.J.A. A333363 Sequence in The On-Line Encyclopedia of Integer Sequences. Available online: http://www.oeis.org (accessed on 3 January 2024).
Figure 1. Representation of the first 2 8 1 terms of the ruler function. The X-axis denotes the position in the sequence, while the Y-axis represents the value of the term in each position. Notice the distinctive pattern of points, resembling the markings on a ruler. These points are generated using the algorithm outlined in Section 2, with n m a x = 8 .
Figure 1. Representation of the first 2 8 1 terms of the ruler function. The X-axis denotes the position in the sequence, while the Y-axis represents the value of the term in each position. Notice the distinctive pattern of points, resembling the markings on a ruler. These points are generated using the algorithm outlined in Section 2, with n m a x = 8 .
Mathematics 12 00742 g001
Figure 2. Basic algorithm for the generation of the ruler sequence. From a given interval I, which can be ( , ) , an interior point x 1 , 1 is chosen and the following basic algorithm is applied. (i) Insert two points on each side of x 1 , 1 . (ii) For each point that appeared in the previous step, x n , k , insert two points in the partition on each side in such a way that they do not intersect with any other point that comes from other points of the partition. (iii) Assign an index to each of the points of the new partition—1 (blue) for the new points and increase of 1 unity for the rest of the points. (iv) Continue at infinitum.
Figure 2. Basic algorithm for the generation of the ruler sequence. From a given interval I, which can be ( , ) , an interior point x 1 , 1 is chosen and the following basic algorithm is applied. (i) Insert two points on each side of x 1 , 1 . (ii) For each point that appeared in the previous step, x n , k , insert two points in the partition on each side in such a way that they do not intersect with any other point that comes from other points of the partition. (iii) Assign an index to each of the points of the new partition—1 (blue) for the new points and increase of 1 unity for the rest of the points. (iv) Continue at infinitum.
Mathematics 12 00742 g002
Figure 3. Demographic pyramid obtained from the cellular automaton model. The lowest level is formed of newborn individuals, label as 1. The second level is formed of individuals of age 2 and, as can be seen, its proportion is half the age 1 population. In general, the proportion of individuals of age k is given by p ( k ) = 2 k .
Figure 3. Demographic pyramid obtained from the cellular automaton model. The lowest level is formed of newborn individuals, label as 1. The second level is formed of individuals of age 2 and, as can be seen, its proportion is half the age 1 population. In general, the proportion of individuals of age k is given by p ( k ) = 2 k .
Mathematics 12 00742 g003
Figure 4. Recursive generation of the Cantor set and the corresponding index sequence. The generation process involves a recurrence relation. After the initial partition of the unit interval at n = 1 , the index of the interval i 11 = ( 1 3 , 2 3 ) is assigned as i 11 = 1 , resulting in the index sequence r 1 = { 1 } . In the subsequent step ( n = 2 ), two new intervals, i 21 = ( 1 9 , 2 9 ) and i 22 = ( 7 9 , 8 9 ) , emerge with the indices i 21 = i 23 = 1 . The index of the middle interval increases by 1, i.e., i 11 = 2 . Consequently, in this step, the set sequence becomes C 2 = { i 21 , i 11 , i 22 } with the corresponding index sequence r 2 = { 1 , 2 , 1 } . This recursive procedure continues in subsequent steps, generating successive terms of the Cantor set and their associated index terms. The fractal structure of the set becomes evident through this iterative process. The index sequence of the Cantor set can be conceptualized as an array with an infinite number of columns, each of infinite length, containing the set of natural numbers. Notably, this sequence is self-contained by construction; starting from any “1” in any of the columns yields the same sequence, highlighting the recursive nature of the Cantor set.
Figure 4. Recursive generation of the Cantor set and the corresponding index sequence. The generation process involves a recurrence relation. After the initial partition of the unit interval at n = 1 , the index of the interval i 11 = ( 1 3 , 2 3 ) is assigned as i 11 = 1 , resulting in the index sequence r 1 = { 1 } . In the subsequent step ( n = 2 ), two new intervals, i 21 = ( 1 9 , 2 9 ) and i 22 = ( 7 9 , 8 9 ) , emerge with the indices i 21 = i 23 = 1 . The index of the middle interval increases by 1, i.e., i 11 = 2 . Consequently, in this step, the set sequence becomes C 2 = { i 21 , i 11 , i 22 } with the corresponding index sequence r 2 = { 1 , 2 , 1 } . This recursive procedure continues in subsequent steps, generating successive terms of the Cantor set and their associated index terms. The fractal structure of the set becomes evident through this iterative process. The index sequence of the Cantor set can be conceptualized as an array with an infinite number of columns, each of infinite length, containing the set of natural numbers. Notably, this sequence is self-contained by construction; starting from any “1” in any of the columns yields the same sequence, highlighting the recursive nature of the Cantor set.
Mathematics 12 00742 g004
Figure 5. The generation of sequences from regular polygons with s = 2 n vertices, where n = 1 , 2 , 3 , and 4, unfolds through a systematic process. Each subsequent polygon in the sequence possesses twice the number of sides (and vertices) of the previous one, beginning with an initial regular polygon with s = 2 1 = 2 vertices. This construction involves bisecting angles, leading to the formation of polygons with an escalating number of vertices. In this sequence, the vertex index is a crucial metric, denoting the number of polygons to which a point belongs. This index is illustrated for each polygon, offering insights into the recursive nature of the construction. For example, the sequence commences with a regular polygon with s = 2 vertices, followed by one with s = 2 2 = 4 vertices, and so forth. The process of bisecting sides continues, consistently doubling the number of vertices in each successive polygon. The associated vertex index for each point emphasizes the interconnectedness of polygons, revealing how each vertex is shared by multiple polygons and exemplifying the recursive pattern inherent in the sequence’s evolution.
Figure 5. The generation of sequences from regular polygons with s = 2 n vertices, where n = 1 , 2 , 3 , and 4, unfolds through a systematic process. Each subsequent polygon in the sequence possesses twice the number of sides (and vertices) of the previous one, beginning with an initial regular polygon with s = 2 1 = 2 vertices. This construction involves bisecting angles, leading to the formation of polygons with an escalating number of vertices. In this sequence, the vertex index is a crucial metric, denoting the number of polygons to which a point belongs. This index is illustrated for each polygon, offering insights into the recursive nature of the construction. For example, the sequence commences with a regular polygon with s = 2 vertices, followed by one with s = 2 2 = 4 vertices, and so forth. The process of bisecting sides continues, consistently doubling the number of vertices in each successive polygon. The associated vertex index for each point emphasizes the interconnectedness of polygons, revealing how each vertex is shared by multiple polygons and exemplifying the recursive pattern inherent in the sequence’s evolution.
Mathematics 12 00742 g005
Figure 6. (A) The forward horizontal visibility of the points in a time series with a period of 8, generated by logistic equation. (B) The doubling of the period of orbits corresponds to an increase in the number of points in the stationary regimes. Importantly, the forward horizontal visibility of each of these points aligns with their indices, as defined in Section 3. Consequently, period-doubling bifurcations manifest in both the duplication of points in the orbits and the values of their indices, providing insights into their horizontal visibility. (C) A schematic representation of the graph formed by the ruler function, as depicted in Figure 1, is shown according to the significance assigned to their terms as a visibility graph, reflecting their degree of connectivity.Notably, the self-similar nature of the sequence is evident: a similar pattern is formed within each subset. The size of the sequence is 2 8 1 . This representation visually captures the intricate connectivity patterns inherent in the ruler function, revealing the hierarchical and repeating structures within the sequence.
Figure 6. (A) The forward horizontal visibility of the points in a time series with a period of 8, generated by logistic equation. (B) The doubling of the period of orbits corresponds to an increase in the number of points in the stationary regimes. Importantly, the forward horizontal visibility of each of these points aligns with their indices, as defined in Section 3. Consequently, period-doubling bifurcations manifest in both the duplication of points in the orbits and the values of their indices, providing insights into their horizontal visibility. (C) A schematic representation of the graph formed by the ruler function, as depicted in Figure 1, is shown according to the significance assigned to their terms as a visibility graph, reflecting their degree of connectivity.Notably, the self-similar nature of the sequence is evident: a similar pattern is formed within each subset. The size of the sequence is 2 8 1 . This representation visually captures the intricate connectivity patterns inherent in the ruler function, revealing the hierarchical and repeating structures within the sequence.
Mathematics 12 00742 g006
Figure 7. Schematic representation of the procedure for the generation of visibility patterns in the period-doubling Feigenbaum cascade by means of a recurrence formula. At the limit n , the visibility pattern at the onset of chaos of this cascade, P , is obtained.
Figure 7. Schematic representation of the procedure for the generation of visibility patterns in the period-doubling Feigenbaum cascade by means of a recurrence formula. At the limit n , the visibility pattern at the onset of chaos of this cascade, P , is obtained.
Mathematics 12 00742 g007
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.

Share and Cite

MDPI and ACS Style

Nuño, J.C.; Muñoz, F.J. The Ruler Sequence Revisited: A Dynamic Perspective. Mathematics 2024, 12, 742. https://doi.org/10.3390/math12050742

AMA Style

Nuño JC, Muñoz FJ. The Ruler Sequence Revisited: A Dynamic Perspective. Mathematics. 2024; 12(5):742. https://doi.org/10.3390/math12050742

Chicago/Turabian Style

Nuño, Juan Carlos, and Francisco J. Muñoz. 2024. "The Ruler Sequence Revisited: A Dynamic Perspective" Mathematics 12, no. 5: 742. https://doi.org/10.3390/math12050742

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop