Dirichlet series inversion

In analytic number theory, a Dirichlet series, or Dirichlet generating function (DGF), of a sequence is a common way of understanding and summing arithmetic functions in a meaningful way. A little known, or at least often forgotten about, way of expressing formulas for arithmetic functions and their summatory functions is to perform an integral transform that inverts the operation of forming the DGF of a sequence. This inversion is analogous to performing an inverse Z-transform to the generating function of a sequence to express formulas for the series coefficients of a given ordinary generating function.

For now, we will use this page as a compendia of "oddities" and oft-forgotten facts about transforming and inverting Dirichlet series, DGFs, and relating the inversion of a DGF of a sequence to the sequence's summatory function. We also use the notation for coefficient extraction usually applied to formal generating functions in some complex variable, by denoting $$[n^{-s}] D_f(s) =: f(n)$$ for any positive integer $$n \geq 1$$, whenever


 * $$D_f(s) := \sum_{n \geq 0} \frac{f(n)}{n^s}, \quad \Re(s) > \sigma_{0,f},$$

denotes the DGF (or Dirichlet series) of f which is taken to be absolutely convergent whenever the real part of s is greater than the abscissa of absolute convergence, $$\sigma_{0,f} \in \mathbb{R}$$.

The relation of the Mellin transformation of the summatory function of a sequence to the DGF of a sequence provides us with a way of expressing arithmetic functions $$f(n)$$ such that $$f(1) \neq 0$$, and the corresponding Dirichlet inverse functions, $$f^{-1}(n)$$, by inversion formulas involving the summatory function, defined by


 * $$S_f(x) := {\sum_{n \leq x}}^\prime f(n), \quad \forall x \geq 1.$$

In particular, provided that the DGF of some arithmetic function f has an analytic continuation to $$s \mapsto -s$$, we can express the Mellin transform of the summatory function of f by the continued DGF formula as


 * $$\mathcal{M}[S_f](s) = -\frac{D_f(-s)}{s}.$$

It is often also convenient to express formulas for the summatory functions over the Dirichlet inverse function of f using this construction of a Mellin inversion type problem.

DGFs for Dirichlet inverse functions
Recall that an arithmetic function is Dirichlet invertible, or has an inverse $$f^{-1}(n)$$ with respect to Dirichlet convolution such that $$(f \ast f^{-1})(n) = \delta_{n,1}$$, or equivalently $$f \ast f^{-1} = \mu \ast 1 \equiv \varepsilon$$, if and only if $$f(1) \neq 0$$. It is not difficult to prove that is $$D_f(s)$$ is the DGF of f and is absolutely convergent for all complex s satisfying $$\Re(s) > \sigma_{0,f}$$, then the DGF of the Dirichlet inverse is given by $$D_{f^{-1}}(s) = 1 / D_f(s)$$ and is also absolutely convergent for all $$\Re(s) > \sigma_{0,f}$$. The positive real $$\sigma_{0,f}$$ associated with each invertible arithmetic function f is called the abscissa of convergence.

We also see the following identities related to the Dirichlet inverse of some function g that does not vanish at one:


 * $$\begin{align}(g^{-1} \ast \mu)(n) & = [n^{-s}]\left(\frac{1}{\zeta(s) D_g(s)}\right) \\ (g^{-1} \ast 1)(n) & = [n^{-s}]\left(\frac{\zeta(s)}{D_g(s)}\right).\end{align}$$

Summatory functions
Using the same convention in expressing the result of Perron's formula, we assume that the summatory function of a (Dirichlet invertible) arithmetic function $$f$$, is defined for all real $$x \geq 0$$ according to the formula


 * $$S_f(x) := {\sum_{n \leq x}}^{\prime} f(n) = \begin{cases} 0, & 0 \leq x < 1 \\ \sum\limits_{n < [x]} f(n), & x \in \mathbb{R} \setminus \mathbb{Z}^{+} \wedge x \geq 1 \\ \sum\limits_{n \leq [x]} f(n) - \frac{f(x)}{2}, & x \in \mathbb{Z}^{+}. \end{cases}$$

We know the following relation between the Mellin transform of the summatory function of f and the DGF of f whenever $$\Re(s) > \sigma_{0,f}$$:


 * $$D_f(s) = s \cdot \int_1^{\infty} \frac{S_f(x)}{x^{s+1}} dx.$$

Some examples of this relation include the following identities involving the Mertens function, or summatory function of the Moebius function, the prime zeta function and the prime-counting function, and the Riemann prime-counting function:


 * $$\begin{align}\frac{1}{\zeta(s)} & = s \cdot \int_1^{\infty} \frac{M(x)}{x^{s+1}} dx \\ P(s) & = s \cdot \int_1^{\infty} \frac{\pi(x)}{x^{s+1}} dx \\ \log \zeta(s) & = s \cdot \int_0^{\infty} \frac{\Pi_0(x)}{x^{s+1}} dx.\end{align}$$

Classical integral formula
For any s such that $$\sigma := \Re(s) > \sigma_{0,f}$$, we have that


 * $$f(x) \equiv [x^{-s}] D_f(s) = \lim_{T \rightarrow \infty} \frac{1}{2T} \int_{-T}^T x^{\sigma+\imath t} D_f(\sigma+\imath t) \, dt.$$

If we write the DGF of f according to the Mellin transform formula of the summatory function of f, then the stated integral formula simply corresponds to a special case of Perron's formula. Another variant of the previous formula stated in Apostol's book provides an integral formula for an alternate sum in the following form for $$c,x > 0$$ and any real $$\sigma > \sigma_{0,f}-c$$ where we denote $$\Re(s) := \sigma$$:


 * $${\sum_{n \leq x}}^{\prime} \frac{f(n)}{n^s} = \frac{1}{2\pi\imath} \int_{c-\imath\infty}^{c+\imath\infty} D_f(s+z) \frac{x^z}{z} dz.$$

Direct proof: from Apostol's book

 * 1) Define the Dirichlet series $f(s) = \sum_{n=1}^\infty a_n n^{-s}$  and its associated partial sums $F(x) = \sum_{n=1}^x a_n$.
 * 2) Define the function $g(x) = \sum_{n=1}^x a_n \lfloor x/n \rfloor$.
 * 3) Use partial summation to write $F(x) = \int_1^x g(t) dt + a_1$.
 * 4) Apply the Euler–Maclaurin summation formula to obtain an approximation for $F(x)$  in terms of $g(x)$  and its derivatives.
 * 5) Express the error term in the approximation as an integral of a certain function $R(u)$  over the interval $[1, x]$.
 * 6) Use Abel's summation formula to express $g(x)$  as a sum of integrals involving $f(s)$  and its derivatives.
 * 7) Express the integrals involving $f(s)$  and its derivatives in terms of $R(u)$  and its derivatives.
 * 8) Substitute the results from steps 4, 5, and 7 into the formula from step 3, and simplify to obtain the classical integral formula for Dirichlet inversion.

This proof shows that the function $f(s)$ can be recovered from its associated Dirichlet series by means of an integral, which is known as the classical integral formula for Dirichlet inversion.

Special cases of the formula
If we are interested in expressing formulas for the Dirichlet inverse of f, denoted by $$f^{-1}(n)$$ whenever $$f(1) \neq 0$$, we write $$D_f(s) = 1 + s \cdot A_f(s)$$. Then we have by absolute convergence of the DGF for any $$\Re(s) > \sigma_{0,f}$$ that


 * $$\begin{align}\int \frac{x^{\imath t}}{D_f(\sigma+\imath t)} \,dt & = \int \left(\sum_{j \geq 0} (\sigma+\imath t)^{j} \times \sum_{k=0}^{j} (-1)^k D_f(\sigma+\imath t)^k \frac{\log^{j-k}(x)}{(j-k)!}\right) \, dt.\end{align}$$

Now we can call on integration by parts to see that if we denote by $$F^{(-m)}(x) = \sum_{n \geq 0} \frac{F^{(n)}(0)}{n!} x^{n+m} \times \frac{n!}{(n+m)!}$$ denotes the $$m^{th}$$ antiderivative of F, for any fixed non-negative integers $$k \geq 0$$, we have


 * $$\int (ax+b)^k \cdot F(ax+b) \, dx = \sum_{j=0}^{k} \frac{k!}{a \cdot j!} (-1)^{k-j} t^j F^{(j+1-k)}(ax+b).$$

Thus we obtain that


 * $$\begin{align}\int_{-T}^T \frac{x^{\imath t}}{D_f(\sigma+\imath t)} \, dt & = \frac{1}{\imath} \left(\sum_{j \geq 0} \sum_{k=0}^j \sum_{m=0}^k \frac{k!}{m!} (-1)^m (\sigma+\imath t)^{m} \left[D_f^k\right]^{(j+1-k)}(\sigma+\imath t) \frac{\log^{j-k}(x)}{(j-k)!}\right) \Biggr|_{t=-T}^{t=+T}.\end{align}$$

We also can relate the iterated integrals for the $$k^{th}$$ antiderivatives of F by a finite sum of k single integrals of power-scaled versions of F:


 * $$F^{(-k)}(x) = \sum_{i=0}^{k-1} \binom{k-1}{i} \frac{(-1)^i}{(k-1)!} \int \frac{F(x)}{x^i} \, dx.$$

In light of this expansion, we can then write the partially limiting T-truncated Dirichlet series inversion integrals at hand in the form of


 * $$\begin{align}\frac{1}{2T} \int_{-T}^T \frac{x^{\imath t}}{D_f(\sigma+\imath t)} \, dt & = \frac{1}{2T \cdot \imath} \left(\sum_{j \geq 0} \sum_{k=0}^{j} \sum_{m=0}^k \sum_{n=0}^{j-k} \binom{j-k}{n} \frac{(-1)^{k+n+m} \cdot k!}{(j-k)! \cdot m!} (\sigma+\imath t)^{m} \frac{\log^{j-k}(x)}{(j-k)!} \int_{0}^{\sigma+\imath t} \left[A_f^k\right](v) \frac{dv}{v^n} \right) \Biggr|_{t=-T}^{t=+T} \\ & = \frac{1}{2T \cdot \imath} \left(\sum_{j \geq 0} \sum_{k=0}^{j} \sum_{m=0}^k \frac{(-1)^{j-k} \cdot (-s)^m}{m!} \frac{\log^{k}(x)}{k!} \int_0^1 s \cdot D_f^{j-k}(rs) \left(1-\frac{1}{rs}\right)^k \, dv\right) \Biggr|_{s=\sigma-\imath T}^{s=\sigma+\imath T} \\ & = \frac{s\left(e^{-s}+O_s(1)\right)}{2T \cdot \imath} \int_0^{1} \frac{x^{1-\frac{1}{rs}}}{1+D_f(rs)} dr \Biggr|_{s=\sigma-\imath T}^{s=\sigma+\imath T} \\ & = \frac{\left(e^{-s}+O_s(1)\right)}{2T \cdot \imath} \int_0^{s} \frac{x^{1-\frac{1}{v}}}{1+D_f(v)} \, dv \Biggr|_{s=\sigma-\imath T}^{s=\sigma+\imath T}.\end{align}$$

Statements in the language of Mellin transformations

 * The Dirichlet generating function of a sequence $$a(n)$$ is the Mellin transform of the sequence, evaluated at $$s=1$$: $\sum_{n=1}^\infty \frac{a_n}{n^s} = \int_0^\infty x^{s-1} \left(\sum_{n=1}^\infty a_n e^{-nx}\right) dx = \mathcal{M}{a_n}(s)$.
 * The Dirichlet inverse of a sequence $$a(n)$$ is related to the inverse Mellin transform of its generating function: $a_n = \frac{1}{2\pi i} \int_{c-i\infty}^{c+i\infty} \frac{\sum_{m=1}^\infty \frac{\mu(m)}{m^{s}}\mathcal{M}{a_n}(s)}{n^s} ds$, where $$c$$ is a real number greater than the abscissa of convergence of the Dirichlet series $\sum_{n=1}^\infty a_n/n^s$.
 * The Mellin transform of a convolution of two sequences $$a(n)$$ and $$b(n)$$ is the product of their Mellin transforms: $\mathcal{M}{(a*b)_n}(s) = \mathcal{M}{a_n}(s) \mathcal{M}{b_n}(s)$.
 * If $$a(n)$$ is a sequence and $$f(x)$$ is a function such that the integral $\int_0^\infty \frac{f(x)}{x^{s+1}}dx$ converges absolutely and uniformly for $$s$$ in some right half plane, then we can define a Dirichlet series by $a_n = \frac{1}{n^s}\int_0^\infty f(x) e^{-nx}dx$, and the Dirichlet series is the Mellin transform of $$f(x)$$.

A formal generating-function-like convolution lemma
Suppose that we wish to treat the integrand integral formula for Dirichlet coefficient inversion in powers of $$(\imath t)^k$$ where $$[(\imath t)^{k}] F(\sigma+\imath t) = F^{(k)})(\sigma) / k!$$, and then proceed as if we were evaluating a traditional integral on the real line. Then we have that


 * $$\begin{align}\hat{D}_f(x; \sigma, T) & := \int_{-T}^T x^{\sigma+\imath t} D_f(\sigma+\imath t)\, dt \\ & = \sum_{m \geq 0} \int_{-T}^{T} x^{\sigma+\imath t} (\imath t)^m \frac{D_f^{(m)}(\sigma)}{m!} \\ & = \sum_{m \geq 0} \int_{-T}^T t^{2m} x^{\sigma+\imath t} \frac{(-1)^m D_f^{(2m)}(\sigma)}{(2m)!}\,dt + \imath \times \sum_{m \geq 0} \int_{-T}^T t^{2m+1} x^{\sigma+\imath t} \frac{(-1)^m A^{(2m+1)}(\sigma)}{(2m+1)!} \,dt.\end{align}$$

We require the result given by the following formula, which is proved rigorously by an application of integration by parts, for any non-negative integer $$m \geq 0$$:


 * $$\begin{align}\hat{I}_m(T) & := \int_{-T}^{T} \frac{(\imath t)^m}{m!} x^{\imath t} \,dt \\ & = \sum_{r=0}^{m} \frac{\left(x^{\imath T} + (-1)^{r+1} x^{-\imath T}\right) (-\imath)^{r+1}}{\log^{k+1-r}(x)} \cdot \frac{T^r}{r!} \\ & = \frac{\cos(T \log x)}{T \log x} \times \sum_{r=0}^{\lfloor k/2 \rfloor} \frac{(-1)^{r+1} T^{2r}}{\log^{k-2r}(x) (2r)!} + \frac{\sin(T \log x)}{T \log x} \times \sum_{r=0}^{\lfloor k/2 \rfloor} \frac{(-1)^{r+1} T^{2r+1}}{\log^{k-2r-1}(x) (2r+1)!}.\end{align}$$

So the respective real and imaginary parts of our arithmetic function coefficients f at positive integers x satisfy:


 * $$\begin{align}\operatorname{Re}(f(x)) & = x^{\sigma} \times \lim_{T \rightarrow \infty} \sum_{m \geq 0} D_f^{(2m)}(\sigma) \cdot \frac{\hat{I}_{2m}(T)}{2T} \\ \operatorname{Im}(f(x)) & = x^{\sigma} \times \lim_{T \rightarrow \infty} \sum_{m \geq 0} D_f^{(2m+1)}(\sigma) \cdot \frac{\hat{I}_{2m+1}(T)}{2T}.\end{align}$$

The last identities suggest an application of the Hadamard product formula for generating functions. In particular, we can work out the following identities which express the real and imaginary parts of our function f at x in the following forms:


 * $$\begin{align}\operatorname{Re}(f(x)) & = \lim_{T \rightarrow \infty} \left[\frac{x^{\sigma}}{2T} \times \frac{1}{2\pi} \int_{-\pi}^{\pi} \left(D_f(\sigma+\imath T \cdot e^{\imath s}) + D_f(\sigma - \imath T e^{\imath s})\right) \left(FUNC(e^{-\imath s})\right) \, ds\right] \\

\operatorname{Im}(f(x)) & = \lim_{T \rightarrow \infty} \left[\frac{x^\sigma}{2T} \times \frac{1}{2\pi} \int_{-\pi}^\pi \left(D_f(\sigma+\imath T \cdot e^{\imath s}) - D_f(\sigma - \imath T e^{\imath s}\right) \, ds \right].\end{align}$$

Notice that in the special case where the arithmetic function f is strictly real-valued, we expect that the inner terms in the previous limit formula are always zero (i.e., for any T).