Skip to main content
Springer logoLink to Springer
. 2019 Oct 25;82(3):429–508. doi: 10.1007/s00453-019-00631-3

Asymptotic Analysis of Regular Sequences

Clemens Heuberger 1, Daniel Krenn 1,
PMCID: PMC7004440  PMID: 32109975

Abstract

In this article, q-regular sequences in the sense of Allouche and Shallit are analysed asymptotically. It is shown that the summatory function of a regular sequence can asymptotically be decomposed as a finite sum of periodic fluctuations multiplied by a scaling factor. Each of these terms corresponds to an eigenvalue of the sum of matrices of a linear representation of the sequence; only the eigenvalues of absolute value larger than the joint spectral radius of the matrices contribute terms which grow faster than the error term. The paper has a particular focus on the Fourier coefficients of the periodic fluctuations: they are expressed as residues of the corresponding Dirichlet generating function. This makes it possible to compute them in an efficient way. The asymptotic analysis deals with Mellin–Perron summations and uses two arguments to overcome convergence issues, namely Hölder regularity of the fluctuations together with a pseudo-Tauberian argument. Apart from the very general result, three examples are discussed in more detail:

  • sequences defined as the sum of outputs written by a transducer when reading a q-ary expansion of the input;

  • the amount of esthetic numbers in the first N natural numbers; and

  • the number of odd entries in the rows of Pascal’s rhombus.

For these examples, very precise asymptotic formulæ are presented. In the latter two examples, prior to this analysis only rough estimates were known.

Keywords: Regular sequence, Mellin–Perron summation, Summatory function, Tauberian theorem, Transducer, Esthetic numbers, Pascal’s rhombus

Part I: Introduction

Synopsis: The Objects of Interest and the Result

In this paper, we study the asymptotic behaviour of the summatory function of a q-regular sequence x(n). At this point, we give a short overview of the notion of q-regular sequences1 and our main result.

One characterisation of a q-regular sequence is as follows: the sequence x(n) is said to be q-regular if there are square matrices A0,,Aq-1 and a vector-valued sequence v(n) such that

v(qn+r)=Arv(n)for0r<qandn0

and such that x(n) is the first component of v(n).

Regular sequences are intimately related to the q-ary expansion of their arguments. They have been introduced by Allouche and Shallit [2]; see also [3, Chapter 16]. Many special cases have been investigated in the literature; this is also due to their relation to divide-and-conquer algorithms. Moreover, every q-automatic sequence—those sequences are defined by finite automata—is q-regular as well. Take also a look at the book [3] for many examples.

Our main result is, roughly speaking, that the summatory function of a q-regular sequence x(n) has the asymptotic form

n<Nx(n)=j=1JNlogqλj(logN)kjkj!Φkj({logqN})+O(NlogqR) 1.1

as N for a suitable positive integer J, suitable constants λjC, suitable non-negative integers kj, a suitable R and 1-periodic continuous functions Φkj. The λj will turn out to be eigenvalues of C:=A0++Aq-1, the kj be related to the multiplicities of these eigenvalues and the constant R will be a bound for the joint spectral radius of the matrices A0,,Aq-1.

While (1.1) gives the shape of the asymptotic form, gathering as much information as possible on the periodic fluctuations Φkj is required to have a full picture. To this aim, we will give a description of the Fourier coefficients of the Φkj which allows to compute them algorithmically and therefore to describe these periodic fluctuations with high precision. In particular, this allows to detect non-vanishing fluctuations. Code2 is provided to compute the Fourier coefficients.

We close this introductory section by noting that the normalized sum 1Nn<Nx(n) enlightens us about the expectation of a random element of the sequence x(n) with respect to uniform distribution on the non-negative integers smaller than a certain N.

How to Read This Paper

This is a long (and perhaps sometimes technical) paper and not all readers might find the time to read it from the very beginning to the very end. We therefore outline reading strategies for various interests.

For the reader who wants to apply our results to a particular problem: Read Sect. 3.1 on the definition of q-regular sequences and Sect. 3.2 containing the main result in a condensed version which should cover most applications. These two sections also have a simple, illustrative and well-known running example. If it turns out that the refined versions of the results are needed, follow the upcoming paragraph below.

For the reader who still wants to apply our results to a particular problem but finds the condensed version insufficient, turn to the overview of the results (Sect. 4.1) and then continue with Sect. 6 where the notations and results are stated in full generality. Formulating them will need quite a number of definitions provided in Sect. 6.2. In order to cut straight to the results themselves, we will refrain from motivations and comments on these definitions and postpone those comments to Sect. 7.

For the reader who wants to determine the asympotics of a regular sequence instead of determining the asymptotics of the summatory function of the regular sequence, advice is given in Sect. 3.3.

For the reader who wants to read more about showcase applications of our method yielding new asymptotic results, additionally to Sect. 3 read Sect. 5 where an overview of the examples in this paper is given and then Part II where these examples are discussed in detail. For many more examples to which the methods can be applied, read the original papers [2, 4] and the book by Allouche and Shallit [3] which contain many examples of q-regular sequences.

For the reader who wants to compute the Fourier coefficients for a particular application, use the provided code. Read Part IV for more details, in particular, see Sect. 19 for some comments on how to decide whether fluctuations are constant or even vanish.

Moreover, for the reader who is interested in the background on the algorithmic aspects and details of the implementation of the actual computation, we also refer to Part IV; this part will also be useful for the reader who wants to review the code written for SageMath.

For the reader who is interested in the history of the problem, we refer to Sect. 4.4.

For the reader who wants to see a heuristic argument why everything works out, there is Sect. 4.2 where it is shown that once one does not care about convergence issues, the Mellin–Perron summation formula of order zero explains the result.

For the reader who wants to understand the idea of the proof, there is Sect. 4.3 with a high level overview of the proof how the above mentioned convergence issues with the Mellin–Perron summation formula can be overcome by a pseudo-Tauberian argument.

For the reader who wants to overcome convergence problems with the Mellin–Perron summation formula in other contexts involving periodic fluctuations, we note that the pseudo-Tauberian argument (Proposition 14.1) is completely independent of our application to q-regular sequences; the only prerequisite is the knowledge on the existence of the fluctuation and sufficient knowledge on analyticity and growth of the Dirichlet generating function. As a consequence, Theorem E has been formulated as an independent result and provisions have been made for several applications of the pseudo-Tauberian argument.

Finally, for the reader who wants to fully understand the proof: We have no other advice than reading the whole introduction, the whole Sect. 6 on results and the whole Part III on the proofs starting with a very short Sect. 11 where a few notations used throughout the proofs are fixed.

User-Friendly Main Result and a First Example Application

q-Regular Sequences

We start by giving a definition of q-regular sequences; see Allouche and Shallit [2]. Let q2 be a fixed integer and x be a sequence on Z0.3 Then x is said to be (C,q)-regular (briefly: q-regular or simply regular) if the C-vector space generated by its q-kernel

graphic file with name 453_2019_631_Equ190_HTML.gif

has finite dimension. In other words, x is q-regular if there are an integer D and sequences x1,,xD such that for every j0 and 0r<qj there exist complex numbers c1,,cD with

x(qjn+r)=c1x1(n)++cDxD(n)for alln0.

By Allouche and Shallit [2, Theorem 2.2], the sequence x is q-regular if and only if there exists a vector-valued sequence v whose first component coincides with x and there exist square matrices A0,,Aq-1Cd×d such that

v(qn+r)=Arv(n)for0r<qandn0. 3.1

This is called a q-linear representation of the sequence x.

The best-known example for a 2-regular function is the binary sum-of-digits function.

Example 3.1

For n0, let x(n)=s(n) be the binary sum-of-digits of n. We clearly have

x(2n)=x(n),x(2n+1)=x(n)+1 3.2

for n0. Indeed, we have

x(2jn+r)=x(n)+x(r)·1

for integers j0, 0r<2j and n0; i.e., the complex vector space generated by the 2-kernel is generated by x and the constant sequence n1.

Alternatively, we set v=(x,n1) and have

v(2n)=x(n)1=1001v(n),v(2n+1)=x(n)+11=1101v(n)

for n0. Thus (3.1) holds with

A0=1001,A1=1101.

At this point, we note that a linear representation (3.1) immediately leads to an explicit expression for x(n) by induction.

Remark 3.2

Let r-1r0 be the q-ary digit expansion4 of n. Then

x(n)=e1Ar0Ar-1v(0)

where e1=100.

Condensed Main Result

We are interested in the asymptotic behaviour of the summatory function X(N)=0n<Nx(n).

At this point, we give a simplified version of our results. We choose any vector norm ||·|| on Cd and its induced matrix norm. We set C:=0r<qAr. We choose R>0 such that Inline graphic holds for all 0 and r1,,r{0,,q-1}. In other words, R is an upper bound for the joint spectral radius of A0,,Aq-1. The spectrum of C, i.e., the set of eigenvalues of C, is denoted by σ(C). For λC, let m(λ) denote the size of the largest Jordan block of C associated with λ; in particular, m(λ)=0 if λσ(C). Finally, we consider the scalar-valued Dirichlet series X and the vector-valued Dirichlet series V defined by5

X(s)=n1n-sx(n)andV(s)=n1n-sv(n)

where v(n) is the vector-valued sequence defined in (3.1). Of course, X(s) is the first component of V(s). The principal value of the complex logarithm is denoted by log. The fractional part of a real number z is denoted by {z}:=z-z.

Theorem A

(User-friendly all-in-one theorem) With the notations above, we have

graphic file with name 453_2019_631_Equ4_HTML.gif 3.3

for suitable 1-periodic continuous functions Φλk. If there are no eigenvalues λσ(C) with |λ|R, the O-term can be omitted.

For |λ|>R and 0k<m(λ), the function Φλk is Hölder continuous with any exponent smaller than logq(|λ|/R).

The Dirichlet series V(s) converges absolutely and uniformly on compact subsets of the half plane Rs>logqR+1 and can be continued to a meromorphic function on the half plane Rs>logqR. It satisfies the functional equation

(I-q-sC)V(s)=1n<qn-sv(n)+q-s0r<qArk1-sk(rq)kV(s+k) 3.4

for Rs>logqR. The right-hand side of (3.4) converges absolutely and uniformly on compact subsets of Rs>logqR. In particular, V(s) can only have poles where qsσ(C).

For λσ(C) with |λ|>R, the Fourier series

Φλk(u)=Zφλkexp(2πiu)

converges pointwise for uR where the Fourier coefficients φλk are defined by the singular expansion6

x(0)+X(s)sλσ(C)|λ|>RZ0k<m(λ)φλk(s-logqλ-2πilogq)k+1 3.5

for Rs>logqR.

This theorem is proved in Sect. 15. We note:

  • We write Φλk({logqN}) to optically emphasise the 1-periodicity; technically, we have Φλk({logqN})=Φλk(logqN).

  • The arguments in the proof could be used to meromophically continue the Dirichlet series to the complex plane, but we do not need this result for our purposes. See [1] for the corresponding argument for automatic sequences.

  • Sometimes, it will be convenient to write (3.5) in the equivalent explicit formulation
    graphic file with name 453_2019_631_Equ7_HTML.gif 3.6
    In particular, this can be used to algorithmically compute the φλk.
  • Computing the Fourier coefficients φλk via the explicit formulation (3.6) by reliable numerical arithmetic (see Part IV for details) enables us to detect the non-vanishing of a fluctuation; see also the example below and in Sect. 8 (on sequences defined by transducers) for examples where the fluctuation of the leading term is in fact constant. There, additional arguments are required to actually prove this fact; see Sect. 19 for more details.

We come back to the binary sum of digits.

Example 3.3

(Continuation of Example 3.1) We have C=A0+A1=(2102). As A0 is the identity matrix, any product Ar1Ar has the shape A1k=(1k01) where k is the number of factors A1 in the product. This implies that R with Inline graphic may be chosen to be any number greater than 1. As C is a Jordan block itself, we simply read off that the only eigenvalue of C is λ=2 with m(2)=2.

Thus Theorem A yields

graphic file with name 453_2019_631_Equ191_HTML.gif

for suitable 1-periodic continuous functions Φ21 and Φ20.

In principle, we can now use the functional equation (3.4) to obtain the Dirichlet series X. Due to the fact that one component of v is the constant sequence where everything is known, it is more efficient to use an ad-hoc calculation for X by splitting the sum according to the parity of the index and using the recurrence relation (3.2) for x(n). We obtain

graphic file with name 453_2019_631_Equ192_HTML.gif

where the Hurwitz zeta function Inline graphic has been used. We get

graphic file with name 453_2019_631_Equ8_HTML.gif 3.7

As the sum of digits is bounded by the length of the expansion, we have Inline graphic. By combining this estimate with

graphic file with name 453_2019_631_Equ193_HTML.gif

we see that the sum in (3.7) converges absolutely for Rs>0 and is therefore analytic for Rs>0.

Therefore, the right-hand side of (3.7) is a meromorphic function for Rs>0 whose only pole is simple and at s=1 which originates from Inline graphic. Thus, X(s) is a meromorphic function for Rs>0 with a double pole at s=1 and simple poles at 1+2πilog2 for Z\{0}.

This gives us

graphic file with name 453_2019_631_Equ9_HTML.gif 3.8

by (3.6) and (3.7).

We conclude that

graphic file with name 453_2019_631_Equ194_HTML.gif

We will explain in Part IV how to compute rigorous numerical values for the Fourier coefficients, in our case those of the fluctuation Φ20 which can be deduced from (3.7). In this particular case of the binary sum-of-digits, simpler and even explicit expressions for the Fourier coefficients have been stated and derived by other authors: they can be obtained in our set-up by rewriting the residues of X(s) in terms of shifted residues of n1x(n)-x(n-1)n-s and by computing the latter explicitly; see [31, Proof of Corollary 2.5]. This yields the well-known result by Delange [9].

It will also turn out that (3.8) being a constant function is an immediate consequence of the fact that 01 is a left eigenvector of both A0 and A1 associated with the eigenvalue 1; see Theorem B.

Asymptotics of Regular Sequences

This article is written with a focus on the sequence of partial sums of a regular sequence. In this section, however, we explain how to use all material for the regular sequence itself.

Let x(N) be a q-regular sequence. We may rewrite it as a telescoping sum

x(N)=x(0)+n<N(x(n+1)-x(n)). 3.9

By [2, Theorems 2.5 and 2.6], the sequence of differences x(n+1)-x(n) is again q-regular. Conversely, it is also well-known that the summatory function of a q-regular sequence is itself q-regular. (This is an immediate consequence of [2, Theorem 3.1].)

Therefore, we might also start to analyse a regular sequence by considering it to be the summatory function of its sequence of differences as in (3.9). In this way, we can apply all of the machinery developed in this article.

We end this short section with some remarks on why focusing on the sequence of partial sums can be rewarding. When modelling a quantity by a regular sequences, its asymptotic behaviour is often not smooth, but the asymptotic behaviour of its summatory function is. Moreover, we will see throughout this work that from a technical perspective, considering partial sums is appropriate. Therefore, we adopt this point of view of summatory functions of q-regular sequences throughout this paper.

Overview of the Full Results and Proofs

Overview of the Results

We have already seen the main results collected in a user-friendly simplified version as Theorem A which was written down in a self-contained way in Sect. 3.2.

In Theorem B the assumptions are refined. In particular, this theorem uses the joint spectral radius R of the matrices in a linear representation of the sequence (instead of a suitable bound for this quantity in Theorem A). Theorem B states the contribution of each eigenvalue of the sum C of matrices of the linear representation—split into the three cases of smaller, equal and larger in absolute value than R, respectively. This is formulated in terms of generalised eigenvectors. As a consequence of this precise breakdown of contributions, Theorem C, which collects the different cases into one result, provides a condition on when the error term vanishes.

Theorem D brings up the full formulation of the functional equation of the Dirichlet series associated to our regular sequence. This is accompanied by a meromorphic continuation as well as bounds on the growth of the Dirichlet series along vertical lines (i.e., points with fixed real value). The analytic properties provided by Theorem D will be used to verify the assumptions of Theorem E.

Theorem E is in fact stated and proved very generally: it is not limited to Dirichlet series coming from matrix products and regular sequences, but it works for general Dirichlet series provided that periodicity and continuity properties of the result are known a priori. This theorem handles the Mellin–Perron summation and the theoretical foundations for the computation of the Fourier coefficients of the appearing fluctuations.

We want to point out that Theorem E can be viewed as a “successful” version of the Mellin–Perron summation formula of order zero. In fact, the theorem states sufficient conditions to provide the analytic justification for the zeroth order formula.

Note that there is another result shown in this article, namely a pseudo-Tauberian theorem for summing up periodic functions. This is formulated as Proposition 14.1, and all the details around this topic are collected in Sect. 14.1. This pseudo-Tauberian argument is an essential step in proving Theorem E.

Heuristic Approach: Mellin–Perron Summation

The purpose of this section is to explain why the formula (3.5) for the Fourier coefficients is expected. The approach here is heuristic and non-rigorous because we do not have the required growth estimates. See also [10].

By the Mellin–Perron summation formula of order 0 (see, for example, [18, Theorem 2.1]), we have

1n<Nx(n)+x(N)2=12πimax{logqR+2,1}-imax{logqR+2,1}+iX(s)Nsdss.

By Remark 3.2 and the definition of R, we have Inline graphic. Adding the summand x(0) to match our definition of X(N) amounts to adding Inline graphic. Shifting the line of integration to the left—we have no analytic justification that this is allowed—and using the location of the poles of X claimed in Theorem A yield

graphic file with name 453_2019_631_Equ195_HTML.gif

for some ε>0. Expanding Ns as

Ns=k0(logN)kk!Nlogqλ+2πilogq(s-logqλ-2πilogq)k

and assuming that the remainder integral converges absolutely yield

graphic file with name 453_2019_631_Equ196_HTML.gif

where mλ denotes the order of the pole of X(s)/s at logqλ+2πilogq and φλk is as in (3.5). (For λ=1 and k=0, the contribution of x(0) / s in (3.5) is absorbed by the error term Inline graphic here.)

Summarising, this heuristic approach explains most of the formulæ in Theorem A. Some details (exact error term and order of the poles) are not explained by this approach. A result “repairing” the zeroth order Mellin–Perron formula is known as Landau’s theorem; see [5, Sect. 9]. It is not applicable to our situation due to multiple poles along vertical lines which then yield the periodic fluctuations. Instead, we present Theorem E which provides the required justification (not by estimating the relevant quantities, but by reducing the problem to higher order Mellin–Perron summation). The essential assumption is that the summatory function can be decomposed into fluctuations multiplied by some growth factors such as in (3.3).

High Level Overview of the Proof

As we want to use Mellin–Perron summation in some form, we derive properties of the Dirichlet series associated to the regular sequence. In particular, we derive a functional equation which allows to compute the Dirichlet series and its residues with arbitrary precision (Theorem D).

We cannot directly use Mellin–Perron summation of order zero for computing the Fourier coefficients of the fluctuations of interest. As demonstrated in Sect. 4.2, however, our theorems coincide with the results which Mellin–Perron summation of order zero would give if the required growth estimates could be provided. Unfortunately, we are unable to prove these required growth estimates. Therefore, we have to circumvent the problem by applying a generalisation of the pseudo-Tauberian argument by Flajolet, Grabner, Kirschenhofer, Prodinger and Tichy [18].

In order to use this argument, we have to know that the asymptotic formula has the shape (3.3). Note that a successful application (not directly possible!) of Mellin–Perron summation of order zero would give this directly. Therefore, we first prove (3.3) and the existence of the fluctuations (Theorems BC). To do so, we decompose the problem into contributions of the eigenspaces of the matrix C=A0++Aq-1. The regular sequence is then expressed as a matrix product. Next, we construct the fluctuations by elementary means: We replace finite sums occurring in the summatory functions by infinite sums involving digits using the factorisation as a matrix product.

Then the pseudo-Tauberian argument states that the summatory function of the fluctuation is again a fluctuation and there is a relation between the Fourier coefficients of these fluctuations. The Fourier coefficients of the summatory function of the fluctuation, however, can be computed by Mellin–Perron summation of order one, so the Fourier coefficients of the original fluctuation can be recovered; see Theorem E.

Relation to Previous Work

The asymptotics of the summatory function of specific examples of regular sequences has been studied in [14, 23, 24]. There, various methods have been used to show that the fluctuations exist; then the original pseudo-Tauberian argument by Flajolet, Grabner, Kirschenhofer, Prodinger and Tichy [18] is used to compute the Fourier coefficients of the fluctuations.

The first version of the pseudo-Tauberian argument in Theorem E was provided in [18]: there, no logarithmic factors were allowed, only values γ with Rγ>0 were allowed and the result contained an error term of o(1) whereas we give a more precise error estimate in order to allow repeated application.

Dumas [12, 13] proved the first part of Theorem A using dilation equations. We re-prove it here in a self-contained way because we need more explicit results than obtained by Dumas (e.g., we need explicit expressions for the fluctuations) to explicitly get the precise structure depending on the eigenspaces (Theorem B). Notice that the order of factors in Dumas’ paper is inconsistent between his versions of (3.1) and Remark 3.2.

A functional equation for the Dirichlet series of an automatic sequence has been proved by Allouche, Mendès France and Peyrière [1].

In Sect. 8 we study transducers. The sequences there are defined as the output sum of transducer automata in the sense of [31]. They are a special case of regular sequences and are a generalisation of many previously studied concepts. In that case, much more is known (variance, limiting distribution, higher dimensional input); see [31] for references and results. A more detailed comparison can be found in Sect. 8. Divide and conquer recurrences (see [11, 32]) can also be seen as special cases of regular sequences.

The present article gives a unified approach which covers all cases of regular sequences. As long as the conditions on the joint spectral radius are met, the main asymptotic terms are not absorbed by the error terms. Otherwise, the regular sequence is so irregular that the summatory function is not smooth enough to allow a result of this shape.

Overview of the Examples

We take a closer look at three particular examples. In this section, we provide an overview of these examples; all details can be found in Part II.

At first gance it seems that these examples are straight-forward applications of the results. However, we have to reformulate the relevant questions in terms of a q-regular sequence and will then provide shortcuts for the computation of the Fourier series. We put a special effort on the details which gives additional insights like dependencies on certain residue classes; see Sect. 5.3. Moreover, the study of these examples also encourages us to investigate symmetries in the eigenvalues; see Sect. 5.4 for an overview and Sect. 6.6 for general considerations.

We start with transducer automata. Transducers have been chosen in order to compare the results here with the previously available results [31]. In some sense, the results complement each other: while the results in [31] also contain information on the variance and the limiting distribution, our approach here yields more terms of the asymptotic expansion of the mean, at least in the general case. Also, it is a class of examples.

We then continue with esthetic numbers. These numbers are an example of an automatic sequence, therefore can be treated by a transducer. However, it turns out that the generic results (the results here and in [31]) degenerate: they are too weak to give a meaningful main term. Therefore a different effort is needed for esthetic numbers. No precise asymptotic results were known previously.

The example on Pascal’s Rhombus is a choice of a regular sequence where all components of the vector sequence have some combinatorial meaning. Again, no precise asymptotic results were known previously.

Section 5.6 contains further examples. Note that there are the two additional Sects. 5.3 and 5.4 pointing out phenomena appearing in the analysis of our examples.

Transducers

The sum T(n) of the output labels of a complete deterministic finite transducer T when reading the q-ary expansion of an integer n has been investigated in [31]. As this can be seen as a q-regular sequence, we reconsider the problem in the light of our general results in this article; see Sect. 8. For the summatory function, the main terms corresponding to the eigenvalue q can be extracted by both results; if there are further eigenvalues larger than the joint spectral radius, our Corollary F allows to describe more asymptotic terms which are absorbed by the error term in [31]. Note, however, that our approach here does not give any readily available information on the variance (this could somehow be repaired for specific examples because regular sequences are known to form a ring) nor on the limiting distribution.

Esthetic Numbers

In this article, we also contribute a precise asymptotic analysis of q-esthetic numbers; see De Koninck and Doyon [8]. These are numbers whose q-ary digit expansion satisfies the condition that neighboring digits differ by exactly one. The sequence of such numbers turns out to be q-automatic, thus are q-regular and can also be seen as an output sum of a transducer; see the first author’s joint work with Kropf and Prodinger [31] or Sect. 8. However, the asymptotics obtained by using the main result of [31] is degenerated in the sense that the provided main term and second order term both equal zero; only an error term remains. On the other hand, using a more direct approach via our main theorem brings up the actual main term and the fluctuation in this main term. We also explicitly compute the Fourier coefficients. The full theorem is formulated in Sect. 9. Prior to this precise analysis, the authors of [8] only performed an analysis of esthetic numbers by digit-length (and not by the number itself).

The approach used in the analysis of q-esthetic numbers can easily be adapted to numbers defined by other conditions on the word of digits of their q-ary expansion.

Dependence on Residue Classes

The analysis of q-esthetic numbers also brings another aspect into the light of day, namely a quite interesting dependence of the behaviour with respect to q on different moduli:

  • The dimensions in the matrix approach of [8] need to be increased for certain residue classes of q modulo 4 in order to get a formulation as a q-automatic and q-regular sequence, respectively.

  • The main result in [8] already depends on the parity of q (i.e., on q modulo 2). This reflects our Corollary G by having 2-periodic fluctuations (in contrast to 1-periodic fluctuations in the main Theorem A).

  • Surprisingly, the error term in the resulting formula of Corollary G depends on the residue class of q modulo 3. This can be seen in the spectrum of the matrix C=0r<qAr: there is an appearance of an eigenvalue 1 in certain cases.

  • As an interesting side-note: In the spectrum of C, the algebraic multiplicity of the eigenvalue 0 changes again only modulo 2.

Symmetrically Arranged Eigenvalues

Fluctuations with longer periods (like in the second of the four bullet points above) come from a particular configuration in the spectrum of C. Whenever eigenvalues are arranged as vertices of a regular polygon, then their influence can be collected; this results in periodic fluctuations with larger period than 1. We elaborate on the influence of such eigenvalues in Sect. 6.6. This is then used in the particular cases of esthetic numbers and in conjunction with the output sum of transducers. More specifically, in the latter example this yields the second order term in Corollary F; see also [31].

Pascal’s Rhombus

Beside esthetic numbers, we perform an asymptotic analysis of the number of ones in the rows of Pascal’s rhombus. The rhombus is in some sense a variant of Pascal’s triangle—its recurrence is similar to that of Pascal’s triangle. It turns out that the number of ones in the rows of Pascal’s rhombus can be modelled by a 2-regular sequence.

The authors of [21] investigate this number of ones, but only for blocks whose number of rows is a power of 2. In the precise analysis in Sect. 10 we not only obtain the asymptotic formula, we also explicitly compute the Fourier coefficients.

Further Examples

There are many further examples of specific q-regular sequences which await precise asymptotic analysis, for example the Stern–Brocot sequence [39, A002487], the denominators of Farey tree fractions [39, A007306], the number of unbordered factors of length n of the Thue–Morse sequence (see [22]).

The Stern–Brocot sequence is a typical example: it is defined by x(0)=0, x(1)=1 and

x(2n)=x(n),x(2n+1)=x(n)+x(n+1), 5.1

i.e., the right-hand sides are linear combinations of shifted versions of the original sequence.

Note that recurrence relations like (5.1) are not proper linear representations of regular sequences in the sense of (3.1). The good news, however, is that in general, such a sequence is q-regular. The following remark formulates this more explicitly.

Remark 5.1

Let x(n) be a sequence such that there are fixed integers 0u and constants crk for 0r<q and ku such that

x(qn+r)=kucrkx(n+k)

holds for 0r<q and n0. Then the sequence x(n) is q-regular with q-linear representation for v(n)=(x(n+),,x(n),,x(n+u)) where

=qq-1,u=quq-1.

Note that if <0, then a simple permutation of the components of v(n) brings x(n) to its first component (so that the above is indeed a proper linear representation as defined in Sect. 3.1).

By using this remark on (5.1), we set v(n)=(x(n),x(n+1),x(n+2)) and obtain the 2-linear representation

v(2n)=100110010v(n),v(2n+1)=110010011v(n)

for n0 for the Stern–Brocot sequence.

Full Results

In this section, we fully formulate our results. As pointed out in Remark 3.2, regular sequences can essentially be seen as matrix products. Therefore, we will study these matrix products instead of regular sequences. Theorem A can then be proved as a simple corollary of the results for matrix products; see Sect. 15.

Problem Statement

Let q2, d1 be fixed integers and A0,,Aq-1Cd×d. We investigate the sequence f of d×d matrices such that

f(qn+r)=Arf(n)for0r<q,0nwithqn+r0 6.1

and f(0)=I.

Let n be an integer with q-ary expansion r-1r0. Then it is easily seen that (6.1) implies that

f(n)=Ar0Ar-1. 6.2

We are interested in the asymptotic behaviour of F(N):=0n<Nf(n).

Definitions and Notations

In this section, we give all definitions and notations which are required in order to state the results. For the sake of conciseness, we do not give any motivations for our definitions here; those are deferred to Sect. 7.

The following notations are essential:

  • Let ||·|| denote a fixed norm on Cd and its induced matrix norm on Cd×d.

  • We set Br:=0r<rAr for 0r<q and C:=0r<qAr.

  • The joint spectral radius of A0,,Aq-1 is denoted by
    graphic file with name 453_2019_631_Equ197_HTML.gif
    If the set of matrices A0,,Aq-1 has the finiteness property, i.e., there is an >0 such that
    graphic file with name 453_2019_631_Equ198_HTML.gif
    then we set R=ρ. Otherwise, we choose R>ρ in such a way that there is no eigenvalue λ of C with ρ<|λ|R.
  • The spectrum of C, i.e., the set of eigenvalues of C, is denoted by σ(C).

  • For a positive integer n0, let Fn0 be the matrix-valued Dirichlet series defined by
    Fn0(s):=nn0n-sf(n)
    for a complex variable s.
  • Set χk:=2πiklogq for kZ.

In the formulation of Theorems B and C, the following constants are needed additionally:

  • Choose a regular matrix T such that TCT-1=:J is in Jordan form.

  • Let D be the diagonal matrix whose jth diagonal element is 1 if the jth diagonal element of J is not equal to 1; otherwise the jth diagonal element of D is 0.

  • Set C:=T-1DJT.

  • Set K:=T-1DT(I-C)-1(I-A0).

  • For a λC, let m(λ) be the size of the largest Jordan block associated with λ. In particular, m(λ)=0 if λσ(C).

  • For m0, set
    ϑm:=1m!T-1(I-D)T(C-I)m-1(I-A0);
    here, ϑ0 remains undefined if 1σ(C).7
  • Define ϑ:=ϑm(1).

All implicit O-constants depend on q, d, the matrices A0,,Aq-1 (and therefore on ρ), as well as on R.

Decomposition into Periodic Fluctuations

Instead of considering F(N), it is certainly enough to consider wF(N) for all generalised left eigenvectors w of C, e.g., the rows of T. The result for F(N) then follows by taking appropriate linear combinations.

Theorem B

Let w be a generalised left eigenvector of rank m of C corresponding to the eigenvalue λ.

  1. If |λ|<R, then
    graphic file with name 453_2019_631_Equ199_HTML.gif
  2. If |λ|=R, then
    graphic file with name 453_2019_631_Equ200_HTML.gif
  3. If |λ|>R, then there are 1-periodic continuous functions Φk:RCd, 0k<m, such that
    wF(N)=wK+(logqN)mwϑm+Nlogqλ0k<m(logqN)kΦk({logqN})
    for Nqm-1. The function Φk is Hölder continuous with any exponent smaller than logq|λ|/R.
    If, additionally, the left eigenvector w(C-λI)m-1 of C happens to be a left eigenvector to each matrix A0,,Aq-1 associated with the eigenvalue 1, then
    Φm-1(u)=1qm-1(m-1)!w(C-qI)m-1
    is constant.

Here, wK=0 for λ=1 and wϑm=0 for λ1.

This theorem is proved in Sect. 12. Note that in general, the three summands in the theorem have different growths: a constant, a logarithmic term and a term whose growth depends essentially on the joint spectral radius and the eigenvalues larger than the joint spectral radius, respectively. The vector w is not directly visible in front of the third summand; instead, the vectors of its Jordan chain are part of the function Φk.

Expressing the identity matrix as linear combinations of generalised left eigenvalues and summing up the contributions of Theorem B essentially yields the following corollary.

Theorem C

With the notations above, we have

graphic file with name 453_2019_631_Equ201_HTML.gif

for suitable 1-periodic continuous functions Φλk. If 1 is not an eigenvalue of C, then ϑ=0. If there are no eigenvalues λσ(C) with |λ|ρ, then the O-term can be omitted.

For |λ|>R, the function Φλk is Hölder continuous with any exponent smaller than logq(|λ|/R).

This theorem is proved in Sect. 12.4.

Remark 6.1

We want to point out that the condition |λ|>R is inherent in the problem: Single summands f(n) might be as large as nlogqR and must therefore be absorbed by the error term in any smooth asymptotic formula for the summatory function.

Dirichlet Series

This section gives the required result on the Dirichlet series Fn0. For theoretical purposes, it is enough to study F:=F1; for numerical purposes, however, convergence improves for larger values of n0. This is because for large n0 and large Rs, the value of Fn0(s) is roughly n0-sf(n0); see also Part IV.

Theorem D

Let n0 be a positive integer. Then the Dirichlet series Fn0(s) converges absolutely and uniformly on compact subsets of the half plane Rs>logqρ+1, thus is analytic there.

We have

(I-q-sC)Fn0(s)=Gn0(s) 6.3

for Rs>logqρ+1 with

Gn0(s)=n0n<qn0n-sf(n)+q-s0r<qArk1-sk(rq)kFn0(s+k). 6.4

The series in (6.4) converge absolutely and uniformly on compact sets for Rs>logqρ. Thus (6.3) gives a meromorphic continuation of Fn0(s) to the half plane Rs>logqρ with possible poles at s=logqλ+χ for each λσ(C) with |λ|>ρ and Z whose pole order is at most m(λ).

Let δ>0. For real z, we set

μδ(z)=max{1-(z-logqρ-δ),0},

i.e., the linear function on the interval [logqρ+δ,logqρ+δ+1] with μδ(logqρ+δ)=1 and μδ(logqρ+δ+1)=0. Then

graphic file with name 453_2019_631_Equ16_HTML.gif 6.5

holds uniformly for logqρ+δRs and |qs-λ|δ for all eigenvalues λσ(C). Here, the implicit O-constant also depends on δ.

Note that by the introductory remark on Fn0(s), the infinite sum over k in (6.4) can be well approximated by a finite sum. Detailed error bounds are discussed in Part IV. Therefore the theorem allows to transfer the information on Fn0(s) for large Rs where convergence is unproblematical to values of s where the convergence of the Dirichlet series Fn0 itself is bad.

Remark 6.2

By the identity theorem for analytic functions, the meromorphic continuation of Fn0 is unique on the domain given in the theorem. Therefore, the bound (6.5) does not depend on the particular expression for the meromorphic continuation given in (6.3) and (6.4).

Theorem D is proved in Sect. 13. In the proof we translate the linear representation of f into a system of equations involving Fn0(s) and shifted versions like nn0f(n)(n+β)-s. We will have to bound the difference between the shifted and unshifted versions of the Dirichlet series. These bounds are provided by the following lemma. It will turn out to be useful to have it as a result listed in this section and not buried in the proofs sections.

Lemma 6.3

Let D(s)=nn0d(n)/ns be a Dirichlet series with coefficients Inline graphic for all R>ρ. Let βC with |β|<n0 and δ>0. Set

graphic file with name 453_2019_631_Equ202_HTML.gif

Then

graphic file with name 453_2019_631_Equ203_HTML.gif

where the series converges absolutely and uniformly on compact sets for Rs>logqρ, thus Inline graphic is analytic there. Moreover, with μδ as in Theorem D,

graphic file with name 453_2019_631_Equ204_HTML.gif

as |Is| holds uniformly for logqρ+δRslogqρ+δ+1.

Fourier Coefficients

As discussed in Sect. 4.2, we would like to apply the zeroth order Mellin–Perron summation formula but need analytic justification. In the following theorem we prove that whenever it is known that the result is a periodic fluctuation, the use of zeroth order Mellin–Perron summation can be justified. In contrast to the remaining parts of the paper, this theorem does not assume that f(n) is a matrix product.

Theorem E

Let f be a sequence on Z>0, let γ0R\Z0 and γC with Rγ>γ0, δ>0, q>1 be real numbers with δπ/(logq) and δ<Rγ-γ0, and let m be a positive integer. Moreover, let Φj be Hölder continuous (with exponent α with Rγ-γ0<α1) 1-periodic functions for 0j<m such that

graphic file with name 453_2019_631_Equ17_HTML.gif 6.6

for integers N.

For the Dirichlet series F(s):=n1n-sf(n) assume that

  • there is some real number σabsRγ such that F(s) converges absolutely for Rs>σabs;

  • the function F(s)/s can be continued to a meromorphic function for Rs>γ0-δ such that poles can only occur at γ+χ for Z and such that these poles have order at most m and a possible pole at 0; the local expansions are written as
    F(s)s=1(s-γ-χ)mj0φj(s-γ-χ)j 6.7
    with suitable constants φj for j, Z;
  • there is some real number η>0 such that for γ0Rsσabs and |s-γ-χ|δ for all Z, we have
    graphic file with name 453_2019_631_Equ19_HTML.gif 6.8
    for |Is|.

All implicit O-constants may depend on f, q, m, γ, γ0, α, δ, σabs and η.

Then

Φj(u)=Zφjexp(2πiu) 6.9

for uR, Z and 0j<m.

If γ0<0 and γ2πilogqZ, then F(0)=0.

This theorem is proved in Sect. 14. The theorem is more general than necessary for q-regular sequences because Theorem D shows that we could use some 0<η<1. However, it might be applicable in other cases, so we prefer to state it in this more general form.

Fluctuations of Symmetrically Arranged Eigenvalues

In our main results, the occurring fluctuations are always 1-periodic functions. However, if eigenvalues of the sum of matrices of the linear representation are arranged in a symmetric way, then we can combine summands and get fluctuations with longer periods. This is in particular true if all vertices of a regular polygon (with center 0) are eigenvalues.

Proposition 6.4

Let λC, and let k0 and p>0 be integers. Denote by Up the set of pth roots of unity. Suppose for each ζUp we have a continuous 1-periodic function

Φ(ζλ)(u)=Zφ(ζλ)exp(2πiu)

whose Fourier coefficients are

graphic file with name 453_2019_631_Equ205_HTML.gif

for a suitable function D.

Then

ζUpNlogq(ζλ)(logqN)kΦ(ζλ)({logqN})=Nlogqλ(logqN)kΦ(p{logqpN}) 6.10

with a continuous p-periodic function

graphic file with name 453_2019_631_Equ206_HTML.gif

whose Fourier coefficients are

graphic file with name 453_2019_631_Equ207_HTML.gif

Note that we again write Φ(p{logqpN}) to optically emphasise the p-periodicity. Moreover, the factor (logqN)k in (6.10) could be cancelled, however it is there to optically highlight the similarities to the main results (e.g.  Theorem A). The proof of Proposition 6.4 can be found in Sect. 16.

The above proposition will be used for proving Corollary F which deals with transducer automata; there, the second order term exhibits a fluctuation with possible period larger than 1. We will also use the proposition for the analysis of esthetic numbers in Sect. 9.

Remark 6.5

We can view Proposition 6.4 from a different perspective: A q-regular sequence is qp-regular as well (by [2, Theorem 2.9]). Then, all eigenvalues ζλ of the original sequence become eigenvalues λp whose algebraic multiplicity is the sum of the individual multiplicities but the sizes of the corresponding Jordan blocks do not change. Moreover, the joint spectral radius is also taken to the pth power. We apply, for example, Theorem A in our qp-world and get again 1-period fluctuations. Note that for actually computing the Fourier coefficients, the approach presented in the proposition seems to be more suitable.

Remarks on the Definitions

In this section, we give some motivation for and comments on the definitions listed in Sect. 6.2.

q-Regular Sequences Versus Matrix Products

We note one significant difference between the study of q-regular sequences as in (3.1) and the study of matrix products (6.2). The recurrence (3.1) is supposed to hold for qn+r=0, too; i.e. v(0)=A0v(0). This implies that v(0) is either the zero vector (which is not interesting at all) or that v(0) is a right eigenvector of A0 associated with the eigenvalue 1.

We do not want to impose this condition in the study of the matrix product (6.2). Therefore, we exclude the case qn+r=0 in (6.1). This comes at the price of the terms K, ϑm, ϑ in Theorem B which vanish if multiplied by a right eigenvector to the eigenvalue 1 of A0 from the right. This is the reason why Theorem A has simpler expressions than those encountered in Theorem B.

Joint Spectral Radius

Let

graphic file with name 453_2019_631_Equ208_HTML.gif

Then the submultiplicativity of the norm and Fekete’s subadditivity lemma [15] imply that limρ=inf>0ρ=ρ; cf. [37]. In view of equivalence of norms, this shows that the joint spectral radius does not depend on the chosen norm. For our purposes, the important point is that the choice of R ensures that there is an 0>0 such that ρ0R, i.e., ||Ar1Ar0||R0 for all rj{0,,q-1}. For any >0, we use long division to write =s0+r, and by submultiplicativity of the norm, we get ||Ar1Ar||Rs0ρrr and thus

graphic file with name 453_2019_631_Equ22_HTML.gif 7.1

for all rj{0,,q-1} and . We will only use (7.1) and no further properties of the joint spectral radius. Note that (6.2) and (7.1) imply that

graphic file with name 453_2019_631_Equ209_HTML.gif

for n.

As mentioned, we say that the set of matrices A0,,Aq-1, has the finiteness property if there is an >0 with ρ=ρ; see [34, 35].

Constants for Theorem B

In contrast to usual conventions, we write matrix representations of endomorphisms as multiplications xxM where x is a (row) vector in Cd and M is a matrix. Note that we usually denote this endomorphism by the corresponding calligraphic letter, for example, the endomorphism represented by the matrix M is denoted by M.

Consider the endomorphism C which maps a row vector xCd to xC and its generalised eigenspaces Wλ for λC. (These are the generalised left eigenspaces of C. If λσ(C), then Wλ={0}.) Then it is well-known that C|Wλ is an endomorphism of Wλ and that Cd=λσ(C)Wλ. Let T be the basis formed by the rows of T. Then the matrix representation of C with respect to T is J.

Let now D be the endomorphism of Cd which acts as identity on Wλ for λ1 and as zero on W1. Its matrix representation with respect to the basis T is D; its matrix representation with respect to the standard basis is T-1DT.

Finally, let C be the endomorphism C=CD. As C and D decompose along Cd=λσ(C)Wλ and D commutes with every other endomorphism on Wλ for all λ, we clearly also have C=DC. Thus the matrix representation of C with respect to T is DJ=JD; its matrix representation with respect to the standard basis is T-1DJT=C.

Now consider a generalised left eigenvector w of C. If it is associated to the eigenvalue 1, then wT-1DT=D(w)=0, wK=0 and wC=C(w)=0. Otherwise, that is, if w is associated to an eigenvalue not equal to 1, we have wT-1DT=D(w)=w, wC=C(w)=C(w)=wC, wCj=Cj(w)=Cj(w)=wCj for j0 and wϑm=0. Also note that 1 is not an eigenvalue of C, thus I-C is indeed regular. If 1 is not an eigenvalue of C, then everything is simpler: D is the identity matrix, C=C, K=(I-C)-1(I-A0) and ϑ=0.

Part II: Examples

In this part we investigate three examples in-depth. For an overview, we refer to Sect. 5 where some of the appearing phenomena are discussed as well. Further examples are also mentioned there.

Sequences Defined by Transducer Automata

We discuss the asymptotic analysis related to transducers; see also Sect. 5.1 for an overview.

Transducer and Automata

Let us start with two paragraphs recalling some notions around transducer automata. A transducer automaton has a finite set of states together with transitions (directed edges) between these states. Each transition has an input label and an output label out of the input alphabet and the output alphabet, respectively. A transducer is said to be deterministic and complete if for every state and every letter of the input alphabet, there is exactly one transition starting in this state with this input label.

A deterministic and complete transducer processes a word (over the input alphabet) in the following way:

  • It starts at its unique initial state.

  • Then the transducer reads the word letter by letter and for each letter
    • takes the transition with matching input label,
    • the output label is written, and
    • we proceed to the next state (according to the end of the transition).
  • Each state has a final output label that is written when we halt in this final state; we call a transducer with this property a subsequential transducer.

We refer to [6, Chapter 1] for a more detailed introduction to transducers and automata.

Now we are ready to start with the set-up for our example.

Sums of Output Labels

Let q2 be a positive integer. We consider a complete deterministic subsequential transducer T with input alphabet {0,,q-1} and output alphabet C; see [31]. For a non-negative integer n, let T(n) be the sum of the output labels (including the final output label) encountered when the transducer reads the q-ary expansion of n. Therefore, letters of the input alphabet will from now on be called digits.

This concept has been thoroughly studied in [31]: there, T(n) is considered as a random variable defined on the probability space {0,,N-1} equipped with uniform distribution. The expectation in this model corresponds (up to a factor of N) to our summatory function 0n<NT(n). We remark that in [31], the variance and limiting distribution of the random variable T(n) have also been investigated. Most of the results there are also valid for higher dimensional input.

The purpose of this section is to show that T(n) is a q-regular sequence and to see that the corresponding results in [31] also follow from our more general framework here. We note that the binary sum of digits considered in Example 3.1 is the special case of q=2 and the transducer consisting of a single state which implements the identity map. For additional special cases of this concept; see [31]. Note that our result here for the summatory function contains (fluctuating) terms for all eigenvalues λ of the adjacency matrix of the underlying digraph with |λ|>1 whereas in [31] only contributions of those eigenvalues λ with |λ|=q are available, all other contributions are absorbed by the error term there.

Some Perron–Frobenius Theory

We will need the following consequence of Perron–Frobenius theory. By a component of a digraph we always mean a strongly connected component. We call a component final if there are no arcs leaving the component. The period of a component is the greatest common divisor of its cycle lengths. The final period of a digraph is the least common multiple of the periods of its final components.

Lemma 8.1

Let D be a directed graph where each vertex has outdegree q. Let M be its adjacency matrix and p be its final period. Then M has spectral radius q, q is an eigenvalue of M and for all eigenvalues λ of M of modulus q, the algebraic and geometric multiplicities coincide and λ=qζ for some pth root of unity ζ.

This lemma follows from setting t=0 in [31, Lemma 2.3]. As [31, Lemma 2.3] proves more than we need here and depends on the notions of that article, we extract the relevant parts of [31] to provide a self-contained (apart from Perron–Frobenius theorem) proof of Lemma 8.1.

Proof

As usual, the condensation of D is the graph resulting from contracting each component of the original digraph to a single new vertex. By construction, the condensation is acyclic.

We choose a refinement of the partial order of the components given by the successor relation in the condensation to a linear order in such a way that the final components come last. Note that this implies that if there is an arc from one component to another, the former component comes before the latter component in our linear order. We then denote the components by C1,,Ck, Ck+1,,Ck+ where the first k components are non-final and the last are final. Without loss of generality, we assume that the vertices of the original digraph D are labeled such that vertices within a component get successive labels and such that the linear order of the components established above is respected.

Therefore, the adjacency matrix M is an upper block triagonal matrix of the shape

graphic file with name 453_2019_631_Equ210_HTML.gif

where Mj is the adjacency matrix of the component Cj.

Each row of the non-negative square matrix M has sum q by construction. Thus Inline graphic and therefore the spectral radius of M is bounded from above by q. As the all ones vector is obviously a right eigenvector associated with the eigenvalue q of M, the spectral radius of M equals q. The same argument applies to Mk+1,,Mk+.

By construction, the matrices Mk+1,,Mk+ are irreducible. For 1j all eigenvalues λ of Mk+j of modulus q have algebraic and geometric multiplicities 1 by Perron–Frobenius theory and λ=qζ for some pk+jth root of unity ζ where pk+j is the period of Ck+j.

By construction, the vertices of the components Cj for 1jk have out-degree at most q. We add loops to these vertices to increase their out-degree to q, resulting in C~j. The corresponding adjacency matrices are denoted by M~j. By the above argument, M~j has spectral radius q for 1jk. As MjM~j (component-wise) and MjM~j by construction, the spectral radius of Mj is strictly less than q by [20, Theorem 8.8.1].

A left eigenvector vj of Mk+j for 1j can easily be extended to a left eigenvector (0,,0,vj,0,,0) of M. This observation shows that the geometric multiplicity of any eigenvalue of M of modulus q is at least its algebraic multiplicity. This concludes the proof.

Analysis of Output Sums of Transducers

We consider the states of T to be numbered by {1,,d} for some positive integer d1 such that the initial state is state 1. We set Tj(n) to be the sum of the output labels (including the final output label) encountered when the transducer reads the q-ary expansion of n when starting in state j. By construction, we have T(n)=T1(n) and Tj(0) is the final output label of state j. We set y(n)=(T1(n),,Td(n)). For 0r<q, we define the d×d-dimensional {0,1}-matrix Pr in such a way that there is a one in row j, column k if and only if there is a transition from state j to state k with input label r. The vector or is defined by setting its jth coordinate to be the output label of the transition from state j with input label r.

For n01, we set

X(s)=n1n-sT(n),Yn0(s)=nn0n-sy(n),ζn0(s,α)=nn0(n+α)-s.

The last Dirichlet series is a truncated version of the Hurwitz zeta function.

Corollary F

Let T be a transducer as described at the beginning of this section. Let M be the adjacency matrix and p be the final period of the underlying digraph. For λC let m(λ) be the size of the largest Jordan block associated with the eigenvalue λ of M.

Then the sequence nT(n) is a q-regular sequence and

graphic file with name 453_2019_631_Equ23_HTML.gif 8.1

for some continuous p-periodic function Φ, some continuous 1-periodic functions Φλk for λσ(M) with 1<|λ|<q and 0k<m(λ) and some constant eT.

Furthermore,

Φ(u)=Zφexp(2πipu)

with

graphic file with name 453_2019_631_Equ211_HTML.gif

for Z. The Fourier series expansion of Φλk for λσ(M) with 1<|λ|<q is given in Theorem A.

The Dirichlet series Yn0 satisfies the functional equation

graphic file with name 453_2019_631_Equ24_HTML.gif 8.2

Note that the functional equation (8.2) is preferrable over the functional equation given in Theorem D for the generic case of a regular sequence: the generic functional equation suggests a double pole at s=1+χ for all Z whereas the occurrence of the Hurwitz zeta function in (8.2) shows that there is a double pole s=1 but single poles at s=1+χ for all Z\{0}. Numerically, the same occurrence of the Hurwitz zeta function is also advantageous because it allows to decouple the problem.

Proof of Corollary F

Proof of Corollary F

The proof is split into several steps.

Recursive Description. We set v(n)=(T1(n),,Td(n),1). For 1jd and 0r<q, we define t(jr) and o(jr) to be the target state and output label of the unique transition from state j with input label r, respectively. Therefore,

Tj(qn+r)=Tt(j,r)(n)+o(j,r) 8.3

for 1jd, n0, 0r<q with qn+r>0.

For 0r<q, define Ar=(arjk)1j,kd+1 by

arjk=[t(j,r)=k]ifj,kd,o(j,r)ifjd,k=d+1,[k=d+1]ifj=d+1.

Then (8.3) is equivalent to

v(qn+r)=Arv(n)

for n0, 0r<q with qn+r>0. Defining f(n) as in (6.1) for these Ar, we see that v(n)=f(n)v(0).

q-Regular Sequence. If we insist on a proper formulation as a regular sequence, we rewrite (8.3) to

Tj(qn+r)=Tt(j,r)(n)+o(j,r)+[r=0][n=0](Tj(0)-Tt(j,0)(0)-o(j,0)) 8.4

for 1jd, n0, 0r<q. Setting v~(n)=(T1(n),,Td(n),1,[n=0]) and A~r=(a~rjk)1j,kd+2 with

a~rjk=[t(j,r)=k]ifj,kd,o(j,r)ifjd,k=d+1,[r=0](Tj(0)-Tt(j,0)(0)-o(j,0))ifjd,k=d+2,[k=d+1]ifj=d+1,[k=d+2][r=0]ifj=d+2,

the system (8.4) is equivalent to

v~(qn+r)=A~rv~(n)

for n0, 0r<q.

Eigenvalue 1. By construction, the matrices Ar have the shape

Ar=Pror01.

It is clear that (0,,0,1) is a left eigenvector of Ar associated with the eigenvalue 1.

Joint Spectral Radius. We claim that A0,,Aq-1 have joint spectral radius 1. Let Inline graphic denote the maximum norm of complex vectors as well as the induced matrix norm, i.e., the maximum row sum norm. Let j1,,j{0,,q-1}. It is easily shown by induction on that

Aj1Aj=PbP01

for some PCd×d and bPCd with Inline graphic and Inline graphic. Thus, we obtain

graphic file with name 453_2019_631_Equ212_HTML.gif

As 1 is an eigenvalue of each matrix Ar for 0r<q, the joint spectral radius equals 1, which proves the claim.

Eigenvectors and Asymptotics. We now consider C=0r<qAr. It has the shape

C=MbM0q

where bM is some complex vector.

Let w1,,w be a linearly independent system of left eigenvectors of M associated with the eigenvector q. If wjbM=0 for 1j, then (w1,0),,(w,0),(0,1) is a linearly independent system of left eigenvectors of C associated with the eigenvalue q. In that case and because of Lemma 8.1, algebraic and geometric multiplicities of q as an eigenvalue of C are both equal to +1.

Otherwise, assume without loss of generality that w1bM=1. Then

(w2-(w2bM)w1,0),,(w-(wbM)w1,0),(0,1)

is a linearly independent system of left eigenvectors of C associated with the eigenvalue q. Additionally, (w1,0) is a generalised left eigenvector of rank 2 of C associated with the eigenvalue q with (w1,0)(C-qI)=(0,1). As noted above, the vector (0, 1) is a left eigenvector to each matrix A0,,Aq-1.

Similarly, it is easily seen that any left eigenvector of M associated with some eigenvalue λq can be extended uniquely to a left eigenvector of C associated with the same eigenvalue. The same is true for chains of generalised left eigenvectors associated with λq.

Therefore, in both of the above cases, Theorem B yields

graphic file with name 453_2019_631_Equ213_HTML.gif

for some constant eT (which vanishes in the first case) and some 1-periodic continuous functions Φ(qζ) and Φλk where ζ runs through the pth roots of unity Up and λ through the eigenvalues of M with 1<|λ|<q and 0k<m(λ).

Proposition 6.4 leads to (8.1).

Fourier Coefficients. By Theorem A, we have

Φ(qζ)(u)=Zφ(qζ)exp(2πiu)

with

graphic file with name 453_2019_631_Equ214_HTML.gif

for a pth root of unity ζUp and Z. Therefore and by noting that T(0) does not contribute to the residue, Proposition 6.4 leads to the Fourier series given in the corollary.

Functional Equation. By (8.3), we have

Yn0(s)=n0n<qn0n-sy(n)+nn00r<q(qn+r)-sy(qn+r)=n0n<qn0n-sy(n)+nn00r<q(qn+r)-s(Pry(n)+or)=n0n<qn0n-sy(n)+q-s0r<qPrnn0(n+rq)-sy(n)+q-s0r<qζn0(s,rq)or.

Using Lemma 6.3 yields the result.

Esthetic Numbers

We discuss the asymptotic analysis of esthetic numbers; see also Sect. 5.2 for an overview.

Let again be q2 a fixed integer. We call a non-negative integer n a q-esthetic number (or simply an esthetic number) if its q-ary digit expansion r-1r0 satisfies |rj-rj-1|=1 for all j{1,,-1}; see De Koninck and Doyon [8].

In [8] the authors count q-esthetic numbers with a given length of their q-ary digit expansion. They provide an explicit (in form of a sum of q summands) as well as an asymptotic formula for these counts. We aim for a more precise analysis and head for an asymptotic description of the amount of q-esthetic numbers up the an arbitrary value N (in contrast to only powers of q in [8]).

A q-Linear Representation

The language consisting of the q-ary digit expansions (seen as words of digits) which are q-esthetic is a regular language, because it is recognized by the automaton A in Fig. 1. Therefore, the indicator sequence of this language, i.e., the nth entry is 1 if n is q-esthetic and 0 otherwise, is a q-automatic sequence and therefore also q-regular. Let us name this sequence x(n).

Fig. 1.

Fig. 1

Automaton A recognizing esthetic numbers

Let A0,,Aq-1 be the transition matrices of the automaton A, i.e., Ar is the adjacency matrix of the directed graph induced by a transition with digit r. To make this more explicit, we have the following (q+1)-dimensional square matrices: Each row and column corresponds to the states 0,1,,q-1, I. In matrix Ar, the only non-zero entries are in column r{0,1,,q-1}, namely 1 in the rows r-1 and r+1 (if available) and in row I as there are transitions from these states to state r in the automaton A.

Let us make this more concrete by considering q=4. We obtain the matrices

A0=0000010000000000000010000,A1=0100000000010000000001000,A2=0000000100000000010000100,A3=0000000000000100000000010.

We are almost at a q-linear representation of our sequence; we still need vectors on both sides of the matrix products. We have

x(n)=eq+1Ar0Ar-1v(0)

for r-1r0 being the q-ary expansion of n and vectors eq+1=001 and v(0)=011. As A0v(0)=0v(0), this is not a linear representation of a regular sequence. Thus we cannot use Theorem A, but need to use Theorem B. However, the difference is slight: we simply cannot omit the contributions of the constant vector Kv(0). However, it will turn out that the joint spectral radius is 1, so the contribution will be absorbed by the error term anyway.

To see that the above holds, we have two different interpretations: the first is that the row vector

w(n)=eq+1Ar0Ar-1

is the unit vector corresponding to the most significant digit of the q-ary expansion of n or, in view of the automaton A, corresponding to the final state. Note that we read the digit expansion from the least significant digit to the most significant one (although it would be possible the other way round as well). We have w(0)=eq+1 which corresponds to the empty word and being in the initial state I in the automaton. The vector v(0) corresponds to the fact that all states of A except 0 are accepting.

The other interpretation is: the rth component of the column vector

v(n)=Ar0Ar-1v(0)

has the following two meanings:

  • In the automaton A, we start in state r and then read the digit expansion of n. The rth component is then the indicator function whether we remain esthetic, i.e., end in an accepting state.

  • To a word ending with r we append the digit expansion of n. The rth component is then the indicator function whether the result is an esthetic word.

At first glance, our problem here seems to be a special case of the transducers studied in Sect. 8. However, the automaton A is not complete. Adding a sink to have a formally complete automaton, however, adds an eigenvalue q and thus a much larger dominant asymptotic term, which would then be multiplied by 0. Therefore, the results of [31] do not apply to this case here.

Full Asymptotics

We now formulate our main result for the amount of esthetic numbers smaller than a given integer N. We abbreviate this amount by

X(N)=0n<Nx(n)

and have the following corollary.

Corollary G

Fix an integer q2. Then the number X(N) of q-esthetic numbers smaller than N is

graphic file with name 453_2019_631_Equ27_HTML.gif 9.1

with 2-periodic continuous functions Φj. Moreover, we can effectively compute the Fourier coefficients of each Φj (as explained in Part IV). If q is even, then the functions Φj are actually 1-periodic. If q is odd, then the functions Φj for even j vanish.

If q=2, then the corollary results in Inline graphic. However, for each length, the only word of digits satisfying the esthetic number condition has alternating digits 0 and 1, starting with 1 at its most significant digit. The corresponding numbers n form the so-called Lichtenberg sequence [39, A000975].

Back to a general q: For the asymptotics, the main quantities influencing the growth are the eigenvalues of the matrix C=A0++Aq-1. Continuing our example q=4 above, this matrix is

C=A0+A1+A2+A3=0100010100010100010011110,

and its eigenvalues are ±2cos(π5)=±12(5+1)=±1.618, ±2cos(2π5)=±12(5-1)=±0.618 and 0, all with algebraic and geometric multiplicity 1. Therefore it turns out that the growth of the main term is Nlog4(5+1)-12=N0.347, see Fig. 2. The first few Fourier coefficients are shown in Table 1.

Fig. 2.

Fig. 2

Fluctuation in the main term of the asymptotic expansion of X(N) for q=4. The figure shows Inline graphic (red) approximated by its trigonometric polynomial of degree 1999 as well as X(4u)/Nu(log4(5+1)-12) (blue) (Color figure online)

Table 1.

Fourier coefficients of Φ1 for q=4 (Corollary G)

φ1
0 4.886821584515
1 0.036565359077-0.012421753685i
2 0.0131103199420-0.017152133508i
3 -0.0023895069366-0.0506880727105i
4 -0.017328669452+0.025036392542i
5 0.011186380630-0.0066357472861i
6 0.0086354015002+0.018593736873i
7 -0.014899262928+0.0297436287202i
8 -0.003867454968+0.0064534688733i
9 0.0033747695643+0.006159612843i
10 -0.002149675882+0.006474570022i

All stated digits are correct; see also Part IV

Eigenvectors

Before proving Corollary G, we collect information on the eigenvalues of C.

The matrix C=A0++Aq-1 has a block decomposition into

C=M010

for vectors 0 (vector of zeros) and 1 (vector of ones) of suitable dimension. Therefore, one eigenvalue of C is 0 and the others are the eigenvalues of M.

In contrast to [8, Sects. 4 and 5], we use the Chebyshev polynomials8,9Un of the second kind defined by

U0(X)=1,U1(X)=2X,Un+1(X)=2XUn(X)-Un-1(X)

for n1. It is well-known that

Un(cosφ)=sin((n+1)φ)sin(φ) 9.2

and, as a consequence, the roots of Un are given by

cos(kπn+1),1kn,

for n1.

The following lemma is similar to [8, Proposition 3].

Lemma 9.1

Let v0 be a vector and λC.

Then v is an eigenvector to the eigenvalue λ of M if and only if λ=2cos(kπq+1) for some 1kq and

v=(Uj(λ2))0j<q

(up to a scalar factor).

In particular, 0 is an eigenvalue of M if and only if q is odd.

Proof

See the statement and the proof of [8, Proposition 3].

Lemma 9.2

Let 1kq, λ=2cos(kπ/(q+1)) and v be an eigenvector of M to λ. Then 1,v=0 holds if and only if k is even.

Proof

We write φ:=kπ/(q+1). By Lemma 9.1 and (9.2) and a summation similar to the Dirichlet kernel, we have

1,v=0j<qUj(cosφ)=1sinφ0j<qsin((j+1)φ)=1sinφI0j<qexp(iφ)j+1=1sinφI(exp(iφ)1-exp(iqφ)1-exp(iφ))=1sinφI(exp(i(q+1)φ2)exp(-iqφ2)-exp(iqφ2)exp(-iφ2)-exp(iφ2))=sin(qφ2)sinφsin(φ2)Iexp(i(q+1)φ2)=sin(qφ2)sin((q+1)φ2)sinφsin(φ2).

Inserting the value of φ leads to

1,v=sin(qkπ2(q+1))sin(kπ2)sin(kπq+1)sin(kπ2(q+1)).

For 1kq, it is clear that 0<kπ/(q+1)<π and 0<kπ/(2(q+1))<π, so the denominator of this fraction is non-zero. We also claim that sin(qkπ2(q+1))0: Otherwise, we have 2(q+1)qk, hence q+1qk, which implies that q+1k because gcd(q,q+1)=1. However, it cannot be that q+1k because 1kq.

As a consequence, 1,v=0 if and only if k / 2 is an integer.

Lemma 9.3

The characteristic polynomial of C is

X1kq(X-2cos(kπq+1)).

In particular, all eigenvalues of M apart from 0 are eigenvalues of C with algebraic multiplicity 1. If q is even, then 0 has algebraic multiplicity 1 as an eigenvalue of C; if q is odd, then 0 has algebraic multiplicity 2 as an eigenvalue of C.

Proof

The matrix C is a block lower triangular matrix, so the characteristic polynomial is the product of the characteristic polynomials of the matrices M and 0.

The statement on the algebraic multiplicities follows from Lemma 9.1.

We can summarise our findings on the eigenvectors and eigenvalues of C as follows.

Proposition 9.4

Let vCq, wC, not both 0, and let λC.

Then (vw)0 is an eigenvector of C to the eigenvalue λ if and only if one of the following conditions hold:

  1. 0λ=2cos(kπq+1) for some 1kq and kq+12, v is an eigenvector of M to λ, and w=0 if k is even and λw=1,v0 if k is odd;

  2. λ=0, v=0, w0;

  3. λ=0, q3(mod4), v is an eigenvector of M and w=0.

In particular, the eigenvalue λ=0 of C has

  • algebraic and geometric multiplicity 2 if q3(mod4),

  • algebraic multiplicity 2 and geometric multiplicity 1 if q1(mod4), and

  • algebraic and geometric multiplicity 1 for even q.

Proof

The vector (vw) is an eigenvector if and only if

Mv=λv,1,v=λw.

First assume that λ0. Then v=0 leads to w=0, contradiction. Therefore, v is an eigenvector of M to the eigenvalue λ and λ=2cos(kπq+1) for some 1kq by Lemma 9.1. Then w=0 if and only if k is even by Lemma 9.2.

Now assume that λ=0 and q is even. Then 0 is not an eigenvalue of M by Lemma 9.1. Thus v=0 and w0.

Now, assume that λ=0 and q3(mod4). Then λ=2cos(π2)=2cos(q+12πq+1). By Lemma 9.2, the eigenvector v of M leads to an eigenvector (v0) of C; and there is an additional eigenvector (0w)0.

Finally, assume that λ=0 and q1(mod4). In this case, by Lemma 9.2, it cannot be that v0 is an eigenvector of M because this would lead to 01,v=λw=0, a contradiction. Thus the only eigenvector is (0w)0.

Proof of the Asymptotic Result

Proof of Corollary G

We work out the conditions and parameters for using Theorem A.

Joint Spectral Radius. As all the square matrices A0,,Aq-1 have a maximum absolute row sum norm equal to 1, the joint spectral radius of these matrices is bounded by 1.

Let r{1,,q-1}. Then any product with alternating factors Ar-1 and Ar, i.e., a finite product Ar-1ArAr-1, has absolute row sum norm at least 1 as the word (r-1)r(r-1) is q-esthetic. Therefore the joint spectral radius of Ar-1 and Ar is at least 1. Consequently, the joint spectral radius of A0,,Aq-1 equals 1.

Asymptotics. We apply our Theorem A. We have λj=-λq+1-j, so we combine our approach with Proposition 6.4. Moreover, we have λj>1 iff jq+1<13 iff jq-23. This results in (9.1).

We now assume that q is even. In this case, we still have to show that the functions Φj are actually 1-periodic. We now need to use Theorem B. Let w1, w2,,wq-1, wq be the rows of T where the order is chosen in such a way that

J=diag(2cos(πq+1),,2cos(qπq+1),0).

We write eq+1=k=1qckwk for suitable ckR. Setting c:=c1c2cq, this means that eq+1=cT, or equivalently, c=eq+1T-1. The columns of T-1 are the right eigenvectors of C described in Proposition 9.4. Then Proposition 9.4 (1) implies that ck=0 for even k with 1kq. This means that all fluctuations corresponding to eigenvalues 2cos(kπ/(q+1)) for even k with 1kq are multiplied by 0 and do not contribute to the result. As |cos(q+1-kq+1π)|=|cos(kq+1π)|, but q+1-k and k have different parities, there is no need to use Proposition 6.4 and all fluctuations are 1-periodic.

The same argument can be used for the case of odd q, but in this case, q+1-k and k have the same parity. So Proposition 6.4 is used for odd k, and fluctuations to both eigenvalues 2cos(kπ/(q+1)) and 2cos((q+1-k)π/(q+1)) vanish for even k.

Fourier Coefficients. We can compute the Fourier coefficients according to Theorem A and Proposition 6.4; see also Part IV.

Pascal’s Rhombus

We discuss the asymptotic analysis of odd entries in Pascal’s rhombus; see also Sect. 5.5 for an overview.

We consider Pascal’s rhombus R which is, for integers i0 and j, the array with entries ri,j, where

  • r0,j=0 all j,

  • r1,0=1 and r1,j=0 for all j0,

  • and
    ri,j=ri-1,j-1+ri-1,j+ri-1,j+1+ri-2,j
    for i1.

We are interested in the number of odd entries in the first N rows of this rhombus. In [21] the authors investigate this quantity for N being a power of 2. We again aim for a more precise analysis and asymptotic description.

So, let X be equal to R but with entries taken modulo 2; see also Fig. 3. We partition X into the four sub-arrays

  • E consisting only of the rows and columns of X with even indices, i.e., the entries r2i,2j,

  • Y consisting only of the rows with odd indices and columns with even indices, i.e., the entries r2i-1,2j,

  • Z consisting only of the rows with even indices and columns with odd indices, i.e., the entries r2i,2j-1, and

  • N consisting only of the rows and columns with odd indices, i.e., the entries r2i-1,2j-1.

Note that E=X and N=0; see [21].

Fig. 3.

Fig. 3

Pascal’s rhombus modulo 2

Recurrence Relations and 2-Regular Sequences

Let X(N), Y(N) and Z(N) be the number of ones in the first N rows (starting with row index 1) of X, Y and Z, respectively.

Goldwasser, Klostermeyer, Mays and Trapp [21, (12)–(14)] get the recurrence relations

X(N)=X(N2)+Y(N2)+Z(N2),Y(N)=X(N2)+X(N2-1)+Z(N2)+Z(N2-1),Z(N)=2X(N2)+2Y(N2)

for N2, and X(0)=Y(0)=Z(0)=0, X(1)=1, Y(1)=1 and Z(1)=2 (cf. [21, Figs. 2 and 3]). Distinguishing between even and odd indices gives

X(2N)=X(N)+Y(N)+Z(N),X(2N+1)=X(N)+Y(N+1)+Z(N),Y(2N)=X(N)+X(N-1)+Z(N)+Z(N-1),Y(2N+1)=X(N+1)+X(N-1)+2Z(N),Z(2N)=2X(N)+2Y(N),Z(2N+1)=2X(N)+2Y(N+1)

for all N1. Now we build the backward differences x(n)=X(n)-X(n-1), y(n)=Y(n)-Y(n-1) and z(n)=Z(n)-Z(n-1). These x(n), y(n) and z(n) are the number of ones in the nth row of X, Y and Z, respectively, and clearly

X(N)=1nNx(n),Y(N)=1nNy(n),Z(N)=1nNz(n)

holds. We obtain

x(2n)=x(n)+z(n),x(2n+1)=y(n+1), 10.1a
y(2n)=x(n-1)+z(n),y(2n+1)=x(n+1)+z(n), 10.1b
z(2n)=2x(n),z(2n+1)=2y(n+1) 10.1c

for n1, and x(0)=y(0)=z(0)=0, x(1)=1, y(1)=1 and z(1)=2.

Let us write our coefficients as the vector

v(n)=(x(n),x(n+1),y(n+1),z(n),z(n+1)). 10.2

It turns out that the components included into v(n) are sufficient for a self-contained linear representation of v(n). In particular, it is not necessary to include y(n). By using the recurrences (10.1), we find that

v(2n)=A0v(n)andv(2n+1)=A1v(n)

for all10n0 with the matrices

A0=1001000100010102000000200andA1=0010001001100010020002000,

and with v(0)=(0,1,1,0,2). Therefore, the sequences x(n), y(n) and z(n) are 2-regular.

Full Asymptotics

Corollary H

We have

graphic file with name 453_2019_631_Equ33_HTML.gif 10.3

with κ=log2(3+17)-1=1.83250638358045 and a 1-periodic function Φ which is Hölder continuous with any exponent smaller than κ-1.

Moreover, we can effectively compute the Fourier coefficients of Φ (as explained in Part IV).

We get analogous results for the sequences Y(N) and Z(N) (each with its own periodic function Φ, but the same exponent κ). The fluctuation Φ of X(N) is visualized in Fig. 4 and its first few Fourier coefficients are shown in Table 2.

Fig. 4.

Fig. 4

Fluctuation in the main term of the asymptotic expansion of X(N). The figure shows Inline graphic (red) approximated by its trigonometric polynomial of degree 1999 as well as X(2u)/2uκ (blue) (Color figure online)

Table 2.

Fourier coefficients of Φ (Corollary H)

φ
0 0.6911615112341912755021246
1 -0.01079216311240407872950510-0.0023421761940286789685827i
2 0.00279378637350495172116712-0.00066736128659728911347756i
3 -0.00020078258323645842522640-0.0031973663977645462669373i
4 0.00024944678921746747281338-0.0005912995467076061497650i
5 -0.0003886698612765803447578+0.00006723866319930148568431i
6 -0.0006223575988893574655258+0.00043217220614939859781542i
7 0.00023034317364181383130476-0.00058663168772856091427688i
8 0.0005339060804798716172593-0.0002119380802590974909465i
9 0.0000678898389770175928529-0.00038307823285486235280185i
10 -0.00019981745997355255061991-0.00031394569060142799808175i

All stated digits are correct; see also Part IV

Proof of the Asymptotic Result

At this point, we only prove (10.3) of Corollary H. We deal with the Fourier coefficients in Sect. 10.5. As in the introductory example of the binary sum-of-digits functions (Example 3.1), we could get Fourier coefficients by Theorem A and the 2-linear representation of Sect. 10.1 directly. However, the information in the vector v(n) [see (10.2)] is redundant with respect to the asymptotic main term as it contains x(n) and z(n) as well as x(n+1) and z(n+1); both pairs are asymptotically equal in the sense of (10.3). Therefore, we head for an only 3-dimensional functional system of equations for our Dirichlet series of x(n), y(n) and z(n) (instead of a 5-dimensional system).

Proof of (10.3)

We use Theorem A.

Joint Spectral Radius. First we compute the joint spectral radius ρ of A0 and A1. Both matrices have a maximum absolute row sum equal to 2, thus ρ2, and both matrices have 2 as an eigenvalue. Therefore we obtain ρ=2. Moreover, the finiteness property of the linear representation is satisfied by considering only products with exactly one matrix factor A0 or A1.

Thus, we have R=ρ=2.

Eigenvalues. Next, we compute the spectrum σ(C) of C=A0+A1. The matrix C has the eigenvalues λ1=(3+17)/2=3.5615528128088, λ2=2, λ3=-2, λ4=-1 and λ5=(3-17)/2=-0.5615528128088 (each with multiplicity one). Note that λ1 and λ5 are the zeros of the polynomial U2-3U-2.

Asymptotics. By using Theorem A, we obtain an asymptotic formula for X(N-1). Shifting from N-1 to N does not change this asymptotic formula, as this shift is absorbed by the error term Inline graphic.

Dirichlet Series and Meromorphic Continuation

In the lemma below, we provide the functional equation (10.4) as a system of three equations. This is in contrast to the generic functional equation provided by Theorem D which is a system of five equations.

Let n02 be an integer and define

graphic file with name 453_2019_631_Equ215_HTML.gif

Lemma 10.1

Set

M=I-2-s2-s2-s21-s021-s21-s21-s0.

Then

graphic file with name 453_2019_631_Equ34_HTML.gif 10.4

where

graphic file with name 453_2019_631_Equ216_HTML.gif

with the notion of Σ as in Lemma 6.3, provides meromorphic continuations of the Dirichlet series Inline graphic, Inline graphic, and Inline graphic for Rs>κ0=1 with the only possible poles at κ+χ for Z, all of which are simple poles.

Proof

We split the proof into several steps.

Functional Equation. From (10.1b) we obtain

graphic file with name 453_2019_631_Equ35_HTML.gif 10.5

The second row of (10.4) follows. Similarly, (10.1a) and (10.1c) yield the first and third rows of (10.4), respectively.

Determinant and Zeros. The determinant of M is

graphic file with name 453_2019_631_Equ217_HTML.gif

It is an entire function.

All zeros of Δ are simple zeros. In particular, solving Inline graphic gives 2s=3/2±17/2 (the two zeros of U2-3U-U) and 2s=-2. A solution Inline graphic implies that s0+2πi/log2 with Z satisfies the same equation as well.

Moreover, set κ=log2(3+17)-1=1.8325063835804. Then the only zeros with Rs>κ0=1 are at κ+χ with χ=2πi/log2 for Z.

It is no surprise that the κ of this lemma and the κ in the proof of Corollary H which comes from the 2-linear representation of Sect. 10.1 coincide.

Meromorphic Continuation. Let Dn0{Xn0,Yn0,Zn0}. The Dirichlet series Inline graphic is analytic for Rs>2=log2ρ+1 with ρ=2 being the joint spectral radius by Theorem D. We use the functional equation (10.4) which provides the continuation, as we write Inline graphic in terms of Inline graphic, Inline graphic and Inline graphic. By Lemma 6.3, these three functions are analytic for Rs>1.

The zeros (all are simple zeros) of the denominator Inline graphic are the only possibilities for the poles of Inline graphic for Rs>1.

Fourier Coefficients

We are now ready to prove the rest of Corollary H.

Proof of Corollary H

We verify that we can apply Theorem E.

The steps of this proof in Sect. 10.2 provided us already with an asymptotic expansion (10.3). Lemma 10.1 gives us the meromorphic function for Rs>κ0=1 which comes from the Dirichlet series Inline graphic. It can only have poles (all simple) at s=κ+χ for Z and satisfies the assumptions in Theorem E by Theorem D and Remark 6.2.

Therefore a computation of the Fourier coefficients via computing residues [see (3.6)] is possible by Theorem E, and this residue may be computed from (10.4) via Cramer’s rule.

We refer to Part IV for details on the actual computation of the Fourier coefficients.

Part III: Proofs

Before reading this part on the collected proofs, it is recommended to recall the definitions and notations of Sect. 6.2. Some additional notations which are only used in the proofs are introduced in the following section.

Additional Notations

We use Iverson’s convention [expr]=1 if expr is true and 0 otherwise, which was popularised by Graham, Knuth and Patashnik [26]. We use the notation z_:=z(z-1)(z-+1) for falling factorials. We use nk1,c,kr for multinomial coefficients. We sometimes write a binomial coefficient na as na,b with a+b=n when we want to emphasise the symmetry and analogy to a multinomial coefficient.

Decomposition into Periodic Fluctuations: Proof of Theorem B

We first give an overview over the proof.

Overview of the Proof of Theorem B

The first step will be to express the summatory function F in terms of the matrices C, Br and Ar. Essentially, this corresponds to the fact that the summatory function of a q-regular function is again q-regular. This expression of F will consist of two terms: the first is a sum over 0j<logqN involving a jth power of C and matrices Br and Ar depending on the -j most significant digits of N. The second term is again a sum, but does not depend on the digits of N; it only encodes the fact that f(0)=A0f(0) may not hold. The fact that we are interested in wF(N) for the generalised left eigenvector w corresponding to the eigenvalue λ allows to express wCj in terms of wλj (plus some other terms if w is not an eigenvector).

The second term can be disposed of by elementary observations using a geometric series. We reverse the order of summation in the first summand and extend it to an infinite sum. The infinite sum is written in terms of periodic fluctuations; the difference between the infinite sum and the finite sum is absorbed by the error term. In order not to have to deal with ambiguities due to non-unique q-ary expansions of real numbers, we define the fluctuations on an infinite product space instead of the unit interval.

Upper Bound for Eigenvalues of C

We start with an upper bound for the eigenvalues of C in terms of the joint spectral radius.

Lemma 12.1

Let λσ(C). Then |λ|qρ.

Proof

For , we have

graphic file with name 453_2019_631_Equ218_HTML.gif

and

graphic file with name 453_2019_631_Equ219_HTML.gif

by (7.1). Taking th roots and the limit yields |λ|qR. This last inequality does not depend on our particular (cf.  Sect. 6.2) choice of R>ρ, so the inequality is valid for all R>ρ, and we get the result.

Explicit Expression for the Summatory Function

In this section, we give an explicit formula for F(N)=0n<Nf(n) in terms of the matrices Ar, Br and C.

Lemma 12.2

Let N be an integer with q-ary expansion r-1r0. Then

F(N)=0j<CjBrjArj+1Ar-1+0j<Cj(I-A0).

Proof

We claim that

F(qN+r)=CF(N)+Brf(N)+(I-A0)[qN+r>0] 12.1

holds for non-negative integers N and r with 0r<q.

We now prove (12.1): Using (6.1) and f(0)=I yields

F(qN+r)=f(0)[qN+r>0]+0<qn+r<qN+r0n0r<qf(qn+r)=f(0)[qN+r>0]+0<qn+r<qN+r0n0r<qArf(n)=(f(0)-A0f(0))[qN+r>0]+0qn+r<qN+r0n0r<qArf(n)=(I-A0)[qN+r>0]+0n<N0r<qArf(n)+0r<rArf(N)=(I-A0)[qN+r>0]+CF(N)+Brf(N).

This concludes the proof of (12.1).

Iteration of (12.1) and using (6.2) yield the assertion of the lemma; cf. [31, Lemma 3.6].

Proof of Theorem B

Proof of Theorem B

For readability, this proof is split into several steps.

Setting. Before starting the actual proof, we introduce the setting using an infinite product space which will be used to define the fluctuations Φk. We also introduce the maps linking the infinite product space to the unit interval.

We will first introduce functions Ψk defined on the infinite product space

graphic file with name 453_2019_631_Equ220_HTML.gif

We equip it with the metric such that two elements xx with a common prefix of length j and xjxj have distance q-j. We consider the map lval:Ω[0,1] with

lval(x):=logqj0xjq-j;

see Fig. 5. By using the assumption that the zeroth component of elements of Ω is assumed to be non-zero, we easily check that lval is Lipschitz-continuous; i.e.,

graphic file with name 453_2019_631_Equ37_HTML.gif 12.2

for xx with a common prefix of length j.

Fig. 5.

Fig. 5

Maps in the proof of Theorem B

For y[0,1), let reprq(y) be the unique xΩ with lval(x)=y such that x does not end on infinitely many digits q-1, i.e., reprq(y) represents a q-ary expansion of qy. This means that lvalreprq is the identity on [0, 1).

From the definition of the metric on Ω, recall that a function Ψ:ΩCd is continuous if and only if for each ε>0, there is a j such that ||Ψ(x)-Ψ(x)||<ε holds for all x and x that have a common prefix of length j. Further recall from the universal property of quotients that if such a continuous function Ψ satisfies Ψ(x)=Ψ(x) whenever lval(x)=lval(x), then there is a unique continuous function Φ:[0,1]Cd such that Φlval=Ψ. This will be used in the “Descent”-step of the proof.

Notation. We will deal with the two sums in Lemma 12.2 separately. We will first introduce notations corresponding to this split and to the eigenvector structure.

Let N have the q-ary expansion r-1r0 and set

F1(N):=0j<CjBrjArj+1Ar-1,F2(N):=0j<Cj(I-A0)

so that F(N)=F1(N)+F2(N) by Lemma 12.2.

We consider the Jordan chain w=v0,,vm-1 generated by w, i.e., vk=w(C-λI)k for 0k<m and vm-1 is a left eigenvector of C. Thus we have wCj=0k<mjkλj-kvk for all j0. If λ0, choose vectors v0,,vm-1Cd such that

wCj=λj0k<mjkvk 12.3

holds for all j0. These vectors are suitable linear combinations of the vectors v0,,vm-1. We note that we have

vm-1=1λm-1(m-1)!vm-1. 12.4

Second Summand. We will now rewrite wF2(N) by evaluating the geometric sum and rewriting it in terms of a fluctuation.

We claim that

graphic file with name 453_2019_631_Equ40_HTML.gif 12.5

for suitable continuously differentiable functions Φk(2) on R, 0k<m. If R=0, then Inline graphic shall mean that the error vanishes for almost all N.

Consider first the case that λ1. Because of wCj=wCj and wT-1DT=w (see Sect. 7.3) we have

wF2(N)=0j<wCj(I-A0)=w(I-C)(I-C)-1(I-A0)=wK-wC(I-C)-1(I-A0).

If λ=0, then wC=0 for almost all . We may set Φk(2)=0 for 0k<m and (12.5) is shown. Otherwise, as we have -1=logqN=logqN-{logqN} and by (12.3), we can rewrite wC as

wC=λ0k<mkvk=λ1+logqN-{logqN}0k<m(logqN+1-{logqN})kvk.

Let

G2(L,ν):=-λ1-ν0k<m(L+1-ν)kvk(I-C)-1(I-A0)

for reals L and ν, i.e.,

wF2(N)=wK+λlogqNG2(logqN,{logqN}).

By the binomial theorem, we have

G2(L,ν)=-λ1-ν0k<mLk0rk+r<mk+rk,r(1-ν)rvk+r(I-C)-1(I-A0).

This leads to a representation G2(L,ν)=0k<mLkΦk(2)(ν) for continuously differentiable functions

Φk(2)(ν)=-λ1-ν0r<m-kk+rk,r(1-ν)rvk+r(I-C)-1(I-A0)

for 0k<m. As the functions Φk(2) are continuously differentiable, they are Lipschitz continuous on compact subsets of R. We note that in the case k=m-1, the only occurring summand is for r=0, which implies that

Φm-1(2)(ν)=-λ1-νvm-1(I-C)-1(I-A0). 12.6

Rewriting λlogqN as Nlogqλ and recalling that wϑm=0 yields (12.5) for λ1.

We now turn to the case λ=1. We use wCj=0k<mjkvk for j0 as above. Thus

wF2(N)=0j<0k<mjkvk(I-A0)=0k<mvk(I-A0)0j<jk=0k<mvk(I-A0)k+1,

where the identity [26, (5.10)] (“summation on the upper index”) has been used in the last step.

Thus wF2(N) is a polynomial in of degree m. By writing =1+logqN-{logqN}, we can again rewrite this as a polynomial in logqN whose coefficients depend on {logqN}. The coefficient of (logqN)m comes from vm-1(I-A0)m, therefore, this coefficient is

1m!vm-1(I-A0)=1m!w(C-I)m-1(I-A0)=wϑm.

The additional factor T-1(I-D)T in ϑm has been introduced in order to annihilate generalised eigenvectors to other eigenvalues. By construction of K, we have wK=0. Thus we have shown (12.5) for λ=1, too.

Lifting the Second Summand. For later use—at this point, this may seem to be quite artificial—we set Ψk(2)=Φk(2)lval. As Φk(2) is continuously differentiable, it is Lipschitz continuous on [0, 1]. As lval is also Lipschitz continuous, so is Ψk(2).

First Summand We now turn to wF1(N). To explain our plan, assume that w is in fact an eigenvector. Then wF1(N)=0j<λjwBrjArj+1Ar-1. For |λ|R, it will be rather easy to see that the result holds. Otherwise, we will factor out λ and write the sum as wF1(N)=λ0j<λ-(-j)wBrjArj+1Ar-1. We will then reverse the order of summation and extend the sum to an infinite sum, which will be represented by periodic fluctuations. The difference between the finite and the infinite sums will be absorbed by the error term. The periodic fluctuations will be defined on the infinite product space Ω.

We now return to the general case of a generalised eigenvector w and the actual proof. If λ=0, we certainly have |λ|R and we are in one of the first two cases of this theorem. Furthermore, we have wCj=0 for jm, thus

graphic file with name 453_2019_631_Equ221_HTML.gif

by using (7.1). Together with (12.5), the result follows.

From now on, we may assume that λ0. By using (12.3), we have

wF1(N)=0j<λj(0k<mjkvk)BrjArj+1Ar-1. 12.7

We first consider the case that |λ|<R [corresponding to Theorem B, (1)]. We get

graphic file with name 453_2019_631_Equ222_HTML.gif

where (7.1) was used. Together with (12.5), the result follows.

Next, we consider the case where |λ|=R [Theorem B, (2)]. In that case, we get

graphic file with name 453_2019_631_Equ223_HTML.gif

Again, the result follows.

From now on, we may assume that |λ|>R. We set Q:=|λ|/R and note that 1<Qq by assumption and Lemma 12.1. We claim that there are continuous functions Ψk(1) on Ω for 0k<m such that

graphic file with name 453_2019_631_Equ43_HTML.gif 12.8

and such that

graphic file with name 453_2019_631_Equ44_HTML.gif 12.9

when the first j entries of x and xΩ coincide.

Write N=q-1+{logqN} and let x=reprq({logqN}), i.e., x is the q-ary expansion of q{logqN}=N/q-1[1,q) ending on infinitely many zeros. This means that xj=r-1-j for 0j< and xj=0 for j. Reversing the order of summation in (12.7) yields

wF1(N)=λ-10j<λ-j(0k<m(-1-j)kvk)BxjAxj-1Ax0.

For j, we have xj=0 and therefore Bxj=0. Thus we may extend the sum to run over all j0, i.e.,

wF1(N)=λ-1j0λ-j(0k<m(-1-j)kvk)BxjAxj-1Ax0.

We insert -1=logqN-{logqN} and obtain

graphic file with name 453_2019_631_Equ224_HTML.gif

where

G1(L,x)=λ-lval(x)j0λ-j(0k<m(L-lval(x)-j)kvk)BxjAxj-1Ax0=λ-lval(x)j0λ-j(0a,0r,0sa+r+s<mLa(-j)ra+r+sa,r,s×(-lval(x))sva+r+s)BxjAxj-1Ax0

for LR and xΩ. Note that in contrast to G2, the second argument of G1 is an element of Ω instead of R. Collecting G1(L,x) by powers of L, we get

G1(L,x)=0k<mLkΨk(1)(x)

where

graphic file with name 453_2019_631_Equ225_HTML.gif

for functions

ψkr(ν)=λ-ν(-1)r0s<m-k-rk+r+sk,r,s(-ν)svk+r+s

which are continuously differentiable and therefore Lipschitz continuous on the unit interval. This shows (12.8). For k=m-1, only summands with r=s=0 occur, thus

Ψm-1(1)(x)=j0λ-j-lval(x)vm-1BxjAxj-1Ax0. 12.10

Note that Ψk(1)(x) is majorised by

graphic file with name 453_2019_631_Equ226_HTML.gif

according to (7.1). We now prove (12.9). So let x and x have a common prefix of length i. Consider the summand of Ψk(1)(x) with index j. First consider the case that j<i. For all r, we have

graphic file with name 453_2019_631_Equ227_HTML.gif

due to Lipschitz continuity of ψkrlval. As the matrix product Axj-1Ax0 is the same for x and x, the difference with respect to this summand is bounded by

graphic file with name 453_2019_631_Equ228_HTML.gif

Thus the total contribution of all summands with j<i is Inline graphic. Any summand with ji is bounded by Inline graphic, which leads to a total contribution of Inline graphic. Adding the two bounds leads to a bound of Inline graphic, as requested.

Descent. As we have defined the periodic fluctuations Ψk(1) on the infinite product space Ω, we now need to prove that the periodic fluctuation descends to a periodic fluctuation on the unit interval. To do so, we will verify that the values of the fluctuation coincide whenever sequences in the infinite product space correspond to the same real number in the interval.

By setting Ψk(x)=Ψk(1)(x)+Ψk(2)(x), we obtain

graphic file with name 453_2019_631_Equ46_HTML.gif 12.11

and

graphic file with name 453_2019_631_Equ47_HTML.gif 12.12

whenever x and xΩ have a common prefix of length j.

It remains to show that Ψk(x)=Ψk(x) holds whenever lval(x)=lval(x) or lval(x)=0 and lval(x)=1.

Choose x and x such that one of the above two conditions on lval holds and such that xj=0 for jj0 and xj=q-1 for jj0. Be aware that now the prefixes of x and x of length j0 do not coincide except for the trivial case j0=0.

Fix some jj0 and set x to be the prefix of x of length j, followed by infinitely many zeros. Note that we have qlval(x)=qlval(x)-q-(j-1). Set n=qj-1+lval(x). By construction, we have n+1=qj-1+lval(x)+[lval(x)=0]. This implies reprq({logqn})=x and reprq({logq(n+1)})=x. Taking the difference of (12.11) for n+1 and n yields

wf(n)=(n+1)logqλ0k<m(logq(n+1))kΨk(x)-nlogqλ0k<m(logqn)kΨk(x)+((logq(n+1))m-(logqn)m)wϑm.

We estimate n+1 as Inline graphic and get

graphic file with name 453_2019_631_Equ48_HTML.gif 12.13

We have Inline graphic by (6.2) and (7.1). By (12.12),

graphic file with name 453_2019_631_Equ229_HTML.gif

which is used below to replace x by x. Inserting these estimates in (12.13) and dividing by nlogqλ yields

graphic file with name 453_2019_631_Equ49_HTML.gif 12.14

Note that Ψk(x)-Ψk(x) does not depend on j. Now we let j (and therefore n) tend to infinity. We see that (12.14) can only remain true if Ψk(x)=Ψk(x) for 0k<m, which we had set out to show.

Therefore, Ψk descends to a continuous function Φk on [0, 1] with Φk(0)=Φk(1); thus Φk can be extended to a 1-periodic continuous function.

Hölder Continuity. We will now prove Hölder continuity. As the fluctuations have been defined on the infinite product space Ω, we will basically have to prove Hölder continuity there. The difficulty will be that points in the unit interval which are close to each other there may have drastically different q-ary expansions, thus correspond to drastically different points in the infinite product space Ω. To circumvent this problem, the interval between the two points will be split into two parts.

We first claim that for 0y<y<1, we have

graphic file with name 453_2019_631_Equ50_HTML.gif 12.15

as yy. To prove this, let x:=reprq(y) and x:=reprq(y). Let be the length of the longest common prefix of x and x and choose j0 such that q-jqy-qy<q-j+1. We define x and xΩ such that

graphic file with name 453_2019_631_Equ230_HTML.gif

and set y:=lval(x) and y:=lval(x). As lval(x)=y<y=lval(x), we have x>x. We conclude that yy=yy. Therefore,

qy-qyqy-qy<q-j+1,

so in view of the fact that each entry of x is greater or equal than the corresponding entry of x, the expansions x and x must have a common prefix of length j. Similarly, the expansions x and x must have a common prefix of length j. Thus (12.12) implies that

graphic file with name 453_2019_631_Equ231_HTML.gif

Noting that Inline graphic leads to (12.15).

In order to prove Hölder continuity with exponent α<logqQ, we first note that Lipschitz-continuity of yqy on the interval [0, 1] shows that (12.15) implies

graphic file with name 453_2019_631_Equ232_HTML.gif

This can then easily be extended to arbitrary reals y<y by periodicity of Φk because it is sufficient to consider small y-y and the interval may be subdivided at an integer between y and y.

Constant Dominant Fluctuation. To finally prove the final assertion on constant fluctuations, we will have to inspect the explicit expression for the fluctuations using the additional assumption.

Under the additional assumption that the vector w(C-I)m-1=vm-1 is a left eigenvector to all matrices A0,,Aq-1 associated with the eigenvalue 1, the same holds for vm-1 by (12.4). Then vm-1 is also a left eigenvector of C associated with the eigenvalue q. In particular, λ=q1.

We can compute Φm-1(2)(ν) using (12.6). As vm-1Wq, we have vm-1C=vm-1C by definition of C (see Sect. 7.3) which implies that vm-1(I-C)-1=11-qvm-1. As vm-1(I-A0)=0 by assumption, we conclude that Φm-1(2)(ν)=0 in this case.

We use (12.10) to compute Ψm-1(1)(x). By assumption, vm-1Bxj=xjvm-1 which implies that

Ψm-1(1)(x)=q-lval(x)(j0q-jxj)vm-1=q-lval(x)qlval(x)vm-1=vm-1

by definition of lval.

Together with (12.4), we obtain the assertion.

Proof of Theorem C

Proof of Theorem C

We denote the rows of T as w1,,wd and the columns of T-1 by t1,,td. Thus 1jdtjwj=I and wj is a generalised left eigenvector of C of some rank mj corresponding to some eigenvalue λjσ(C). Theorem B and the fact that there are no eigenvalues of C of absolute value between ρ and R then immediately imply that

graphic file with name 453_2019_631_Equ233_HTML.gif

for some 1-periodic Hölder continuous functions Ψjk with exponent less than logq|λj|/R. The first summand K as well as the error term already coincide with the result stated in the theorem. From Sect. 7.3 we recall that wjϑmj=0 for λj1.

We set

Φλk(u):=1jdλj=λk<mj(tjΨjk(u)+[λ=1][mj=k]tjwjϑmj)

for λσ(C) with |λ|>ρ and 0k<m(λ).

Then we still have to account for

(logqN)m(1)1jdλj=1mj=m(1)tjwjϑm(1). 12.16

The factor (C-I)m(1)-1 in the definition of ϑm(1) implies that wjϑm(1) vanishes unless λj=1 and mj=m(1). Therefore, the sum in (12.16) equals ϑ.

Meromorphic Continuation of the Dirichlet Series: Proof of Theorem D

For future use, we state an estimate for the binomial coefficient. Unsurprisingly, it is a consequence of a suitable version of Stirling’s formula. Alternatively, it can be seen as the most basic case of Flajolet and Odlyzko’s singularity analysis [19, Proposition 1], where uniformity in s is easily checked.

Lemma 13.1

Let kZ, k0. Then

-sk1|Γ(s)|kRs-1 13.1

uniformly for s in a compact subset of C and k.

Proof

By [26, (5.14)] (“negating the upper index”), we rewrite the binomial coefficient as

-sk=(-1)ks+k-1k=(-1)kΓ(s)Γ(s+k)Γ(k+1).

Thus (13.1) follows by [36, 5.11.12] (which is an easy consequence of Stirling’s formula for the Gamma function).

Proof of Lemma 6.3

We have

graphic file with name 453_2019_631_Equ53_HTML.gif 13.2

for Rs>logqR+1. We note that

graphic file with name 453_2019_631_Equ234_HTML.gif

Therefore,

graphic file with name 453_2019_631_Equ235_HTML.gif

and the series converges for Rs>logqR. As this holds for all R>ρ, we obtain Inline graphic as |Is| uniformly for logqρ+δRslogqρ+δ+1. In the language of [27, § 3.3], Inline graphic has order at most 1 for logqρ+δRslogqρ+δ+1. As logqρ+δ+1 is larger than the abscissa of absolute convergence of Inline graphic, it is clear that Inline graphic for Rs=logqρ+δ+1, i.e., Inline graphic has order at most 0 for Rs=logqρ+δ+1. By Lindelöf’s theorem (see [27, Theorem 14]), we conclude that Inline graphic for logqρ+δRslogqρ+δ+1.

For Rs>logqR+1, we may rewrite (13.2) using the binomial series as

graphic file with name 453_2019_631_Equ54_HTML.gif 13.3

Switching the order of summation was legitimate because

graphic file with name 453_2019_631_Equ236_HTML.gif

for Rs+k>logqR+1 and Lemma 13.1 imply absolute and uniform convergence for s in a compact set. Noting that the previous arguments hold again for all R>ρ and that the inner sum in (13.3) is D(s+k) completes the proof.

Proof of Theorem D

As Inline graphic by (6.2) and (7.1), the Dirichlet series Fn0(s)=nn0n-sf(n) (see Sect. 6.2) converges absolutely and uniformly on compact sets for Rs>logqR+1. As this holds for all R>ρ, i.e., does not depend on our particular (cf.  Sect. 6.2) choice of R>ρ, this convergence result holds for Rs>logqρ+1.

We use (6.1) and Lemma 6.3 (including its notation) to rewrite Fn0 as

Fn0(s)=n0n<qn0n-sf(n)+0r<qnn0(qn+r)-sf(qn+r)=n0n<qn0n-sf(n)+q-s0r<qArnn0(n+rq)-sf(n)=n0n<qn0n-sf(n)+q-sCFn0(s)+Hn0(s)

with

graphic file with name 453_2019_631_Equ237_HTML.gif

for Rs>logqR+1. Thus

(I-q-sC)Fn0(s)=n0n<qn0n-sf(n)+Hn0(s) 13.4

for Rs>logqR+1. By Lemma 6.3 we have Inline graphic for logqρ+δRslogqρ+δ+1. Rewriting the expression for Hn0(s) using the binomial series (see Lemma 6.3 again) yields

Hn0(s)=q-s0r<qArk1-sk(rq)kFn0(s+k).

Combining this with (13.4) yields the expression (6.4) for Gn0.

Solving (6.3) for Fn0 yields the meromorphic continuation of Fn0(s) to Rs>logqR (and thus to Rs>logqρ) with possible poles where qs is an eigenvalue of C. As long as qs keeps a fixed positive distance δ from the eigenvalues, the bound for Gn0 (coming from the bound for Hn0) carries over to a bound for Fn0, i.e., (6.5).

To estimate the order of the poles, let w be generalised left eigenvector of rank m of C corresponding to an eigenvalue λ with |λ|>R. We claim that wFn0(s) has a pole of order at most m at s=logqλ+χk and no other poles for Rs>logqR. We prove this by induction on m.

Set v:=w(C-λI). By definition, v=0 or v is a generalised eigenvector of rank m-1 of C. By induction hypothesis, vFn0(s) has a pole of order at most m-1 at s=logqλ+χk for kZ and no other poles for Rs>logqR.

Multiplying (6.3) by w, inserting the definition of v and reordering the summands yields

(1-q-sλ)wFn0(s)=q-svFn0(s)+wGn0(s).

The right-hand side has a pole of order at most m-1 at logqλ+χk for kZ and 1-q-sλ has a simple zero at the same places. This proves the claim.

Fourier Coefficients: Proof of Theorem E

In contrast to the rest of this paper, this section does not directly relate to a regular sequence but gives a general method to derive Fourier coefficients of fluctuations.

Pseudo-Tauberian Theorem

In this section, we generalise the pseudo-Tauberian argument by Flajolet, Grabner, Kirschenhofer, Prodinger and Tichy [18, Proposition 6.4]. The basic idea is that for a 1-periodic Hölder-continuous function Φ and γC, there is a 1-periodic continuously differentiable function Ψ such that

graphic file with name 453_2019_631_Equ238_HTML.gif

and there is a straight-forward relation between the Fourier coefficients of Φ and the Fourier coefficients of Ψ. This relation exactly corresponds to the additional factor s+1 when transitioning from the zeroth order Mellin–Perron formula to the first order Mellin–Perron formula.

In contrast to [18, Proposition 6.4], we allow for an additional logarithmic factor, have weaker growth conditions on the Dirichlet series and quantify the error. We also extend the result to all complex γ. The generalisation from q=2 there to our real q>1 is trivial.

Proposition 14.1

Let γC and q>1 be a real number, m be a positive integer, Φ0,,Φm-1 be 1-periodic Hölder continuous functions with exponent α>0, and 0<β<α. Then there exist continuously differentiable functions Ψ-1, Ψ0,,Ψm-1, periodic with period 1, and a constant c such that

graphic file with name 453_2019_631_Equ56_HTML.gif 14.1

for integers N.

Denote the Fourier coefficients of Φj and Ψj by φj:=01Φj(u)exp(-2πiu)du and ψj:=01Ψj(u)exp(-2πiu)du, respectively. Then the corresponding generating functions fulfil

graphic file with name 453_2019_631_Equ57_HTML.gif 14.2

for Z and Z0.

If qγ+11, then Ψ-1 vanishes.

Remark 14.2

Note that the constant c is absorbed by the error term if Rγ+1>α, in particular if Rγ>0. Therefore, this constant does not occur in the article [18].

Remark 14.3

The factor γ+1+2πilogq+Z in (14.2) will turn out to correspond exactly to the additional factor s+1 in the first order Mellin–Perron summation formula with the substitution s=γ+2πilogq+Z such that the local expansion around the pole in s=γ+2πilogq of the Dirichlet generating function is conveniently written as a Laurent series in Z. See the proof of Theorem E for details.

Before actually proving Proposition 14.1, we give an outline.

Overview of the Proof of Proposition 14.1

We start with the left-hand side of (14.1) and split the range of summation according to logqn, thereby, in terms of our periodic functions, split after each period. We then use periodicity of the Φj and collect terms. This results in Riemann sums which converge to the corresponding integrals. Therefore, we can approximate these sums by the integrals.

More rewriting constructs and reveals the functions Ψj [of the right-hand side of (14.1)]: these functions are basically defined via the above mentioned integral. We then show that these functions are indeed periodic and that their Fourier coefficients relate to the Fourier coefficients of the Φj. The latter is done by a direct computation of the integrals defining these coefficients.

For this proof, we use an approach via exponential generating functions. This reduces the overhead for dealing with the logarithmic factors (logn)k in (14.1) such that we can essentially focus on the case m=1. The resulting formula (14.1) follows by extracting a suitable coefficient of this power series.

There is another benefit of the generating function approach: this formulation allows to easily translate the relation between the Fourier coefficients here to the additional factors occurring when transitioning to higher order Mellin–Perron summation formulæ, in particular the factor s+1 in the first order Mellin–Perron summation.

Proof of Proposition 14.1

We split the proof into six parts.

Notations. We start by defining quantities that are used through the whole proof.

Without loss of generality, we assume that qRγ+1qα: otherwise, we slightly decrease α keeping the inequality β<α intact. We use the abbreviations Λ:=logqN, ν:={logqN}, i.e., N=qΛ+ν. We use the generating functions

graphic file with name 453_2019_631_Equ239_HTML.gif

for 0u1 and 0<|Z|<2r where r>0 is chosen such that r<(α-β)/2 and such that Q(Z)1 and |Q(Z)|qα for these Z. (The condition Z0 is only needed for the case q1+γ=1.) We will stick to the above choice of r and restrictions for Z throughout the proof.

It is easily seen that the left-hand side of (14.1) equals [Zm-1]L(N,Z), where [Zm-1] denotes extraction of the coefficient of Zm-1.

Approximation of the Sum by an Integral. We will now rewrite L(NZ) so that its shape is that of a Riemann sum, therefore enabling us to approximate it by an integral.

Splitting the range of summation with respect to powers of q yields

graphic file with name 453_2019_631_Equ240_HTML.gif

We write n=qpx (or n=qΛx for the second sum), use the periodicity of Φ in u and get

graphic file with name 453_2019_631_Equ241_HTML.gif

The inner sums are Riemann sums converging to the corresponding integrals for p. We set

graphic file with name 453_2019_631_Equ242_HTML.gif

It will be convenient to change variables x=qw in I(uZ) to get

graphic file with name 453_2019_631_Equ58_HTML.gif 14.3

We define the error εp(u,Z) by

graphic file with name 453_2019_631_Equ243_HTML.gif

As the sum and the integral are both analytic in Z, their difference εp(u,Z) is analytic in Z, too. We bound εp(u,Z) by the difference of upper and lower Darboux sums (step size q-p) corresponding to the integral I(uZ): On each interval of length q-p, the maximum and minimum of a Hölder continuous function can differ by at most Inline graphic. As the integration interval as well as the range for u and Z are finite, this translates to the bound Inline graphic as p uniformly in 0u1 and |Z|<2r. This results in

L(N,Z)=I(1,Z)0p<ΛQ(Z)p+0p<ΛQ(Z)pεp(1,Z)+I(ν,Z)Q(Z)Λ+Q(Z)ΛεΛ(ν,Z).

If |Q(Z)|/qα=qRγ+1+RZ-α<1, i.e., Rγ+RZ<α-1, the second sum involving the integration error converges absolutely and uniformly in Z for Λ to some analytic function c(Z); therefore, we can replace the second sum by Inline graphic in this case. If Rγ+RZ>α-1, then the second sum is Inline graphic. By our choice of r, the case Rγ+RZ=α-1 cannot occur. So in any case, we may write the second sum as Inline graphic by our choice of r. The last summand involving εΛ(ν,Z) is absorbed by the error term of the second summand. Note that the error term is uniform in Z and, by its construction, analytic in Z.

Thus we end up with

graphic file with name 453_2019_631_Equ59_HTML.gif 14.4

where

S(N,Z):=I(1,Z)0p<ΛQ(Z)p+I(ν,Z)Q(Z)Λ. 14.5

It remains to rewrite S(NZ) in the form required by (14.1). We emphasise that we will compute S(NZ) exactly, i.e., no more asymptotics for N will play any rôle.

Construction ofΨ. We will now rewrite the expression S(NZ) such that the generating function Ψ [i.e., the fluctuations of the right-hand side of (14.1)] appears. After this, we will gather properties of Ψ including properties of its Fourier coefficients.

We rewrite (14.5) as

graphic file with name 453_2019_631_Equ244_HTML.gif

We replace Λ by logqN-ν and use

graphic file with name 453_2019_631_Equ245_HTML.gif

to get

graphic file with name 453_2019_631_Equ61_HTML.gif 14.6

with

graphic file with name 453_2019_631_Equ62_HTML.gif 14.7

Periodic Extension ofΨ. A priori, it is not clear that the function Ψ(u,Z) defined above can be extended to a periodic function (and therefore Fourier coefficients can be computed later on). The aim now is to show that it is possible to do so.

It is obvious that Inline graphic is continuously differentiable in u[0,1]. We have

graphic file with name 453_2019_631_Equ246_HTML.gif

because I(0,Z)=0 by (14.3). The derivative of Inline graphic with respect to u is

graphic file with name 453_2019_631_Equ247_HTML.gif

which implies that

graphic file with name 453_2019_631_Equ248_HTML.gif

We can therefore extend Inline graphic to a 1-periodic continuously differentiable function in u on R.

Fourier Coefficients ofΨ Knowing that Ψ is a periodic function, we can now head for its Fourier coefficients and relate them to those of Φ.

By using equations (14.7) and (14.3), Q(Z)=qγ+1+Z, and exp(-2πiu)=q-χu with χ=2πilogq, we now express the Fourier coefficients of Inline graphic in terms of those of Inline graphic by

graphic file with name 453_2019_631_Equ249_HTML.gif

The second and third summands cancel, and we get

graphic file with name 453_2019_631_Equ63_HTML.gif 14.8

Extracting Coefficients. So far, we have proven everything in terms of generating functions. We now extract the coefficients of these power series which will give us the result claimed in Proposition 14.1.

By (14.7), Inline graphic is analytic in Z for 0<|Z|<2r. If qγ+11, then it is analytic in Z=0, too. If qγ+1=1, then (14.7) implies that Inline graphic might have a simple pole in Z=0. Note that all other possible poles have been excluded by our choice of r. For j-1, we write

graphic file with name 453_2019_631_Equ250_HTML.gif

and use Cauchy’s formula to obtain

graphic file with name 453_2019_631_Equ251_HTML.gif

This and the properties of Inline graphic established above imply that Ψj is a 1-periodic continuously differentiable function.

Inserting (14.6) in (14.4) and extracting the coefficient of Zm-1 using Cauchy’s theorem and the analyticity of the error in Z yields (14.1) with Inline graphic. Rewriting (14.8) in terms of Ψj and Φj leads to (14.2). Note that we have to add Inline graphic in (14.2) to compensate the fact that we do not include ψj for jm.

We prove a uniqueness result.

Lemma 14.4

Let m be a positive integer, q>1 be a real number, γC such that γ2πilogqZ, cC, and Ψ0,,Ψm-1 and Ξ0,,Ξm-1 be 1-periodic continuous functions such that

graphic file with name 453_2019_631_Equ64_HTML.gif 14.9

for integers N. Then Ψk=Ξk for 0k<m.

Proof

If Rγ<0 and c0, then (14.9) is impossible as the growth of the right-hand side of the equation is larger than that on the left-hand side. So we can exclude this case from further consideration. We proceed indirectly and choose k maximally such that ΞkΨk. Dividing (14.9) by (logqN)k yields

graphic file with name 453_2019_631_Equ65_HTML.gif 14.10

for N. Let 0<u<1 and set Nj=qj+u. We clearly have limjNj=. Then

j+u+logq(1-q-j-u)=logq(qj+u-1)logqNjj+u.

We define νj:=logqNj-j-u and see that Inline graphic for j, i.e., limjνj=0. This implies that limj{logqNj}=u and therefore

limj(Ξk-Ψk)(logqNj)=limj(Ξk-Ψk)({logqNj})=Ξk(u)-Ψk(u).

Setting N=Nj in (14.10) and letting j shows that

Ξk(u)-Ψk(u)=limjcNj-γ[k=0]. 14.11

If k0 or Rγ>0, we immediately conclude that Ξk(u)-Ψk(u)=0. If Rγ<0 we have c=0, which again implies that Ξk(u)-Ψk(u)=0.

Now we assume that Rγ=0 and k=0. We set β:=-logq2πiγ, which implies that N-γ=exp(2πiβlogqN). We choose sequences (r)1 and (s)1 such that lims= and lim|sβ-r|=0: For rational β=r/s, we simply take r=r and s=s, and for irrational β, we consider the sequence of convergents (r/s)1 of the continued fraction of β and the required properties follow from the theory of continued fractions; see for example [28, Theorems 155 and 164]. By using logqNj=j+u+νj, we get

graphic file with name 453_2019_631_Equ252_HTML.gif

These two limits are distinct as βZ by assumption. Thus limjNj-γ does not exist. Therefore, (14.11) implies that c=0 and therefore Ξk(u)-Ψk(u)=0.

We proved that Ξk(u)=Ψk(u) for uZ. By continuity, this also follows for all uR; contradiction.

Proof of Theorem E

We again start with an outline of the proof.

Overview of the Proof of Theorem E

The idea is to compute the repeated summatory function of F twice: On the one hand, we use the pseudo-Tauberian Proposition 14.1 to rewrite the right-hand side of (6.6) in terms of periodic functions Ψaj. On the other hand, we compute it using a higher order Mellin–Perron summation formula, relating it to the singularities of F. More specifically, the expansions at the singularities of F give the Fourier coefficients of Ψaj. The Fourier coefficients of the functions Ψaj are related to those of the functions Φj via (14.2).

And up next comes the actual proof.

Proof of Theorem E

Initial observations and notations. As Φj is Hölder continuous, its Fourier series converges by Dini’s criterion; see, for example, [40, p. 52].

For any sequence g on Z>0, we set (Sg)(N):=1n<Ng(n). We set A=1+max{η,0}. In particular, A is a positive integer with A>η.

Asymptotic Summation. We first compute the Ath repeated summatory function SAF of F (i.e., the (A+1)th repeated summatory function SA+1f of the function f) by applying Proposition 14.1A times. This results in an asymptotic expansion involving new periodic fluctuations while keeping track of the relation between the Fourier coefficients of the original fluctuations and those of the new fluctuations.

A simple induction based on (6.6) and using Proposition 14.1 shows that there exist 1-periodic continuous functions Ψaj for a0 and -1j<m and some constants cab for 0b<a such that

graphic file with name 453_2019_631_Equ67_HTML.gif 14.12

for integers N. In fact, Ψ0j=Φj for 0j<m. For a1 and -1j<m, Ψaj is continuously differentiable. Note that the case that qγ+a+1=1 occurs for at most one 0a<A, which implies that the number of non-vanishing fluctuations increases at most once in the application of Proposition 14.1. Also note that the assumption α>Rγ-γ0 implies that the error terms arising in the application of Proposition 14.1 are absorbed by the error term stemming from (6.6).

We denote the corresponding Fourier coefficients by

ψaj:=01Ψaj(u)exp(-2πiu)du

for 0aA, -1j<m, Z. By (14.2) the generating functions of the Fourier coefficients fulfil

graphic file with name 453_2019_631_Equ253_HTML.gif

for 0a<A, Z and Z0. Iterating this recurrence yields

graphic file with name 453_2019_631_Equ68_HTML.gif 14.13

for Z and Z0.

Explicit Summation. We now compute SA+1f explicitly with the aim of decomposing it into one part which can be computed by the Ath order Mellin–Perron summation formula and another part which is smaller and can be absorbed by an error term.

Explicitly, we have

(Sa+1f)(N)=1n1<n2<<na+1<Nf(n1)=1n<Nf(n)n<n2<<na+1<N1

for 0aA. Note that we formally write the outer sum over the range 1n<N although the inner sum is empty (i.e., equals 0) for nN-a; this will be useful later on. The inner sum counts the number of selections of a elements out of {n+1,,N-1}, thus we have

(Sa+1f)(N)=1n<NN-n-1af(n)=1n<N1a!(N-n-1)a_f(n) 14.14

for 0aA and falling factorials za_:=z(z-1)(z-a+1).

The polynomials 1a!(U-1)a_, 0aA, are clearly a basis of the space of polynomials in U of degree at most A. Thus, there exist rational numbers b0,,bA such that

UAA!=0aAbaa!(U-1)a_.

Comparing the coefficients of UA shows that bA=1. Substitution of U by N-n, multiplication by f(n) and summation over 1n<N yield

1A!1n<N(N-n)Af(n)=0aAba(Sa+1f)(N)

by (14.14). When inserting the asymptotic expressions from (14.12), the summands involving fluctuations for 0a<A are absorbed by the error term Inline graphic of the summand for a=A because Rγ-γ0<1. Thus there are some constants cb for 0b<A such that

graphic file with name 453_2019_631_Equ70_HTML.gif 14.15

for integers N.

If γ+A=b+χ for some 0b<A and Z, then we assume without loss of generality that cb=0: Otherwise, we replace ΨA(m-1)(u) by ΨA(m-1)(u)+cbexp(-2πiu) and cb by 0. Both (14.15) and (14.13) remain intact: the former trivially, the latter because the factor for a=A-b in (14.13) equals γ+A-b-χ+Z=Z which compensates the fact that the Fourier coefficient ψA(m-1)(-) is modified.

Mellin–Perron summation. We use the Ath order Mellin–Perron summation formula to write the main contribution of SA+1f as determined above in terms of new periodic fluctuations Ξj whose Fourier coefficients are expressed in terms of residues of a suitably modified version of the Dirichlet generating function F.

Without loss of generality, we assume that σabs>0: the growth condition (6.8) trivially holds with η=0 on the right of the abscissa of absolute convergence of the Dirichlet series. By the Ath order Mellin–Perron summation formula (see [18, Theorem 2.1]), we have

1A!1n<N(N-n)Af(n)=12πiσabs+1-iσabs+1+iF(s)Ns+As(s+1)(s+A)ds

with the arbitrary choice σabs+1>σabs for the real part of the line of integration.

The growth condition (6.8) allows us to shift the line of integration to the left such that

graphic file with name 453_2019_631_Equ254_HTML.gif

The summand for a in the second term corresponds to a possible pole at s=-a which is not taken care of in the first sum; note that F(s) is analytic at s=-a in this case by assumption because of γ0<-a.

We now compute the residue at s=γ+χ. We use

Ns+A=Nγ+A+χk0(logN)kk!(s-γ-χ)k

to split up the residue as

graphic file with name 453_2019_631_Equ255_HTML.gif

with

graphic file with name 453_2019_631_Equ71_HTML.gif 14.16

for j-1. Note that we allow j=-1 for the case of γ-a+2πilogqZ for some 1aA when F(s)/(s(s+A)) might have a pole of order m+1 at s=-a. Using the growth condition (6.8) and the choice of A yields

graphic file with name 453_2019_631_Equ72_HTML.gif 14.17

for |Is| and s which are at least a distance δ away from the poles γ+χ. By writing the residue in (14.16) in terms of an integral over a rectangle around s=γ+χ (distance again at least δ away from γ+χ), we see that (14.17) implies

graphic file with name 453_2019_631_Equ73_HTML.gif 14.18

for ||. Moreover, by (14.17), we see that

graphic file with name 453_2019_631_Equ256_HTML.gif

Thus we proved that

graphic file with name 453_2019_631_Equ74_HTML.gif 14.19

for

Ξj(u)=Zξjexp(2πiu) 14.20

where the ξj are given in (14.16). By (14.18), the Fourier series (14.20) converges uniformly and absolutely. This implies that Ξj is a 1-periodic continuous function.

Fourier Coefficients. We will now compare the two asymptotic expressions for SA+1f obtained so far to see that the fluctations coincide. We know explicit expressions for the Fourier coefficients of the Ξj in terms of residues, and we know how the Fourier coefficients of the fluctuations of the repeated summatory function are related to the Fourier coefficients of the fluctuations of F. Therefore, we are able to compute the latter.

By (14.15), (14.19), elementary asymptotic considerations for the terms Nb with b>Rγ+A, Lemma 14.4 and the fact that cb=0 if bγ+A+2πilogqZ for some 0b<A, we see that Ξj=ΨAj for -1j<m. This immediately implies that F(0)=0 if γ0<0 and γ2πilogqZ.

To compute the Fourier coefficients ψAj=ξj, we set Z:=s-γ-χ to rewrite (14.16) using (6.7) as

ψAj=[Z-1]b0φbZb-j-11aA(γ+a+χ+Z)=[Zj]b0φbZb1aA(γ+a+χ+Z)

for -1j<m and Z. This is equivalent to

graphic file with name 453_2019_631_Equ257_HTML.gif

for Z and Z0. Clearing the denominator and using (14.13) as announced in Remark 14.3 lead to

graphic file with name 453_2019_631_Equ258_HTML.gif

for Z and Z0. Comparing coefficients shows that ψ0j=φj for 0j<m and Z. This proves (6.9).

Proof of Theorem A

Proof of Theorem A

By Remark 3.2, we have x(n)=e1f(n)v(0). If v(0)=0, there is nothing to show. Otherwise, as observed in Sect. 7.1, v(0) is a right eigenvector of A0 associated to the eigenvalue 1. As a consequence, Kv(0), ϑmv(0) and ϑv(0) all vanish. Therefore, (3.3) follows from Theorem C by multiplication by e1 and v(0) from left and right, respectively. Note that the notation is somewhat different: Instead of powers (logqN)k in Theorem C we write (logN)k/k! here.

The functional equation (3.4) follows from Theorem D for n0=1 by multiplication from right by v(0).

For computing the Fourier coefficients, we denote the rows of T by w1,,wd. Thus wa is a generalised left eigenvector of C of some order ma associated to some eigenvalue λa of C. We can write e1=1adcawa for some suitable constants c1,,cd. For 1ad, we consider the sequence ha on Z>0 with

ha(n)=wa(v(n)+v(0)[n=1]).

The reason for incorporating v(0) into the value for n=1 is that the corresponding Dirichlet series H(a)(s):=n1n-sha(n) only takes values at n1 into account. By definition, we have H(a)(s)=wav(0)+waV(s). Taking the linear combination yields 1adcaH(a)(s)=x(0)+X(s). We choose γ0>logqR such that there are no eigenvalues λσ(C) with logqR<logqλγ0 and such that γ0Z0.

By Theorem B, we have

graphic file with name 453_2019_631_Equ76_HTML.gif 15.1

for N for suitable 1-periodic Hölder continuous functions Ψak (which vanish if |λa|R). By Theorem D, the Dirichlet series H(a)(s) is meromorphic for Rs>γ0 with possible poles at s=logqλa+χ for Z.

The sequence ha satisfies the prerequisites of Theorem E, either with γ=logqλa if Rlogqλa>γ0 or with arbitrary real γ>γ0 and Φj=0 for all j if Rlogqλaγ0. The theorem then implies that

H(a)(0)=0 15.2

if γ0<0 and λa1.

If |λa|>R, Theorem E also yields

Ψak(u)=Zψakexp(2πiu)

where the ψak are given by the singular expansion

H(a)(s)sZ0k<maψak(s-logqλa-χ)k+1 15.3

for Rs>γ0. Note that (15.2) ensures that there is no additional pole at s=0 when γ0<0 and λa1. Also note that in comparison to Theorem E, Φma-1-k there corresponds to Ψak here.

We now have to relate the results obtained for the sequences ha with the results claimed for the original sequence f. For λσ(C) with |λ|>R, we have

Φλk(u)=1adλa=λcaΨak(u).

We denote the Fourier coefficients of Φλk by φλk for Z and will show that these Fourier coefficients actually fulfil (3.5). Taking linear combinations of (15.3) shows that

1adλa=λcaH(a)(s)sZ0k<m(λ)φλk(s-logqλ-χ)k+1

for Rs>γ0.

Summing over all λσ(C) yields (3.5) because summands λ with |λ|R are analytic for Rs>γ0 and do therefore not contribute to the right-hand side.

It might seem to be somewhat artificial that Theorem E is used to prove that H(j)(0)=0 in some of the cases above. In fact, this can also be shown directly using the linear representation; we formulate and prove this in the following remark.

Remark 15.1

With the notations of the proof of Theorem A, H(j)(0)=0 if λj1 and R<1 can also be shown using the functional equation (3.4).

Proof

We prove this by induction on mj. By definition of T, we have wj(C-λjI)=[mj>1]wj+1. (We have md=1 thus wd+1 does not actually occur.) If mj>1, then H(j+1)(0)=0 by induction hypothesis.

We add (I-q-s)v(0) to (3.4) and get

(I-q-sC)(v(0)+V(s))=(I-q-sC)v(0)+1n<qn-sv(n)+q-s0r<qArk1-sk(rq)kV(s+k).

Multiplication by wj from the left yields

(1-q-sλ)H(j)(s)=[mj>1]q-sH(j+1)(s)+wj(I-q-sC)v(0)+wj1n<qn-sv(n)+wjq-s0r<qArk1-sk(rq)kV(s+k).

As R<1 and λj1, the Dirichlet series H(j)(s) is analytic in s=0 by Theorem D. It is therefore legitimate to set s=0 in the above equation. We use the induction hypothesis that H(j+1)(0)=0 as well as the fact that v(n)=Anv(0) (note that v(0) is a right eigenvector of A0 to the eigenvalue 1; see Sect. 7.1) for 0n<q to get

(1-λ)H(j)(0)=wj0n<qAnv(0)-wjCv(0)=0

because all binomial coefficients 0k vanish.

Proof of Proposition 6.4

Proof of Proposition 6.4

We set

j0:=-p(π+arg(λ))2π+1

with the motive that

-π<arg(λ)+2jπpπ

holds for j0j<j0+p. This implies that for j0j<j0+p, the pth root of unity ζj:=exp(2jπi/p) runs through the elements of Up such that logq(λζj)=logq(λ)+2jπi/(plogq). Then

Nlogq(ζjλ)=Nlogqλexp(2jπiplogqN)=Nlogqλexp(2jπilogqpN)=Nlogqλexp(2jπi{logqpN}).

We set

Φ(u):=j0j<j0+pexp(2jπipu)Φ(ζjλ)(u),

thus Φ is a p-periodic function.

For the Fourier series expansion, we get

graphic file with name 453_2019_631_Equ259_HTML.gif

Replacing p+j by leads to the Fourier series claimed in the proposition.

Part IV: Computational Aspects

The basic idea for computing the Fourier coefficients is to use the functional equation in Theorem D. This part describes in detail how this is done. We basically follow an approach found in Grabner and Hwang [25] and Grabner and Heuberger [23], but provide error bounds.

An actual implementation is also available; SageMath [38] code can be found at https://gitlab.com/dakrenn/regular-sequence-fluctuations . We use the Arb library [33] (more precisely, its SageMath bindings) for ball arithmetic which keeps track of rounding errors such that we can be sure about the precision and accuracy of our results.

We use the results of this part to compute Fourier coefficients for our examples, in particular for esthetic numbers (Sect. 9) and Pascal’s rhombus (Sect. 10).

Strategy for Computing the Fourier Coefficients

The computation of the Fourier coefficients relies on the evaluation of Dirichlet series at certain points s=s0. It turns out to be numerically preferable to split up the sum as

F1(s0)=1n<n0n-s0f(n)+Fn0(s0)

for some suitable n0 (see Sect. 18.2), compute the sum of the first n0-1 summands directly and evaluate Fn0(s0) as it is described in the following.

For actually computing the Fourier coefficients, we use a formulation in terms of a residue; for instance, see (3.6) where this is formulated explicitly in the set-up of Theorem A. As said, we will make use of the functional equation (6.3) for the matrix-valued Dirichlet series Fn0(s) with its right-hand side, the matrix-valued Dirichlet series Gn0(s).

Let us make this explicit for a simple eigenvalue λ1 of C and a corresponding eigenvector w. Then w(I-q-sC)=w(1-q-sλ) and (6.3) can be rewritten as

wF1(s)=11-q-sλwG1(s).

Thus, wF1(s) has simple poles at s=logqλ+χ for all Z, where χ=2πilogq. By (6.7) and (6.9) of Theorem E (with κ=logqλ and m=1), the th Fourier coefficient is given by the residue

graphic file with name 453_2019_631_Equ260_HTML.gif

Note that logq is the derivative of 1-q-sλ with respect to s evaluated at the pole s=logqλ.

By (6.4), Gn0(logqλ+χ) is expressed in terms of an infinite sum containing Fn0(logqλ+χ+k) for k1. We truncate this sum and bound the error; this is the aim of Sect. 18.1 and in particular Lemma 18.2. We can iterate the above idea for the shifted Dirichlet series Fn0(logqλ+χ+k) which leads to a recursive evaluation scheme. Note that once we have computed Gn0(logqλ+χ+k), we get Fn0(logqλ+χ+k) by solving a system of linear equations.

Details on the Numerical Computation

Bounding the Error

We need to estimate the approximation error which arises if the infinite sum over k1 in (6.4) is replaced by a finite sum. It is clear that for large Rs and n0, the value Fn0(s) will approximately be of the size of its first summand n0-sf(n0). In view of Inline graphic, this will be rather small. We give a precise estimate in a first lemma.

Lemma 18.1

Let n0>1 and let M:=max0r<q||Ar||. For Rs>logqM+1, we have

nn0||f(n)||nRsM(Rs-logqM-1)(n0-1)Rs-logqM-1.

Proof

By definition of M, we have ||f(n)||M1+logqn=MnlogqM. Therefore, we have

nn0||f(n)||nRsMnn01nRs-logqMMn0-1dnnRs-logqM=M(Rs-logqM-1)(n0-1)Rs-logqM-1

where we interpret the sum as a lower Riemann sum of the integral.

We now give a bound for the approximation error in (6.4).

Lemma 18.2

Let n0>1 and M as in Lemma 18.1. Let K1 and sC be such that Rs+K>max(logqM+1,0).

Then

Gn0(s)-n0n<qn0n-sf(n)-q-s0r<qAr1k<K-sk(rq)kFn0(s+k)q-Rs-sKM(Rs+K-logqM-1)(n0-1)Rs+K-logqM-10r<q||Ar||(rq)K.

Proof

We set

D:=Gn0(s)-n0n<qn0n-sf(n)-q-s0r<qAr1k<K-sk(rq)kFn0(s+k)

and need to estimate ||D||.

By definition of Gn0(s), we have

Gn0(s)=(1-q-sC)Fn0(s)=n0n<qn0n-sf(n)+Fqn0(s)-q-sCFn0(s)=n0n<qn0n-sf(n)+0r<qnn0Arf(n)(qn+r)s-q-sCFn0(s)=n0n<qn0n-sf(n)+q-s0r<qArnn0f(n)ns((1+rqn)-s-1).

Thus we have

D=q-s0r<qArnn0f(n)ns((1+rqn)-s-0k<K-sk(rqn)k).

For 0x<1, Taylor’s theorem (or induction on K1 using integration by parts) implies that

(1+x)-s-0k<K-skxk=K0x-sK(1+t)-s-K(x-t)K-1dt.

For 0tx<1, we can bound |(1+t)-s-K| from above by 1 since we have assumed that Rs+K>0. Thus

(1+x)-s-0k<K-skxkK-sK0x(x-t)K-1dt=-sKxK.

Thus we obtain the bound

||D||q-Rs-sK0r<q||Ar||(rq)Knn0||f(n)||nRσ+K.

Bounding the remaining Dirichlet series by Lemma 18.1 yields the result.

Choices of Parameters

As mentioned at the beginning of this part, we choose the Arb library [33] for reliable numerical ball arithmetic. In our examples (esthetic numbers in Sect. 9 and Pascal’s rhombus in Sect. 10), we choose n0=1024 and recursively compute Fn0(logqλ+χ+k) for k1 by (6.4). In each step, we keep adding summands for k1 until the bound of the approximation error in Lemma 18.2 is smaller than the smallest increment which can still be represented with the chosen number of bits. For plotting the graphs, we simply took machine precision; for the larger number of significant digits in Table 2, we used 128 bits precision.

Non-vanishing Coefficients

Using reliable numerical arithmetic for the computations (see above) yields small balls in which the true value of the Fourier coefficients is. If such a ball does not contain zero, we know that the Fourier coefficient does not vanish. If the ball contains zero, however, we cannot decide whether the Fourier coefficient vanishes. We can only repeat the computation with higher precision and hope that this will lead to a decision that the coefficient does not vanish, or we can try to find a direct argument why the Fourier coefficient does indeed vanish, for instance using the final statement of Theorem B (3).

Vanishing Fourier coefficients appear in our introductory Example 3.1: In its continuation (Example 3.3) an alternative approach is used to compute these coefficients explicitly symbolically. In this way a decision for them being zero is possible. The same is true for the example of transducers in Sect. 8.

It should also be noted that in the analysis of esthetic numbers (example in Sect. 9) we could have modelled the problem by a complete transducer (by just introducing a sink) and then applied the results of Sect. 8. This would have led to an asymptotic expansion where the fluctuations of the main term (corresponding to the eigenvalue q) would in fact have vanished, but an argument would have been needed. So we chose a different approach in Sect. 9 to avoid this problem. There the eigenvalue q does no longer occur. This implies that the fluctuations for q of the transducer approach vanish. Note also that half of the remaining fluctuations still turn out to vanish: this is shown in the proof of Corollary G.

Acknowledgements

Open access funding provided by University of Klagenfurt.

Footnotes

1

In the standard literature [2, 3] these sequences are called k-regular sequences (instead of q-regular sequences).

2

The code accompanying this article can be found at https://gitlab.com/dakrenn/regular-sequence-fluctuations . It is meant to be used with the open source mathematics software SageMath [38].

3

We use a functional notation for sequences, i.e., a sequence x on Z0 is seen as function x:Z0C.

4

Whenever we write that r-1r0 is the q-ary digit expansion of n, we mean that rj{0,,q-1} for 0j<, r-10 and n=0j<rjqj. In particular, the q-ary expansion of zero is the empty word.

5

Note that the summatory function X(N) contains the summand x(0) but the Dirichlet series cannot. This is because the choice of including x(0) into X(N) will lead to more consistent results.

6

We use the notion of singular expansion as defined by Flajolet, Gourdon and Dumas [17, Definition 2]: it is the formal sum of the principal parts of a meromorphic function over all poles in the domain given.

7

If 1σ(C), then the matrix C-I is singular. In that case, ϑ0 will never be used.

8

Chebyshev polynomials are frequently occurring phenomena in lattice path analysis, see for instance [7, 16]. We have such a lattice path here, so their appearance is not surprising.

9

Up to replacing 2X by X, the polynomials Un used here correspond to the polynomials pn used in [8].

10

Note that v(0)=A0v(0) and v(1)=A1v(0) are indeed true.

C. Heuberger and D. Krenn are supported by the Austrian Science Fund (FWF): P 28466-N35.

The extended abstract [30] (with appendices containing proofs available as arXiv:1802.03266) imposes a restriction on the asymptotic growth. The extended abstract [29] (with appendices containing proofs available as arXiv:1808.00842) lifts this restriction by completely getting rid of the corresponding technical condition. This article now contains the full (majorly restructured) proof covering all cases. It is shorter and simpler. We now use a generating functions approach which also gives additional insights. For example, the cancellations in the proof in [30] seem to be a kind of magic at that point, but with the new approach, it is now clear and no surprise anymore that they have to appear. Besides, the examples investigated in [29, 30] are now presented with full details. A new part on computational aspects of the computation of Fourier coefficients is added. Reading strategies for various interests are now outlined in Part I so that readers find their ways through this article.

The authors thank Helmut Prodinger for his early involvement and Sara Kropf for her comments on an early version of this paper.

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Contributor Information

Clemens Heuberger, Email: clemens.heuberger@aau.at.

Daniel Krenn, Email: math@danielkrenn.at, Email: daniel.krenn@aau.at.

References

  • 1.Allouche J-P, Mendès France M, Peyrière J. Automatic Dirichlet series. J. Number Theory. 2000;81(2):359–373. doi: 10.1006/jnth.1999.2487. [DOI] [Google Scholar]
  • 2.Allouche J-P, Shallit J. The ring of k-regular sequences. Theor. Comput. Sci. 1992;98(2):163–197. doi: 10.1016/0304-3975(92)90001-V. [DOI] [Google Scholar]
  • 3.Allouche J-P, Shallit J. Automatic Sequences: Theory, Applications, Generalizations. Cambridge: Cambridge University Press; 2003. [Google Scholar]
  • 4.Allouche J-P, Shallit J. The ring of k-regular sequences, II. Theor. Comput. Sci. 2003;307(1):3–29. doi: 10.1016/S0304-3975(03)00090-2. [DOI] [Google Scholar]
  • 5.Berthé V, Lhote L, Vallée B. Probabilistic analyses of the plain multiple gcd algorithm. J. Symb. Comput. 2016;74:425–474. doi: 10.1016/j.jsc.2015.08.007. [DOI] [Google Scholar]
  • 6.Berthé V, Rigo M, editors. Combinatorics, Automata and Number Theory. Encyclopedia of Mathematics and Its Applications. Cambridge: Cambridge University Press; 2010. [Google Scholar]
  • 7.de Bruijn NG, Knuth DE, Rice SO. The Average Height of Planted Plane Trees, Graph Theory and Computing. New York: Academic Press; 1972. pp. 15–22. [Google Scholar]
  • 8.De Koninck J-M, Doyon N. Esthetic numbers. Ann. Sci. Math. Québec. 2009;33(2):155–164. [Google Scholar]
  • 9.Delange H. Sur la fonction sommatoire de la fonction “somme des chiffres”. Enseign. Math. (2) 1975;21:31–47. [Google Scholar]
  • 10.Drmota, M., Grabner, P.J.: Analysis of digital functions and applications, Combinatorics, automata and number theory (Valérie Berthé and Michel Rigo (eds.), Encyclopedia Math. Appl., vol. 135, pp. 452–504, Cambridge University Press, Cambridge (2010)
  • 11.Drmota M, Szpankowski W. A master theorem for discrete divide and conquer recurrences. J. ACM. 2013;60(3):16. doi: 10.1145/2487241.2487242. [DOI] [Google Scholar]
  • 12.Dumas P. Joint spectral radius, dilation equations, and asymptotic behavior of radix-rational sequences. Linear Algebra Appl. 2013;438(5):2107–2126. doi: 10.1016/j.laa.2012.10.013. [DOI] [Google Scholar]
  • 13.Dumas P. Asymptotic expansions for linear homogeneous divide-and-conquer recurrences: algebraic and analytic approaches collated. Theor. Comput. Sci. 2014;548:25–53. doi: 10.1016/j.tcs.2014.06.036. [DOI] [Google Scholar]
  • 14.Dumas P, Lipmaa H, Wallén J. Asymptotic behaviour of a non-commutative rational series with a nonnegative linear representation. Discrete Math. Theor. Comput. Sci. 2007;9(1):247–272. [Google Scholar]
  • 15.Fekete M. Über die Verteilung der Wurzeln bei gewissen algebraischen Gleichungen mit ganzzahligen Koeffizienten. Math. Z. 1923;17:228–249. doi: 10.1007/BF01504345. [DOI] [Google Scholar]
  • 16.Flajolet P. Combinatorial aspects of continued fractions. Discrete Math. 1980;32(2):125–161. doi: 10.1016/0012-365X(80)90050-3. [DOI] [Google Scholar]
  • 17.Flajolet P, Gourdon X, Dumas P. Mellin transforms and asymptotics: harmonic sums. Theor. Comput. Sci. 1995;144:3–58. doi: 10.1016/0304-3975(95)00002-E. [DOI] [Google Scholar]
  • 18.Flajolet P, Grabner P, Kirschenhofer P, Prodinger H, Tichy RF. Mellin transforms and asymptotics: digital sums. Theor. Comput. Sci. 1994;123:291–314. doi: 10.1016/0304-3975(92)00065-Y. [DOI] [Google Scholar]
  • 19.Flajolet P, Odlyzko A. Singularity analysis of generating functions. SIAM J. Discrete Math. 1990;3:216–240. doi: 10.1137/0403019. [DOI] [Google Scholar]
  • 20.Godsil CD, Royle G. Algebraic Graph Theory, Graduate Texts in Mathematics. New York: Springer; 2001. [Google Scholar]
  • 21.Goldwasser J, Klostermeyer W, Mays M, Trapp G. The density of ones in Pascal’s rhombus. Discrete Math. 1999;204(1–3):231–236. doi: 10.1016/S0012-365X(98)00373-2. [DOI] [Google Scholar]
  • 22.Goč Daniel, Mousavi Hamoon, Shallit Jeffrey. Language and Automata Theory and Applications. Berlin, Heidelberg: Springer Berlin Heidelberg; 2013. On the Number of Unbordered Factors; pp. 299–310. [Google Scholar]
  • 23.Grabner PJ, Heuberger C. On the number of optimal base 2 representations of integers. Des. Codes Cryptogr. 2006;40(1):25–39. doi: 10.1007/s10623-005-6158-y. [DOI] [Google Scholar]
  • 24.Grabner PJ, Heuberger C, Prodinger H. Counting optimal joint digit expansions. Integers. 2005;5(3):A9. [Google Scholar]
  • 25.Grabner PJ, Hwang H-K. Digital sums and divide-and-conquer recurrences: Fourier expansions and absolute convergence. Constr. Approx. 2005;21:149–179. doi: 10.1007/s00365-004-0561-x. [DOI] [Google Scholar]
  • 26.Graham RL, Knuth DE, Patashnik O. Concrete Mathematics. A Foundation for Computer Science. 2. Reading: Addison-Wesley; 1994. [Google Scholar]
  • 27.Hardy GH, Riesz M. The General Theory of Dirichlet’s Series. Cambridge Tracts in Mathematics and Mathematical Physics. Cambridge: Cambridge University Press; 1915. [Google Scholar]
  • 28.Hardy GH, Wright EM. An Introduction to the Theory of Numbers. 4. Oxford: University Press; 1975. [Google Scholar]
  • 29.Heuberger Clemens, Krenn Daniel. 2019 Proceedings of the Sixteenth Workshop on Analytic Algorithmics and Combinatorics (ANALCO) Philadelphia, PA: Society for Industrial and Applied Mathematics; 2019. Esthetic Numbers and Lifting Restrictions on the Analysis of Summatory Functions of Regular Sequences; pp. 27–35. [Google Scholar]
  • 30.Heuberger, C., Krenn, D., Prodinger, H.: Analysis of summatory functions of regular sequences: transducer and Pascal’s rhombus. In: Fill, J.A., Ward, M.D. (eds.) Proceedings of the 29th International Conference on Probabilistic, Combinatorial and Asymptotic Methods for the Analysis of Algorithms, Leibniz International Proceedings in Informatics (LIPIcs), vol. 110, Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, pp. 27:1–27:18 (2018)
  • 31.Heuberger C, Kropf S, Prodinger H. Output sum of transducers: limiting distribution and periodic fluctuation. Electron. J. Combin. 2015;22(2):1–53. [Google Scholar]
  • 32.Hwang H-K, Janson S, Tsai T-H. Exact and asymptotic solutions of a divide-and-conquer recurrence dividing at half: theory and applications. ACM Trans. Algorithms. 2017;13(4):47. doi: 10.1145/3127585. [DOI] [Google Scholar]
  • 33.Johansson F. Arb: efficient arbitrary-precision midpoint-radius interval arithmetic. IEEE Trans. Comput. 2017;66(8):1281–1292. doi: 10.1109/TC.2017.2690633. [DOI] [Google Scholar]
  • 34.Jungers R. The Joint Spectral Radius. Theory and Applications. Lecture Notes in Control and Information Sciences. Berlin: Springer; 2009. [Google Scholar]
  • 35.Lagarias JC, Wang Y. The finiteness conjecture for the generalized spectral radius of a set of matrices. Linear Algebra Appl. 1995;214:17–42. doi: 10.1016/0024-3795(93)00052-2. [DOI] [Google Scholar]
  • 36.NIST Digital Library of Mathematical Functions. http://dlmf.nist.gov/. Release 1.0.16 of 2017-09-18 (2017), Olver, F.W.J., Daalhuis, A.B.O., Lozier, D.W., Schneider, B.I., Boisvert, R.F., Clark, C.W., Miller, B.R., Saunders, B.V. (eds.)
  • 37.Rota G-C, Strang G. A note on the joint spectral radius. Indag. Math. 1960;22:379–381. doi: 10.1016/S1385-7258(60)50046-1. [DOI] [Google Scholar]
  • 38.SageMath Developers: SageMath Mathematics Software (Version 8.3) (2018). http://www.sagemath.org
  • 39.The On-Line Encyclopedia of Integer Sequences (2018). http://oeis.org
  • 40.Zygmund A. Trigonometric Series. Cambridge: Cambridge University Press; 2002. [Google Scholar]

Articles from Algorithmica are provided here courtesy of Springer

RESOURCES