1 Introduction

The word “fractal” was coined by B. Mandelbrot in 1975, but they are known at least from the end of the previous century (Cantor, von Koch, Sierpiński, Fatou, Hausdorff, Lévy, etc.). However, it is only in the last few decades that fractals have known a wide and transversal diffusion and the interest of the scientific world towards them has seen an exponential growth. In fact, fractals have been applied in many fields, from the dynamics of chaos to computer science, from signal theory to geology and biology, etc. (see for example Barnsley 1993, 2006; Bertacchini et al. 2018, 2016; Briggs 1992; Falconer 2014; Hastings and Sugihara 1994; Mandelbrot 1982 and the references therein). Very interesting further links and applications are also those between fractals, space-filling curves and number theory (see, for instance, Caldarola 2018a; Edgar 2008; Falconer 2014; Lapidus and van Frankenhuysen 2000), or fractals and hydrology/hydraulic engineering as we will recall better below.

The main characteristic of a fractal, as it is well known, is the property of self-similarity at different scales, and many abstract mathematical models have been created by focusing on this property. In most cases, a fractal is in fact mathematically described by a generating rule or an iterated mechanism, but in the real world it is not difficult to find examples in which it clearly emerges that a single simple rule is not enough to build the fractal. So in recent years, there have been several attempts and studies, some very successful, to implement traditional fractal theory. For example, a multifractal system is a generalization of a classical fractal which uses a continuous spectrum of exponents to describe its dynamics, in the place of a single exponent, given by the fractal dimension, in traditional models (see Bernardara et al. 2007; Falconer 2014; Harte 2001). For many natural phenomena, it is in fact completely insufficient to use a model that provides a single fractal dimension; multifractal systems have been typically applied in contexts with different mass concentrations and in chaotic dynamics, for instance, to the Sun’s magnetic field, human heartbeat and brain activity, turbulent dynamics in fluids, meteorology, geophysics, but also finance, internet traffic, and others (see Falconer 2014; Harte 2001; Ivanov et al. 1999; Stanley and Meakin 1988; Veneziano and Essiam 2003 and their references).

Another interesting example is given by the superfractal formalism introduced in 2002 by Barnsley, Hutchinson and Stenflo. The class of deterministic fractals is not too rich to study effectively the real world, because nature often mixes deterministic aspects and casuality in its patterns. Then, superfractals are precisely the models that are halfway between deterministic and completely random fractals, and present characteristics of both groups (for a comprehensive introduction to 1- and V-variable superfractals, see Barnsley 2006).

In their experience in hydraulic contexts, the authors have often found semblances and fractal properties emerging in the course of various researches, especially in those conducted by the second author since the 90s. For example, the application of fractal models to hydrological basins, natural channel networks, but also to urban rainfall catchments, marine waves actions, shallow waters, and much more, has become a common topic in the scientific literature (see, e.g., Bernardara et al. 2007; Rodríguez-Iturbe and Rinaldo 2001; Sivakumar 2017; Veltri et al. 1996; Yang et al. 2014). Recently, moreover, the theory of fractals and fractal dimension has started to be applied also to artificial infrastructures such as water distribution networks, in particular in urban agglomerations, as in Di Nardo et al. (2017); Diao et al. (2017); Kowalski et al. (2014); Qi et al. (2014); Wu et al. (2009). The same authors are conducting some research using tools such as algebraic graph theory, fractal geometry and a new system of local indices (see Bonora et al. 2020a, b, c; Caldarola and Maiolo 2019, 2020a, b) in the study of water networks: in the second case, the biggest challenge is to find a deterministic fractal model, without random components, but which takes into account some temporal periodicities, for example, on a daily, weekly, seasonal basis, which characterize urban water networks. The same challenge arises in the study of the fractal aspects of water demand, where a superfractal or multifractal model does not seem to be the most effective or the most appropriate for the purpose, as well. Furthermore, these models do not best respond to the request for structural simplicity and ease of use by technicians and engineers who work on real networks and who struggle constantly with important complications and difficulties from a computational point of view.

For the reasons exposed above, the authors are very interested to investigate and develop a fractal model as simple as possible, but that can easily involve periodic changes as needed. This could be the case of “blinking fractals” or something similar to them.

The idea of blinking fractal was introduced by Y. Sergeyev in 2007 (see Sergeyev 2007) to describe fractals that assume different shapes or configurations during their development, with a cyclical order. As far as the knowledge of the authors, they were successively applied only in Sergeyev (2011) up until now, to model a process of growth in biological systems (like the growing of trees through the different seasons of the year).Footnote 1 We also inform the reader that in Sergeyev (2007) and (Sergeyev 2011) blinking fractals are studied with the support of a new computational methodology developed by Sergeyev himself in the early 2000s to write and to perform calculations with infinite and infinitesimal numbers in a handy and very easy way as in the ordinary sets of natural or rational numbers \({\mathbb {N}}\) and \({\mathbb {Q}}\) (see Sect. 5 for some more information and the references Amodio et al. 2017; Antoniotti et al. 2020a, b; Caldarola 2018b; Caldarola et al. 2020b; Sergeyev 2013, 2008, 2009, 2010, 2016, 2017). More precisely, a blinking fractal is specified in Sergeyev (2007) as an “object constructed using the principle of self-similarity with a cyclic application of several fractal rules.”

The main purpose of this paper is to make a topological-geometric contribution for the development and a concrete future use of fractal models which present periodic changes or alterations, as in the case of blinking fractals. In particular, after some preliminary material recalled in Sect. 2, we examine in Sect. 3 the second example (and the first geometrically constructed) given in the introduction of the article (Sergeyev 2007), the one where the name blinking fractal is used for the first time. We deeply investigate Sergeyev’s sequence \(\big \{S_n\big \}_n\) as described in Sergeyev (2007), firstly by considering separately the two subsequences \(\big \{A_n\big \}_n\) and \(\big \{B_n\big \}_n\) made up by the odd and even indexed element, respectively. The sequence \(\big \{B_n\big \}_n\) clearly converges to a fractal \({\mathcal {S}}\) equal to the intersection of all \(B_n\), instead, such a property does not hold for \(\big \{A_n\big \}_n\). Hence we begin a series of computations that allow to find the precise Hausdorff distance between any two elements of \(\big \{A_n\big \}_n\) (Proposition 2) and \(\big \{B_n\big \}_n\) (Proposition 3), to get successively a general formula that gives the distance for any two elements of \(\big \{S_n\big \}_n\) (Theorem 1). As elementary consequence, the sequence \(\big \{S_n\big \}_n\) itself converges to \({\mathcal {S}}\) which has Hausdorff dimension 3/2.

In Sect. 4 we use a three-rules system to define a sequence of plane shapes \(\big \{X_n\big \}_n\) that has two subsequences \(\big \{Y_n\big \}_n\) and \(\big \{C_n\big \}_n\) that converge to two different fractals, Y and C respectively. Proposition 4 computes their exact distance.

Section 5 addresses conclusions and, from the point of view of traditional mathematics, proposes to define a blinking fractal of order m simply as a m-tuple of traditional fractals (i.e., of blinking fractals of order 1). If we adopt this definition, Sergeyev’s sequence \(\big \{S_n\big \}_n\) generates a blinking fractal of order 1 and \(\big \{X_n\big \}_n\) a blinking fractal of order 2.

2 Preliminary definitions and results

This section collects and explains some necessary notations and definitions together with some fundamental, well-known properties of the recalled objects.

First of all, the symbols \({\mathbb {Z}},\ {\mathbb {N}}\) and \({\mathbb {N}}^+\) denote, as usual, the sets of integers, of nonnegative integers and positive integers, respectively. The standard symbol \({\mathbb {R}}\) stays for the set of real numbers and \({\mathbb {R}}^+_0\) for the set of nonnegative real ones. Given two integers \(n\le m\), the writing  \([n\mathrel {{.}\,{.}}m]\)  is the most common notation for discrete intervals, i.e., we set  \([n\mathrel {{.}\,{.}}m]:=[n,m]\cap {\mathbb {Z}}\)  where [nm] stands for the real interval as usual. A sequence will be indicated as \(\big \{a_n\big \}_{n\in {\mathbb {N}}}\), \(\big \{a_n\big \}_{n}\), or sometimes simply as \(a_n\).

We now continue by briefly recalling and explaining some basic notations in fractal geometry that will be frequently used in the next sections. For the benefit of the non-mathematical reader interested in blinking fractals, we will use, both here and in the next sections, a language as simple and elementary as possible, also providing from time to time enough details to facilitate reading.

For any \(N\in {\mathbb {N}}^+\), we indicate by d the standard Euclidean metric on \({\mathbb {R}}^N\). For \(x\in {\mathbb {R}}^N\) and \(r\in {\mathbb {R}}^+_0\), \(B_{r}[x]\) denotes the closed ball in \({\mathbb {R}}^N\) with radius r and center x, while, if \(r>0\)\(B_{r}(x)\) denotes the correspondent open one. If \(\varepsilon \) is a nonnegative real number and A is any subset of \({\mathbb {R}}^N\), let \(A_{\{\varepsilon \}}\) be the \(\varepsilon \)-hull of A, that is,

$$\begin{aligned} \begin{array}{lll} A_{\{\varepsilon \}} &{}:=&{}\displaystyle \left\{ x\in {\mathbb {R}}^N:d(x,a)\le \varepsilon \, \text { for some }\, a\in A\right\} \\ &{}=&{}\displaystyle \bigcup _{a\in A} B_{\varepsilon }[a]\,. \end{array} \end{aligned}$$

Remark 1

In literature \(A_{\{\varepsilon \}}\) has many names as, for instance, the \(\varepsilon \)-fattening, the \(\varepsilon \)-parallel body, \(\varepsilon \)-dilatation, or also the \(\varepsilon \)-neighborhood of A. The last name is more common but it is preferable for the set  \({\mathcal {N}}_{\varepsilon }(A):=\big \{x\in {\mathbb {R}}^N:d(x,a)<\varepsilon \, \text { for some }\, a\in A\big \}\), because we cannot speak of open and closed \(\varepsilon \)-neighborhoods. In \({\mathbb {R}}^2\), for example, \({\mathcal {N}}_{1}\big (B_1\big ((0,0)\big )\big )\) and \(\big (B_1\big ((0,0)\big )\big )_{\{1\}}\) are both open sets, equal to \(B_2\big ((0,0)\big )\), instead \({\mathcal {N}}_{1}\big (B_1[(0,0)]\big )=B_2\big ((0,0)\big ) \ne \big (B_1[(0,0)]\big )_{\{1\}}=B_2[(0,0)]\).

It is important also notice for the reader that, for our purposes, it will be quite more convenient to work with enlarged sets of the kind \(A_{\{\varepsilon \}}\) rather than \({\mathcal {N}}_{\varepsilon }(A)\), hence in (1) we give the definition of Hausdorff distance accordingly, among the many possible ones.

If A and B are two nonempty subsets of \({\mathbb {R}}^N\) we define their Hausdorff distance \(d_H(A,B)\) by

$$\begin{aligned} d_H(A,B)\,:=\, \inf \left\{ \varepsilon \ge 0: A\subseteq B_{\{\varepsilon \}}\, \text { and }\, B\subseteq A_{\{\varepsilon \}} \right\} . \end{aligned}$$
(1)

It is simple to observe that, equivalently, we can also define \(d_H(A,B)\) as

$$\begin{aligned} d_H(A,B)\, =\, \max \left\{ \,\sup _{a\in A}\inf _{b\in B}\,d(a,b),\ \sup _{b\in B}\inf _{a\in A}\,d(a,b)\,\right\} . \end{aligned}$$

The function \(d_H\) is not a metric in general, but it becomes so if we consider the restriction of \(d_H\) to the family

$$\begin{aligned} {\mathbb {H}}\big ({\mathbb {R}}^N\big )\,:=\,\left\{ K\subset {\mathbb {R}}^N:K \text { compact and } K\ne \emptyset \right\} . \end{aligned}$$

\({\mathbb {H}}\big ({\mathbb {R}}^N\big )\) is usually referred to as the hyperspace of nonempty compact subsets of \({\mathbb {R}}^N\), and it is not difficult to see that, similarly to \(\big ({\mathbb {R}}^N,d\big )\), the pair  \(\big ({\mathbb {H}}\big ({\mathbb {R}}^N\big ),d_H\big )\)  is a complete metric space. Moreover, if \(A,B\in {\mathbb {H}}\big ({\mathbb {R}}^N\big )\), then it is easy to show that

$$\begin{aligned} d_H(A,B)\, \in \, \left\{ \varepsilon \ge 0: A\subseteq B_{\{\varepsilon \}}\, \text { and }\, B\subseteq A_{\{\varepsilon \}} \right\} , \end{aligned}$$
(2)

i.e., the infimum in (1) is actually a minimum.

Lastly, we need to recall here a basic result from algebraic combinatorics on words, because when we will draw conclusions in Sect. 5 we will have too few space. Classic references in the field are the first two Lothaire’s books (Lothaire 1983) and (Lothaire 2002).

Let A be an alphabet, i.e., a set of some distinct symbols called letters; a word w over A is a finite sequence of elements written

$$\begin{aligned} w\,=\, a_1a_2\ldots a_n \end{aligned}$$

with \(n\in {\mathbb {N}}^+\) and \(a_i\in A\). We also say that w has length n, and we write \(|w|=n\). The set \(A^+\) of all words over A, i.e.

$$\begin{aligned} A^+:=\big \{w=a_1a_2\ldots a_n : n\in {\mathbb {N}}^+ \text { and } a_i\in A\big \}, \end{aligned}$$

is a semigroup with the operation of concatenation, and if 1 denotes the empty word then \(A^*:=A^+\cup \{1\}\) is a free monoid (called the free monoid over A) because 1 acts as neutral element. A word \(w\in A^*\) is said to be primitive if it is not power of another word, i.e., if \(w\ne 1\) and \(w=u^n\) for some \(u\in A^*\) and \(n\in {\mathbb {N}}\) implies \(u=w\) and \(n=1\). The following result is a consequence of the so-called defect theorem (see in particular Lothaire 1983, Proposition 1.3.1) or can be also viewed as an immediate corollary of Fine and Wilf’s theorem (see Lothaire 1983, Proposition 1.3.5 or Lothaire 2002, Proposition 1.2.1).

Proposition 1

If  \(x^n=y^m\)  for some \(x,y\in A^*\) and \(n,m\in {\mathbb {N}}\), then x and y are both powers of some \(z\in A^*\).

In particular, for each word \(x\in A^+\) there exists a unique primitive word \(w\in A^+\) such that x is a power of w.

Let us make a few comments on the last claim in the previous proposition. If x is a nonempty word, it is rather obvious that there exists a primitive word \(w\in A^+\) such that x is a power of w (use, for example, a trivial induction argument on the length of x). Instead it is less obvious that if \(x=w^n=v^m\), with w and v primitive words, then \(w=v\): It follows from the first part of the same proposition.

3 Example: a deeper study on a “two-rule fractal”

As first example, we want to consider a sequence presented in the initiator paper (Sergeyev 2007) to blinking fractals: Here we will deepen its analysis from a geometrical point of view also making various computations that allow to prove some sharp results.

Fig. 1
figure 1

The first eight elements of the sequence \(\big \{S_n\big \}_n\), starting from \(S_0\), the square of side 1. In the left column, the elements of even index, that is blue, and in the right column those of odd index, red

From now on, we will often use the symbol I to denote the closed interval \([0,1]\subset {\mathbb {R}}\). We go to define a sequence of compact subsets \(\big \{S_n\big \}_{n\in {\mathbb {N}}}\) contained in \({\mathbb {R}}^2\) and, to have a clearer view of the constructive process, it is convenient to imagine the elements \(S_n\) with an even index n colored in blue and those with an odd index in red. The initial element \(S_0\) is the square \(I\times I\subset {\mathbb {R}}^2\), colored hence in blue, and the element \(S_1\) is given by

$$\begin{aligned} S_1:= \left\{ (x,y)\in {\mathbb {R}}^2: |x-1/2|+|y-1/2|\ge 1/2 \right\} \cap I^2, \end{aligned}$$

that is, the red area consisting of the four isosceles right triangles with side 1/2 positioned in the four corners of \(I^2\), as shown in Fig. 1b. To describe \(S_1\) by words, we could also say that it has a vague shape of a square-rhomboid frame (square externally and rhombus internally). Note, finally, that in the passage from the blue \(S_0\) to the red shape \(S_1\) we lose half of the area.

Consider now \(S_2\): It consists of 8 small squares of side 1/4 out of a total of 16 in which \(I^2\) is divided, as illustrated in Fig. 1c. In particular, there are four squares in the center and one in each corner. Note that in the passage from \(S_1\) to \(S_2\) we have no loss of area: All the red area of \(S_1\) is in fact transformed in the equivalent blue area of \(S_2\).

The process to obtain recursively the subsequent elements of \(\big \{S_n\big \}_n\) should be clear from Fig. 1. At the step 2t, \(t\in {\mathbb {N}}\), the unitary square \(I^2\) is divided into \(4^{2t}\) small squares of side \((1/4)^t\) each one; \(2^{3t}\) of them are blue and form \(S_{2t}\). Then, to obtain \(S_{2t+1}\), we only have to replace each blue square with a small red frame as in the transition from \(S_0\) to \(S_1\). And to get \(S_{2t+2}\), just replace each of the \(2^{3t}\) small red frames that make up \(S_{2t+1}\) with a blue shape like \(S_2\), but \(4^t\) times smaller.

To consider in future more complex model, we want to remark as our sequence \(\big \{S_n\big \}_n\) can also be viewed as the result of the successive application of two rules: \(R_1\) transforms a blue square of side l into a red frame like \(S_1\) with the same external side l, and \(R_2\) transforms a red frame F of side l into a blue shape like \(S_2\), with the same area and diameter of F (see Fig. 2).

Fig. 2
figure 2

The transformation rules \(R_1\) and \(R_2\). Using them, \(S_{2t+1}\) is obtained from the application of the rule \(R_1\) for each of the \(4^{2t}\) blue squares of side \(4^{-t}\) constituting \(S_{2t}\), and \(S_{2t+2}\) is given by applying the rule \(R_2\) at each of the \(4^{2t}\) red frames that make up \(S_{2t+1}\)

For convenience in our presentation and to consider separately the subsequences of \(\big \{S_n\big \}_n\) with odd and even indices, we set, for every \(n\in {\mathbb {N}}\),

$$\begin{aligned} A_n:=S_{2n+1} \qquad \text { and } \qquad B_n:=S_{2n}. \end{aligned}$$
(3)

The sequences \(\big \{A_n\big \}_n\) and \(\big \{B_n\big \}_n\) have different or common characteristics on dependence of the point of view, as we will see in the following. The simpler one is the second: It is in fact a nested sequence of closed subsets of \(I^2\), that is,

$$\begin{aligned} B_0\supset B_1\supset B_2\supset \ldots \supset B_n \supset B_{n+1} \supset \ldots \end{aligned}$$
(4)

Since each \(B_n\) is nonempty, the family \(\big \{B_n:n\in {\mathbb {N}}\big \}\) has the finite intersection property (FIP) and, as well-known in general topology, the intersection of all its elements \(\bigcap _{n\in {\mathbb {N}}} B_n\) is nonempty as well and belongs to \({\mathbb {H}}\big ({\mathbb {R}}^2\big )\). In this case, it is moreover obvious that the sequence \(\big \{B_n\big \}_n\) itself converges to the mentioned intersection which will be denoted by \({\mathcal {S}}\); in symbols

$$\begin{aligned} \lim _{n\rightarrow \infty } B_n\ =\ \bigcap _{n\in {\mathbb {N}}} B_n\ =:\ {\mathcal {S}}\, . \end{aligned}$$
(5)

It is very easy to visualize Sergeyev’s fractal \({\mathcal {S}}\) through the decreasing sequence (4): \({\mathcal {S}}\) has a shape that presents some vague similarities with the well-known Vicsek cross fractal and the Sierpiński carpet.

The former sequence \(\big \{A_n\big \}_{n\in {\mathbb {N}}}\) is even more interesting than \(\big \{B_n\big \}_{n\in {\mathbb {N}}}\) both because it seems unnoticed in the literature, and it is less evident that it yields a fractal; for instance, on the contrary of what observed in (4), this time there are no inclusion relations in the sense that

$$\begin{aligned} A_i\subseteq A_j \quad \text {for some} i,j\in {\mathbb {N}}\quad \Rightarrow \quad i=j\,, \end{aligned}$$
(6)

and the intersection \(\bigcap \limits _{n\in {\mathbb {N}}}\, A_n\) has little to do with the limit of the sequence \(\big \{A_n\big \}_{n\in {\mathbb {N}}}\), if it exists (see, for example, Fig. 3).

Fig. 3
figure 3

The second and third element of the sequence \(\left\{ \bigcap _{i=0}^n A_i\right\} _{n\in {\mathbb {N}}}\) for an immediate comparison with \(\big \{A_n\big \}_{n\in {\mathbb {N}}}\)

Recalling the definition of Hausdorff distance given in (1), we can state the following

Proposition 2

For all integers nm with \(m>n\ge 0\) we have

$$\begin{aligned} d_H\big (A_n,A_m\big )\, =\, \frac{\sqrt{2}}{4^{n+1}}\,. \end{aligned}$$
(7)

Proof

Consider first the case \(n=0\), and let \(m\ge 1\) be any fixed integer. Since \(A_m \subset I^2 \subseteq \big (A_0 \big )_{\left\{ \sqrt{2}/4 \right\} }\) and

$$\begin{aligned} \left( \frac{1}{2},\frac{1}{2}\right) \,\in \, A_m- \big (A_0\big )_{\left\{ \varepsilon \right\} } \,\ \text { for all\, } \varepsilon \in \bigg [0,\frac{\sqrt{2}}{4}\bigg [, \end{aligned}$$

then

$$\begin{aligned} \left\{ \varepsilon \ge 0: A_m \subseteq \big (A_0\big )_{\{\varepsilon \}}\right\} = \bigg [\frac{\sqrt{2}}{4},+\infty \bigg [. \end{aligned}$$
(8)

Let now Q be the subset of \(I^2\) formed by the 12 points as below

$$\begin{aligned} \begin{array}{lll} Q\, &{}=\,&{}\displaystyle \left\{ \left( \frac{1}{4},0\right) , \left( \frac{3}{4},0\right) , \right. \vspace{2mm}\\ &{}&{}\displaystyle \left( 0,\frac{1}{4}\right) , \left( \frac{1}{2},\frac{1}{4}\right) , \left( 1,\frac{1}{4}\right) , \vspace{2mm}\\ &{}&{}\displaystyle \left( \frac{1}{4},\frac{1}{2}\right) ,\left( \frac{3}{4},\frac{1}{2}\right) , \vspace{2mm}\\ &{}&{}\displaystyle \left( 0,\frac{3}{4}\right) , \left( \frac{1}{2},\frac{3}{4}\right) , \left( 1,\frac{3}{4}\right) , \vspace{2mm}\\ &{}&{}\displaystyle \left. \left( \frac{1}{4},1\right) , \left( \frac{3}{4},1\right) \right\} ; \end{array} \end{aligned}$$
(9)

since  \(A_0\subset I^2 \subset Q_{\{1/4\}}\)  and  \(Q\subset A_m\),  then  \(A_0 \subset Q_{\{1/4\}} \subset \big (A_m\big )_{\{1/4\}}\),  but note that we also have  \((1/2,0)\in A_0 - \big (A_m \big )_{\left\{ \varepsilon \right\} }\)  for all  \(\varepsilon \in [0,1/4[\). Therefore this means

$$\begin{aligned} \left\{ \varepsilon \ge 0: A_0 \subseteq \big (A_m \big )_{\{\varepsilon \}}\right\} = \bigg [\frac{1}{4},+\infty \bigg [ \end{aligned}$$
(10)

and, recalling (1) and (8), we conclude that

$$\begin{aligned} \begin{array}{lll} d_H\big (A_0,A_m\big )\, &{}=\,&{}\displaystyle \inf \left( \, \bigg [\frac{\sqrt{2}}{4},+\infty \bigg [ \cap \bigg [\frac{1}{4},+\infty \bigg [\, \right) \\ &{}=\,&{}\displaystyle \frac{\sqrt{2}}{4}, \end{array} \end{aligned}$$
(11)

for every \(m\in {\mathbb {N}}^+\).

Now consider the complementary case of \(n=0\) just examined: let \(m>n\ge 1\) be fixed integers and recall that \(A_n=S_{2n+1}\) is made up by \(2^{3n}\) red frames of (external) side length \(4^{-n}\). If \(F_i,\ i\in \big [1\mathrel {{.}\,{.}}2^{3n}\big ]\), is one of these frames then, in the transition from \(A_n\) to \(A_m\), \(F_i\) is replaced by a red shape \(G_i\) equal to \(A_{m-n}\) but \(4^n\) times smaller. From the case \(n=0\) discussed above, and in particular from (8) and (10), we immediately obtain

$$\begin{aligned} \begin{array}{lll} \displaystyle \left\{ \varepsilon \ge 0: G_i \subseteq \big (F_i\big )_{\{\varepsilon \}}\right\} \, &{}=\,&{}\displaystyle \frac{1}{4^n}\cdot \bigg [\frac{\sqrt{2}}{4},+\infty \bigg [ \, \\ &{}=\,&{}\displaystyle \bigg [\frac{\sqrt{2}}{4^{n+1}},+\infty \bigg [ \end{array} \end{aligned}$$

and

$$\begin{aligned} \begin{array}{lll}\displaystyle \left\{ \varepsilon \ge 0: F_i \subseteq \big (G_i\big )_{\{\varepsilon \}}\right\} \, &{}=\,&{}\displaystyle \frac{1}{4^n}\cdot \bigg [\frac{1}{4},+\infty \bigg [ \, \\ &{}=\,&{}\displaystyle \bigg [\frac{1}{4^{n+1}},+\infty \bigg [. \end{array}\end{aligned}$$

Since the \(\varepsilon \)-hull of a union of subsets is equal to the union of the \(\varepsilon \)-hulls, then

$$\begin{aligned} \begin{array}{lll}\displaystyle A_m\, &{}=\,&{}\displaystyle \bigcup _{i=1}^{2^{3n}} G_i \,\subseteq \, \bigcup _{i=1}^{2^{3n}} \big (F_i \big )_{\left\{ \sqrt{2}/4^{n+1}\right\} } \\ &{}=\,&{}\displaystyle \left( \, \bigcup _{i=1}^{2^{3n}} F_i\right) _{\left\{ \sqrt{2}/4^{n+1}\right\} } \,=\, \big (A_n\big )_{\left\{ \sqrt{2}/4^{n+1}\right\} } \end{array} \end{aligned}$$
(12)

and similarly

$$\begin{aligned} \begin{array}{lll}\displaystyle A_n\, &{}=\,&{}\displaystyle \bigcup _{i=1}^{2^{3n}} F_i \,\subseteq \, \bigcup _{i=1}^{2^{3n}} \big (G_i \big )_{\left\{ 1/4^{n+1}\right\} } \\ &{}=\,&{}\displaystyle \left( \, \bigcup _{i=1}^{2^{3n}} G_i\right) _{\left\{ 1/4^{n+1}\right\} } \,=\, \big (A_m\big )_{\left\{ 1/4^{n+1}\right\} } \,. \end{array} \end{aligned}$$
(13)

Now, considering the frame, say \(F_1\), inside the square \(\left[ 0,1/4^n\right] \times [0,1/4^n]\), note that its central point

$$\begin{aligned} \left( \frac{1}{2\cdot 4^n},\frac{1}{2\cdot 4^n}\right) \,\in \, A_m- \big (A_n\big )_{\left\{ \varepsilon \right\} } \end{aligned}$$

whenever  \(\varepsilon <\sqrt{2}\big /4^{n+1}\). This yields  \(A_m \not \subseteq \big (A_n\big )_{\{\varepsilon \}}\)  for all  \(\varepsilon <\sqrt{2}\big /4^{n+1}\),  and recalling (12) and (13) we finally conclude that  \(d_H\big (A_n,A_m\big ) = \sqrt{2}\big /4^{n+1}\)  for all  \(m>n\ge 1\). \(\square \)

A consequence of the previous proposition is that \(\big \{A_n\big \}_{n\in {\mathbb {N}}}\) is a Cauchy’s sequence in the complete hyperspace \({\mathbb {H}}\big ({\mathbb {R}}^2\big )\), and hence, it converges to some \({\mathcal {S}}\quad ' \in {\mathbb {H}}\big ({\mathbb {R}}^2\big )\). The use of Proposition 2 is not the shortest way to show that \(\big \{A_n\big \}_n\) converges, but it has several advantages such as that of providing the reader with an effective and easy tool to investigate the dynamics of other fractal processes. Moreover, Proposition 2 allows to treat the sequence \(\big \{A_n\big \}_n\) independently from \(\big \{B_n\big \}_n\) and will be a piece of the proof of Theorem 1 just as the next proposition will constitute another. As regards the fractal \({\mathcal {S}}\quad '\), it is actually equal to \({\mathcal {S}}\) and it is quick to prove directly. We instead prefer to wait and to see it as corollary of Theorem 1.

The next proposition establishes a twin formula of (7) for the nested sequence \(\big \{B_n\big \}_n\). The proof uses the same pattern and is easier than that of Proposition 2; in any case, we will give some details for completeness.

Proposition 3

For all \(n,m\in {\mathbb {N}},\ n<m\), we have

$$\begin{aligned} d_H\big (B_n,B_m\big )\, =\, \frac{1}{4^{n+1}}\,. \end{aligned}$$
(14)

Proof

Let first \(n=0\) and \(m\ge 1\) be fixed. If \(Q\subset I^2\) is the set defined in (9), we have  \(Q\subset B_m\)  and, consequently,  \(B_0 = I^2\subset Q_{\{1/4\}}\subset \big (B_m\big )_{\{1/4\}}\). But  \((1/2,0)\in B_0 - \big (B_m \big )_{\left\{ \varepsilon \right\} }\)  for all  \(\varepsilon \in [0,1/4[\), then we conclude that

$$\begin{aligned} d_H\big (B_0,B_m\big )\, =\, \frac{1}{4}. \end{aligned}$$

Let now \(m>n\ge 1\) be fixed. Recall that \(B_n=S_{2n}\) is constituted by \(2^{3n}\) squares of side length \(1/4^n\) and, if \(D_i,\ i\in \big [1\mathrel {{.}\,{.}}2^{3n}\big ]\), is one of them, then it is replaced, in the transition from \(B_n\) to \(B_m\), by a blue shape \(E_i\) similar to \(B_{m-n}\) with ratio \(1/4^n\). Since  \(D_i\subset \big (E_i\big )_{\{1/4^{n+1}\}}\), as in (13) we obtain  \(B_n\subset \big (B_m\big )_{\{1/4^{n+1}\}}\),  but observing that

$$\begin{aligned} \left( \frac{1}{2\cdot 4^n}, 0 \right) \,\in \, B_m- \big (B_n\big )_{\left\{ \varepsilon \right\} } \end{aligned}$$

for every  \(\varepsilon <1/4^{n+1}\),  we finally get  \(d_H\big (B_n,B_m\big ) = 1/4^{n+1}\)  for all  \(m>n\ge 1\). \(\square \)

A general formula for the distance of two elements of the original Sergeyev’s sequence \(\big \{S_n\big \}_{n\in {\mathbb {N}}}\) is given by the following theorem. During its proof, we will see as (15) reduces, when  \(n\equiv m\equiv 1\ ({{\,\mathrm{mod\,}\,}}2)\)  and  \(n\equiv m\equiv 0\ ({{\,\mathrm{mod\,}\,}}2)\)  respectively, to Formulas (7) and (14) stated for \(\big \{A_n\big \}_n\) and \(\big \{B_n\big \}_n\), resp.

Theorem 1

For all integers \(m>n\ge 0\) we have

$$\begin{aligned} d_H\big (S_n,S_m\big ) = \left( \sqrt{2}\right) ^{n - 6 \lfloor n/2 \rfloor -4 +\max \left\{ 0,\, 1+\lfloor n/2\rfloor -\lfloor m/2\rfloor \right\} }. \end{aligned}$$
(15)

Proof

Let  \(n=2t(n)+r(n)\)  and  \(m=2t(m)+r(m)\),  where \(t(n),t(m)\in {\mathbb {N}}\)  and  \(r(n),r(m)\in \{0,1\}\). First we distinguish four cases on dependence of r(n) and r(m), and then draw conclusions.

Case 1 If  \(r(n)=r(m)=0\)  then  \(n=2t(n)\)  and  \(m=2t(m)\),  and by Proposition 3 we have

$$\begin{aligned} \begin{array}{lll}\displaystyle d_H\big (S_{2t(n)},S_{2t(m)}\big )\, &{}=\,&{}\displaystyle d_H\big (B_{t(n)},B_{t(m)}\big ) \\ &{}=\,&{}\displaystyle \frac{1}{4^{t(n)+1}}\,. \end{array} \end{aligned}$$
(16)

Case 2 If  \(r(n)=r(m)=1\), i.e.,  \(n=2t(n)+1\)  and  \(m=2t(m)+1\),  by Proposition 2 we get

$$\begin{aligned} \begin{array}{lll}\displaystyle d_H\big (S_{2t(n)+1},S_{2t(m)+1}\big )\, &{}=\,&{}\displaystyle d_H\big (A_{t(n)},A_{t(m)}\big ) \\ &{}=\,&{}\displaystyle \frac{\sqrt{2}}{4^{t(n)+1}}\,. \end{array} \end{aligned}$$
(17)

Case 3 Let  \(r(n)=0\)  and  \(r(m)=1\),  i.e.,  \(n=2t(n)\)  and  \(m=2t(m)+1\). Since  \(S_{2t(n)}\supset S_{2t(m)+1}\),  we only have to find the minimum \(\varepsilon \) such that  \(S_{2t(n)}\subseteq \big (S_{2t(m)+1}\big )_{\{\varepsilon \}}\). For this purpose, we have to enlarge \(S_{2t(m)+1}\) in two directions: inward until the rhomboid holes of the \(2^{3t(m)}\) red frames constituting \(S_{2t(m)+1}\) are closed, and outwards until \(S_{2t(n)}\) is covered. The former minimum enlargement is given by

$$\begin{aligned} d_H\big (S_{2t(m)+1}, S_{2t(m)}\big ) \,=\, \frac{1}{4^{t(m)}}\cdot \frac{\sqrt{2}}{4} \,=\, \frac{\sqrt{2}}{4^{t(m)+1}} \end{aligned}$$

and the second by

$$\begin{aligned} d_H\big (S_{2t(m)}, S_{2t(n)}\big ) \,=\, \frac{1}{4^{t(n)+1}} \end{aligned}$$

(recall Proposition 3). Hence

$$\begin{aligned} \begin{array}{r}\displaystyle d_H\big (S_{2t(n)},S_{2t(m)+1}\big ) = \max \left\{ \frac{\sqrt{2}}{4^{t(m)+1}},\, \frac{1}{4^{t(n)+1}} \right\} \\ = {\left\{ \begin{array}{ll} \displaystyle \frac{\sqrt{2}}{4^{t(n)+1}} &{} \text {if }\ t(n)=t(m) \\ \displaystyle \frac{1}{4^{t(n)+1}} &{}\text {if }\ t(n)<t(m). \end{array}\right. } \end{array} \end{aligned}$$
(18)

Case 4 Let  \(r(n)=1\)  and  \(r(m)=0\),  i.e.,  \(n=2t(n)+1\)  and  \(m=2t(m)\).  The minimum \(\varepsilon \) such that  \(S_1\subseteq \big (S_{2t(m)}\big )_{\{\varepsilon \}}\)  is 1/4 \(\big (\)use, for example, the set Q defined in (9) to obtain  \(S_1 \subset I^2\subset Q_{\{1/4\}}\subset \big (S_{2t(m)}\big )_{\{1/4\}}\)  and note that  \(\varepsilon =1/4\)  is minimal\(\big )\), then the minimum \(\varepsilon \) which realizes  \(S_{2t(n)+1}\subseteq \big (S_{2t(m)}\big )_{\{\varepsilon \}}\)  is  \(\big (1\big /4^{t(n)}\big )\cdot 1/4=1\big /4^{t(n)+1}\). On the other hand, the minimum \(\varepsilon \) to get  \(S_{2t(m)}\subseteq \big (S_{2t(n)+1}\big )_{\{\varepsilon \}}\)  is  \(\big (1\big /4^{t(n)}\big )\cdot \sqrt{2}\big /4=\sqrt{2}\big /4^{t(n)+1}\),  hence

$$\begin{aligned} \begin{array}{lll}\displaystyle d_H\big (S_{2t(n)+1},S_{2t(m)}\big )\, &{}=\,&{}\displaystyle \max \left\{ \frac{1}{4^{t(n)+1}},\, \frac{\sqrt{2}}{4^{t(n)+1}} \right\} \\ &{}=\,&{}\displaystyle \frac{\sqrt{2}}{4^{t(n)+1}}\,. \end{array} \end{aligned}$$
(19)

Conclusions. Now we just have to summarize the Formulas (16)–(19), arising from the four different cases, in a new one, and it can be made as follows

$$\begin{aligned} \begin{array}{lll} \displaystyle d_H\big (S_n,S_m\big ) &{}=&{}\displaystyle d_H\big (S_{2t(n)+r(n)},S_{2t(m)+r(m)}\big ) \\ &{}=&{}\displaystyle \frac{\left( \sqrt{2}\,\right) ^{r(n)\,+\,\max \{0,\; 1\,+\,t(n)\,-\,t(m)\}}}{4^{t(n)+1}} \\ &{}=&{}\displaystyle \frac{\left( \sqrt{2}\,\right) ^{n - 2\lfloor n/2\rfloor + \max \{0,\, 1+ \lfloor n/2\rfloor - \lfloor m/2\rfloor \}}}{4^{ \lfloor n/2\rfloor +1}}\\ &{}=&{}\displaystyle \left( \sqrt{2}\right) ^{n - 6 \lfloor n/2\rfloor -4 +\max \left\{ 0,\, 1+\lfloor n/2\rfloor -\lfloor m/2\rfloor \right\} }, \end{array} \end{aligned}$$

where \(\lfloor x\rfloor \) denotes the floor of a real number x.\(\square \)

From Eq. (15), it follows immediately

$$\begin{aligned} \begin{array}{lllll}\displaystyle d_H\big (S_n,S_m\big )\ &{}\le \ &{}\displaystyle \left( \sqrt{2}\,\right) ^{n \,-\, 6 \lfloor n/2\rfloor \,-\,4 \,+\,1}\ \\ &{}\le \ &{}\displaystyle \left( \sqrt{2}\,\right) ^{n \,-\, 6(n\,-\,1)/2 \,-\,3 }\ &{}=\ &{} 2^{-n}, \end{array} \end{aligned}$$

hence \(\big \{S_n\big \}_{n\in {\mathbb {N}}}\) is a Cauchy sequence and converges to \({\mathcal {S}}\) defined in (5) because the subsequence \(\big \{S_{2n}\big \}_{n\in {\mathbb {N}}}\) converges to \({\mathcal {S}}\).

Lastly, let us now calculate the Hausdorff dimension of Sergeyev’s fractal \({\mathcal {S}}\). Many well-known techniques can be used to this purpose; for example, \({\mathcal {S}}\) can be very easily viewed as the attractor, or invariant set, of an iterated function system (IFS) consisting of 8 similarities all with ratio 1/4. Since it satisfies Moran’s open set condition, then the Hausdorff dimension \(\dim _H\), the box-counting dimension \(\dim _B\), and the similarity dimension \(\mathrm{s}\) are all equal and can be immediately computed as followsFootnote 2

$$\begin{aligned} \dim _H({\mathcal {S}}) \,=\, \dim _B({\mathcal {S}}) \,=\, \mathrm{s}({\mathcal {S}}) \,=\, \frac{\ln 8}{-\ln (1/4)} \,=\, \frac{3}{2}\,. \end{aligned}$$
Fig. 4
figure 4

The transformation rules \(S_C\) and \(S_M\). Both transform a square of area \(l^2\) to a shape, of different form, but with the same area equal to \(4l^2/9\)

4 A “three-rule fractal”

Now we describe a fractal based on the cyclic application of three rules, \(S_C,\ S_M\) and P, acting on a sequence \(\big \{X_n\big \}_{n\in {\mathbb {N}}}\) of geometric shapes in the real plane. The rules act as follows.

  1. (i)

    Consider any square \(\varSigma \) of side l in the plane. \(S_C\) and \(S_M\) subdivide it in 9 smaller squares of side l/3, then \(S_C\) select the four of them in the corners of \(\varSigma \), instead \(S_M\) takes the middle square for each side of \(\varSigma \), as shown in Fig. 4a, b, respectively.

  2. (ii)

    To get P we need to define a family of actions \(\{P_i:i\in {\mathbb {N}}^+\}\) as follows. Consider the unit square \(I^2\) as consisting of 9 smaller squares \(\varSigma ^1_1, \varSigma ^1_2, \ldots , \varSigma ^1_9\) of side 1/3 and disposed anticlockwise starting from \(\varSigma ^1_1\) with center in (1/6, 1/6), \(\varSigma ^1_2\) centered in (1/2, 1/6), and so on until \(\varSigma ^1_8\) with center in (1/6, 1/2), and lastly the central square \(\varSigma ^1_9\) (see Fig. 5a). \(P_1\) acts on the \(\varSigma ^1_i\) as the cycle \(\gamma =(1,2,3,4,5,6,7,8)\) belonging to the symmetric group \(\mathrm{Sym}(9)\) acts on \([1\mathrel {{.}\,{.}}9]\). In other words,

    $$\begin{aligned} P_1\left( \varSigma ^1_i\right) \, :=\, \varSigma ^1_{\gamma (i)}\, =\, {\left\{ \begin{array}{ll} \varSigma ^1_{i+1} &{}\text {if }\, i\in [1\mathrel {{.}\,{.}}7], \\ \varSigma ^1_1 &{}\text {if }\, i=8, \\ \varSigma ^1_9 &{}\text {if }\, i=9. \end{array}\right. } \end{aligned}$$
    (20)

    Therefore, if A is a subcollection of \(\big \{\varSigma ^1_i:i\in [1\mathrel {{.}\,{.}}9]\big \}\), the meaning of \(P_1(A)\) is clear. For any \(i\in [1\mathrel {{.}\,{.}}9]\) consider now the square \(\varSigma ^1_i\) as consisting of 9 smaller squares \(\varSigma ^2_{i,1}, \varSigma ^2_{i,2}, \ldots , \varSigma ^2_{i,9}\) of side \(1/3^2\); \(P_2\) acts on the \(\varSigma ^2_{i,j}\) as \(P_1\) acts on the \(\varSigma ^1_i\), i.e., through the permutation \(\gamma \); more precisely we set

    $$\begin{aligned} P_2\left( \varSigma ^2_{i,j}\right) \ :=\ \varSigma ^2_{i,\gamma (j)} \end{aligned}$$
    (21)

    for all \(i,j\in [1\mathrel {{.}\,{.}}9]\). For any \(t\in {\mathbb {N}}^+\), we continue in this way to introduce inductively the notation \(\varSigma ^t_{i_1,i_2,\ldots ,i_t}\), where the superscript t means that they are square of side length \(1/3^t\) and the subscripts \(i_1,i_2,\ldots ,i_t\) (or the t-tuple \((i_1,i_2,\ldots ,i_t)\) if one prefers) are the “coordinates” for the position of the square.Footnote 3\(P_t\) hence acts in the obvious way as seen in (20) and (21) for the special cases \(t=1\) and \(t=2\), respectively; we in fact define

    $$\begin{aligned} P_t\left( \varSigma ^t_{i_1,i_2,\ldots ,i_t} \right) \ :=\ \varSigma ^t_{i_1,i_2,\ldots , \gamma (i_t)} \end{aligned}$$

    for all \(t\in {\mathbb {N}}^+\) and \(i_1,i_2,\ldots ,i_t\in [1\mathrel {{.}\,{.}}9]\). We are now ready to describe P which acts on the squares \(\varSigma ^t_{i_1,i_2,\ldots ,i_t}\) at different levels likewise a “composition” of the \(P_i\). Formally, for all \(t\in {\mathbb {N}}^+\) and \(i_1,i_2,\ldots ,i_t\in [1\mathrel {{.}\,{.}}9]\), we set

    $$\begin{aligned} P\left( \varSigma ^t_{i_1,i_2,\ldots ,i_t}\right) \ :=\ \varSigma ^t_{\gamma (i_1),\gamma (i_2),\ldots ,\gamma (i_t)}\,. \end{aligned}$$
    (22)
Fig. 5
figure 5

In a it is shown as the unit square \(I^2\) is subdivided into 9 squares \(\varSigma ^1_i,\ i\in [1\mathrel {{.}\,{.}}9]\), of side length 1/3. In b, the arrows represent the action of \(P_1\). In Subfigure c, it is schematically illustrated the action of \(P_2\)

We now define the sequence \(\big \{X_n\big \}_{n\in {\mathbb {N}}}\) by using alternatively the rules defined in (i) and (ii), organized in a “4-cycle” as follows

$$\begin{aligned} S_C,\ P,\ S_M,\ P,\quad S_C,\ P,\ S_M,\ P,\quad \text {etc.} \end{aligned}$$
(23)

We start by setting \(X_0:=I^2\), and then we continue recursively by using the sequence (23) as below

$$\begin{aligned} \begin{array}{lll} X_1\, &{}:=\,&{} S_C(X_0), \\ X_2 &{}:=&{} P(X_1)=(P\circ S_C)(X_0), \\ X_3 &{}:=&{} S_M(X_2) =(S_M\circ P\circ S_C)(X_0), \\ X_4 &{}:=&{} P(X_3)=(P\circ S_M\circ P\circ S_C)(X_0), \\ X_5 &{}:=&{} S_C(X_4)=(S_C\circ P\circ S_M\circ P\circ S_C)(X_0), \\ \text {etc.} \end{array} \end{aligned}$$
(24)

The first few elements of the sequence \(\big \{X_n\big \}_n\) are shown in Figs. 6, 7 and 8.

Fig. 6
figure 6

The first four elements of the sequence \(\big \{X_n\big \}_{n\in {\mathbb {N}}}\) starting from \(X_0=I^2\)

Fig. 7
figure 7

Continuing Fig. 6, here are represented the successive six elements of the sequence \(\big \{X_n\big \}_{n\in {\mathbb {N}}}\), that is, from \(X_4\) to \(X_9\)

Fig. 8
figure 8

The element \(X_9\) is rather difficult to visualize in Fig. 7f, and it is increasingly difficult for the subsequent elements in the sequence \(\big \{X_n\big \}_{n\in {\mathbb {N}}}\). Being \(X_9\) made up by four copies of \(X_8\) placed in the corners of \(I^2\), the reader may find it helpful to represent \(X_9\) as in (a). Similarly, \(X_{10},\ X_{11}\) and \(X_{12}\) can be visualized through four copies of \(X_7, X_{10}\) and \(X_9\) arranged as in (b)–(d), respectively, and so on from \(X_{13}\) onwards

Let \(\big \{C_n\big \}_{n\in {\mathbb {N}}}\) and \(\big \{Y_n\big \}_{n\in {\mathbb {N}}}\) be the subsequences of \(\big \{X_n\big \}_{n\in {\mathbb {N}}}\) obtained by setting

$$\begin{aligned} C_n\,:=\,X_{n+2\lfloor n/2\rfloor } \quad \text { and } \quad Y_n\,:=\,X_{n+2\lfloor n/2\rfloor +2} \end{aligned}$$
(25)

for all \(n\in {\mathbb {N}}\). Note that the sets \(\big \{C_n:n\in {\mathbb {N}}\big \}\) and \(\big \{ Y_n:n\in {\mathbb {N}}\big \}\) are disjoint and their union is the whole family \(\big \{X_n:n\in {\mathbb {N}}\big \}\). As way of example, their first few elements are

$$\begin{aligned} \begin{array}{lllll} C_0=X_0, &{} C_1=X_1, &{} C_2=X_4, &{} C_3=X_5, \\ C_4=X_8, &{} C_5=X_9, &{} C_6=X_{12}, &{} C_7=X_{13}, &{} \text {etc.}, \end{array} \end{aligned}$$

and

$$\begin{aligned} \begin{array}{lllll} Y_0=X_2, &{} Y_1=X_3, &{} Y_2=X_6, &{} Y_3=X_7, \\ Y_4=X_{10}, &{} Y_5=X_{11}, &{} Y_6=X_{14}, &{} Y_7=X_{15}, &{} \text {etc.}, \end{array} \end{aligned}$$

respectively.

Remark 2

It is immediate to recognize that the sequence \(\big \{C_n\big \}_n\) is the standard one to construct the 2-dimensional Cantor dust C which is the plane, i.e., 2-dimensional version of the best known Cantor set contained in the interval [0, 1]. The subsequence \(\big \{Y_n\big \}_n\), instead, converges to a fractal Y that has a “dust form” like C but is different and, actually, very far from it as the following proposition specifies.

Proposition 4

We have  \(d_H(C,Y)=\sqrt{5}\big /6\).

Proof

Considering the set

$$\begin{aligned} Q'=\left\{ \left( \frac{1}{3},\frac{1}{6}\right) , \left( \frac{2}{3},\frac{1}{6}\right) , \left( \frac{1}{3},\frac{5}{6}\right) , \left( \frac{2}{3},\frac{5}{6}\right) \right\} \subset Y \end{aligned}$$

we easily get  \(C\subset \big (Q'\big )_{\{\sqrt{5}/6\}} \subset \big (Y\big )_{\{\sqrt{5}/6\}}\). But if we define

$$\begin{aligned} W:=\left\{ (x,y)\in {\mathbb {R}}^2: y\ge \frac{1}{2}-x \,\wedge \, \left( x\ge \frac{1}{3} \,\vee \, y\ge \frac{1}{3}\right) \right\} \end{aligned}$$

we also have \(Y\subset W\) and, consequently, \(d\big ((0,0),Y\big ) \ge d\big ((0,0),W\big )= d\big ((0,0),(1/3,1/6)\big )=\sqrt{5}\big /6\) (where the distance d(aB) is defined as usual to be \(\inf \{d(a,b):b\in B\}\) for all \(a\in {\mathbb {R}}^2\) and \(B\subseteq {\mathbb {R}}^2\)). Therefore \((0,0)\in C-W_{\{\varepsilon \}}\subset C-Y_{\{\varepsilon \}}\)  for all  \(\varepsilon <\sqrt{5}\big /6\), and we obtain \(\inf \big \{\varepsilon >0:C\subset \{Y\}_{\{\varepsilon \}}\big \}=\sqrt{5}\big /6\).

On the other hand, for example, \(Y\subset C_{\{1/3\}}\) is trivial, then we conclude that  \(d_H(C,Y)=\sqrt{5}\big /6\)  as we wanted. \(\square \)

As regards the Hausdorff dimension it is trivial that  \(\dim _HC=\dim _HY=\ln 4/\ln 3\approx 1.26\).

Example 1

Multi-rule fractals are very interesting to investigate in less elementary or easy cases than the previous one. It is important to observe that the greater number of rules does not correspond to a more complex fractal in general: the reader, for example, can study the sequence \(\big \{Z_n\big \}_{n\in {\mathbb {N}}}\), produced by the previous system by using only the first two of the three rules \(S_C,\, P\) and \(S_M\), i.e., starting from  \(Z_0=I^2\)  and applying successively  \(S_C,\, P,\ \ S_C,\, P,\ \ S_C,\, P\),  and so on.

5 Conclusions and future work

The sequences \(\big \{S_n\big \}_{n\in {\mathbb {N}}}\) and \(\big \{X_n\big \}_{n\in {\mathbb {N}}}\), studied respectively in Sects. 3 and 4, could both be called “blinking sequences” because they exhibit two alternating geometric shapes. To make a really skinny simplification, they behave similarly to the following two real sequences

$$\begin{aligned} s_n\,=\,(-1)^n\frac{1}{1+n},\ \ n\in {\mathbb {N}}, \end{aligned}$$
(26)

and

$$\begin{aligned} x_n\,=\,(-1)^{\lfloor n/2\rfloor }\left( 2-\frac{1}{1+n}\right) ,\ \ n\in {\mathbb {N}}; \end{aligned}$$

both \(\big \{s_n\big \}_{n\in {\mathbb {N}}}\) and \(\big \{x_n\big \}_{n\in {\mathbb {N}}}\) present alternatively positive and negative terms, but while the former converges to a limit \(s=0\) likewise \(\big \{S_n\big \}_{n\in {\mathbb {N}}}\) converges to \({\mathcal {S}}\), the second has two main subsequences convergent respectively to 2 and \(-2\) likewise \(\big \{X_n\big \}_{n\in {\mathbb {N}}}\) has two subsequences \(\big \{C_n\big \}_{n\in {\mathbb {N}}}\) and \(\big \{Y_n\big \}_{n\in {\mathbb {N}}}\) convergent to C and Y, respectively.

From the examples and all the discussion made from the previous sections until now, we therefore propose the following definition.Footnote 4

Definition 1

A blinking fractal \({\mathcal {B}}\) of order \(m\in {\mathbb {N}}^+\) is simply an m-tuple of (not necessarily distinct) traditional fractals

$$\begin{aligned} {\mathcal {B}}\,=\,({\mathcal {B}}_1,{\mathcal {B}}_2,\ldots ,{\mathcal {B}}_m)\, \in \, \left( {\mathbb {H}}\left( {\mathbb {R}}^N \right) \right) ^m \end{aligned}$$
(27)

such that the word \({\mathcal {B}}_1{\mathcal {B}}_2\ldots {\mathcal {B}}_m\) is primitive (recall the last part of Sect. 2).

A traditional fractal can be viewed as a blinking fractal of order 1, called also a simple fractal. For example, Sergeyev’s fractal \({\mathcal {S}}\), analyzed in Sect. 3, is a blinking fractal of order 1, while the one presented in Sect. 4 is a blinking fractal \({\mathcal {B}}\) of order 2 that can be written \({\mathcal {B}}=(C,Y)\).

It is important to note that in virtue of the unicity stated in Proposition 1, the order m of a blinking fractal is well defined.

Example 2

Consider the set of fractals \(\{C,Y\}\subset {\mathbb {H}}\big ({\mathbb {R}}^2\big )\) defined in the previous section. We can obviously form

  • 2 blinking fractals of order 1 as well as 2 blinking fractals of order 2 \(\big ({\mathcal {B}}=(C,Y)\) is in fact distinct from \({\mathcal {B}}'=(Y,C)\big )\);

  • \(2^4-4=12\) blinking fractals of order 4 \(\big (\)in fact the writings (CCCC), (YYYY), (CYCY) and (YCYC) do not represent a blinking fractal\(\big )\);

  • \(2^3-2=6\) blinking fractals of order 3,  \(2^5-2=30\) blinking fractals of order 5,  etc.

See Proposition 5 below for a general formula that counts the number of blinking fractals.

The study of multi-rule and blinking fractals seems very interesting both from a pure mathematical point of view and for applications, and much work can be done in this direction in our opinion. Just as a small example, the following questions arise immediately considering the sequence \(\big \{Z_n\big \}_{n\in {\mathbb {N}}}\) defined in Example 2, and many other multi-rule sequences can be evaluated and investigated.

  1. (i)

    Does the sequence \(\big \{Z_n\big \}_{n\in {\mathbb {N}}}\) generate a blinking fractal?

  2. (ii)

    If yes, of which order?

Also from an applied point of view, blinking fractals seem rich of applications in many fields. Just to stay in the hydraulic one, remember what was mentioned in the Introduction about water demand in urban centers. In our experience, it is easy to find recurrent fractal-like patterns on different sizes and time scales, also very small, in the water demands, and we think that some rather jagged plottings are in part due to the speed with which modern taps with lever control and ball valve act within the individual users. Then, in this context, it could be of great help for the description and interpretation of data and dynamics of a complex network, a model that uses blinking fractals of order 24 or more, on a daily basis, or of order a multiple of 7 (e.g., 168) on a weekly basis, etc. Similarly, one could think that most of the human activities, within the alternation between rest and work, could be studied or approximated by models that use blinking fractals with order some multiples of 24 and 7 as before, on dependence from the observations.

Finally, some conclusions must be also drawn on the relationships between our Definition 1 and the paper (Sergeyev 2007) where the idea of cyclicity and periodicity associated with fractals is originally proposed. First of all, in Sergeyev (2007) the notion of order of a blinking fractal is not defined and, indeed, our Definition 1 is completely inapplicable in that context. This because all this paper and our discussion is based on classical mathematics which uses heavily the concept of limit \(\big (\)in fact, Sects. 3, 4 and Definition 1 consider and investigate the limit behavior, in the usual sense of fractal geometry, of a sequence of objects in the hyperspace \({\mathbb {H}}\big ({\mathbb {R}}^N\big )\big )\). Instead, on the contrary, in paper (Sergeyev 2007) the notion of limit does not exist at all because a different numerical system is used, and the idea of blinking fractal focuses there on the process that generates a fractal and not on the limit object such as \({\mathcal {S}},\ C\) or Y. In particular, our result on the convergence of Sergeyev’s sequence \(\big \{S_n\big \}_{n\in {\mathbb {N}}}\) does not contradict the discussion in Sergeyev (2007) where the sequence maintains its duplicity at infinity in a similar way to what happens for the sequence \(\big \{s_n\big \}_{n\in {\mathbb {N}}}\) defined in (26), which, if evaluated at infinity with the methodology used in Sergeyev (2007) gives rise to two opposite infinitesimals (one positive and the other negative),Footnote 5 while in this paper and in Weierstrass analysis it converges to zero, as we already noted.

We end the paper by giving an enumerating formula for the number \(\nu _k(m)\) of blinking fractals of order m obtainable from a basic set \(\{{\mathcal {F}}_1,{\mathcal {F}}_2, \ldots ,{\mathcal {F}}_k\}\) of k distinct simple fractals. For this purpose we recall that in number theory the Möbius function \(\mu :{\mathbb {N}}^+\rightarrow \{-1,0,1\}\) is defined by

$$\begin{aligned} \mu (n)\, =\, {\left\{ \begin{array}{ll}1 &{}\text {if } n=1,\\ (-1)^t &{}\text {if n is the product of t distinct}\\ &{}\text {prime numbers},\\ 0 &{}\text {if n has some multiple prime factor}, \end{array}\right. } \end{aligned}$$

or, equivalently, \(\mu (n)\) can be defined as the sum of the primitive nth roots of unity (cf. the definition of primitive word in Sect. 2).

Proposition 5

For every \(k,m\in {\mathbb {N}}^+\) we have

$$\begin{aligned} \nu _k(m)\ =\ \sum _{d|m} \mu (d)\cdot k^{m/d}, \end{aligned}$$
(28)

where the sum runs over the positive divisors d of m.

Proof

The proof is a standard application of Möbius inversion (cf., for example, Lothaire 1983, Section 1.3) and, in short, it boils down to recognizing that, fixed k belonging to \({\mathbb {N}}^+\), the sequence \(\big \{k^m\big \}_{m\ge 1}\) is the Möbius transform of \(\big \{\nu _k(m)\big \}_{m\ge 1}\) .Footnote 6 To give some details recall that, in virtue of Definition 1 and Proposition 1, an m-tuple built with elements belonging to a set of k distinct simple fractals uniquely identifies a blinking fractal of order a divisor d of m, hence we have

$$\begin{aligned} k^m\ =\ \sum _{d|m}\nu _k(d). \end{aligned}$$

Using Möbius inversion formula (see, for instance, Apostol 1976, Theorem 2.9 or Schroeder 2009, Chap. 21), we then get (28). \(\square \)

Example 3

Using (28) the reader can trivially recover the values in Example 2 or can compute, for instance, the number of blinking fractals of order 12 over the set \(\{{\mathcal {F}}_1,{\mathcal {F}}_2,{\mathcal {F}}_3\}\), obtaining

$$\begin{aligned} \begin{array}{lllll} \displaystyle \nu _3(12) &{}=&{} \displaystyle \sum _{d|12} \mu (d)\cdot 3^{12/d} \\ &{}=&{}\displaystyle \mu (1)\cdot 3^{12} +\mu (2)\cdot 3^{6} +\mu (3)\cdot 3^{4} \\ &{}&{} \displaystyle +\mu (4)\cdot 3^{3} +\mu (6)\cdot 3^{2} +\mu (12)\cdot 3^{1} \\ &{}=&{}\displaystyle 3^{12} -3^{6} -3^{4} +3^{2} &{}=&{}\displaystyle 530\,640. \end{array} \end{aligned}$$