So I am wondering if there exists a general procedure for the following problem: 

given a monotonically increasing function $f(n)$ which is nonegative on the interval $[0,\infty)$ and grows faster than $c^n$ for some positive constant $c$

How do I evaluate:

$$ \text{Res} \left[\left( \sum_{n=0}^{\infty} e^{-s f(n)} \right)x^s \Gamma(s) , s=0\right]  $$ 


I believe this question is actually tractable even IF  $\sum_{n=0}^{\infty} e^{-s f(n)} $ has a natural boundary passing through $s = 0$ which makes the definition of a residue itself ill defined. (with SOME exceptions for weird $f(n)$). 

So a procedure to numerically calculate this would be to do the following, calculate the constant term from the fourier expansion of 

$$ \lim_{x \rightarrow \infty} \frac{d}{dx} \left[ \sum_{n=0}^{\infty} e^{-\frac{f(n)}{e^x}} \right]  $$ 

The justification of this can be seen via Mellin Inversion. For sufficiently slowing growing $f(n)$ it can be proven as well as experimentally verified that the expression below

$$ \lim_{x \rightarrow \infty} \left[  \frac{d}{dx} \left[ \sum_{n=0}^{\infty} e^{-\frac{f(n)}{e^x}} \right]   \right] $$

In the limit is guaranteed to be a sum of complex exponentials with non-positive real argument ($e^{ax}$ where $\text{Re}(a) \le 0$). Now what's interesting is that even if $f(n)$ is extremely fast growing (to the point that Mellin Inversion is NO longer well defined because of natural boundary conditions) you can still experimentally verify this sum of exponentials behavior persists. This motivates the following procedure:

If it looks periodic:

1. find the period $p$ numerically in the limit by just graphing the function for some very large $x$ and then guessing and checking
2. Integrate the function at $\int_{x}^{x+p} [ \frac{d}{dx} \left[ \sum_{n=0}^{\infty} e^{-\frac{f(n)}{e^x}} \right]  ] $ for some interval that's far away.


Now I'll be the first one to admit the procedure above sucks. Because 1. It's purely numerical with no hope of giving a closed form even when possible and 2. It is a very clearly a hack. 3. It assumes our output is periodic and we don't have that guarantee. Our only guarantee is that it will be a sum of complex exponentials. 

So I was hoping someone with a stronger analysis skills than I could tell me what the real method for taking this limit should be? (I will add that there are subtleties here where some unusual $f(n)$ might cause an essential singularity but I have reason to believe that this is unlikely for most functions).

So some qualitative data: 

If we let $f(n)=2^n$ then this limit tends to $1$ 

If we let $f(n) = n!$ then we can see the wave like form below that we need to numerically integrate to extract its constant term. With link to the graph [here:][1] 

[![enter image description here][2]][2] 






  [1]: https://www.desmos.com/calculator/0niz016for
  [2]: https://i.sstatic.net/Allmt.png