[Cauchy's integral formula](https://en.wikipedia.org/wiki/Cauchy%27s_integral_formula) is a powerful method to extract the $n$'th power series coefficient of an analytic function by evaluating a single complex integral. Is there any such analytic method to extract (ordinary) Dirichlet series coefficients? That is, assuming that a given function $f(s)$ admits a Dirichlet series expansion $$\sum\_n a\_n n^{-s},$$ is there any known method to compute a desired coefficient $a\_n$?



Extracting Dirichlet series coefficients
Even for more general Dirichlet series
$$f(z)=\sum\_{0}^\infty a\_n e^{-\lambda\_nz}$$
there is the formula
$$a\_ne^{-\lambda\_n\sigma}=\lim\_{T\to\infty}\frac{1}{T}\int\_{t\_0}^Tf(\sigma+it)e^{\lambda\_n it}dt,$$
where $t\_0$ is arbitrary (real) and $\sigma>\sigma\_u$, the abscissa of uniform convergence.


This formula determines both $\lambda\_n$ and $a\_n$: the RHS=0 when we integrate against $e^{i\lambda t}$ with $\lambda\neq \lambda\_n$.
The class of functions which can be represented by such a series is called (analytic) almost periodic functions (on a vertical line $\{s=\sigma+it:t\in R\}$). The "number-theoretic case" corresponds to $\lambda\_n=n$.


Ref. S. Mandelbrojt, Series de Dirichlet, Paris, Gauthier-Villars, 1969.
Dirichlet series with complex $\lambda\_n$ have been also studied (by A. F. Leont'ev and his school).


