How to determine the asymptotics of $\sum_{n=0}^{\infty} e^{-\frac{2^n}{x}}$ I'm generally interested in being able to find an asymptotic expansion of
$$ \sum_{n=0}^{\infty} \left[ e^{- \frac{f(n)}{x}} \right] $$
As $x \rightarrow \infty$ and $f(n)$ is a smooth monotonically increasing function of $n$.
A particular concrete problem I'm working on is:
$$ \sum_{n=0}^{\infty} \left[ e^{- \frac{2^n}{x}} \right] $$
I know that the function:
$$ \sum_{n=0}^{\infty} \left[ e^{- \frac{n}{x}} \right] $$
Is asymptotically equal to $x$ (and higher order terms involve the bernoulli numbers) by a rather convoluted argument involving $u = - \frac{1}{x}$ and then observing the singularity at $u=0$ from the left of $\sum_{n=0}^{\infty} \left[ e^{nu} \right]$  is of type $\frac{1}{u}$ (via laurent expansion of $\frac{1}{1-e^u}$ ) .
These techniques do not seem to generalize once I replace my $f(n)$ with any other monotonically increasing function other than $n$. Mainly the problem is that by making that transformation I go from a montonically growing function that I do not understand to a singularity that I understand even less. Without the ability to make algebraic manipulations with closed forms its hard to reason about these singularities.
Some work to get started:
I think there's $\log_2(x)$ involved somewhere here since the function
$$ \frac{1}{\log_2(x)} \sum_{n=0}^{\infty} \left[ e^{- \frac{2^n}{x}} \right] $$
seems to grow very very very slowly. But there was absolutely no "rigor" in how I arrived at that result.

 A: Here is an elementary derivation of the first-order asymptotic for
\begin{equation*}
    f(x):=\sum_{n=0}^\infty a_n(x) 
\end{equation*}
(as $x\to\infty$), where
\begin{equation*}
    a_n(x):=e^{-2^n/x}. 
\end{equation*}
Let
\begin{equation*}
    x_n:=\frac{2^n}{\ln2}. 
\end{equation*}
Then for integers $j$
\begin{equation*}
    a_{n+j}(x_n)=2^{-2^j},
\end{equation*}
and hence
\begin{equation*}
    \sum_{j=0}^\infty a_{n+j}(x_n)=C:=\sum_{j=0}^\infty 2^{-2^j}<\infty \tag{1}\label{1}
\end{equation*}
and
\begin{equation*}
    f(x_n)\ge\sum_{m=0}^{n-k} a_m(x_n)\ge(n-k)a_{n-k}(x_n)=(n-k)2^{-2^{-k}}\sim n
\end{equation*}
if $k\to\infty$ and $k=o(n)$.
By \eqref{1},
\begin{equation*}
    f(x_n)=\sum_{m=0}^{n-1} a_m(x_n)+C\le n+C\sim n  
\end{equation*}
(as $n\to\infty$).
So, $f(x_n)\sim n$, and hence $f(x_{n+1})\sim n+1\sim n$. Since $f$ is increasing, we have $f(x)\sim n$ for $x\in[x_n,x_{n+1}]$. Also, $\ln x_n\sim n\ln2\sim\ln x_{n+1}$, so that $\ln x\sim n\ln2$ for $x\in[x_n,x_{n+1}]$. Thus,
\begin{equation}
    f(x)\sim\frac{\ln x}{\ln2}=\log_2 x
\end{equation}
as $x\to\infty$.
A: Note that
$$\sum_{n=0}^{\infty}\frac{1}{(2^n)^s}=\frac{2^s}{2^s-1}.$$
It now follows by Mellin inversion that
$$\sum_{n=0}^{\infty}e^{-2^n/x} = \frac{1}{2\pi i}\int_{3-i\infty}^{3+i\infty}\frac{2^s}{2^s-1}x^s\Gamma(s)ds.$$
Using Stirling's formula, we can push the contour to the left and collect residues at the poles of the integrand, which are at $s=2\pi i j/(\log 2)$ for each $j\in\mathbb{Z}$ and at $s=-k$ for each positive integer $k$.  The main term
$$\frac{\log x}{\log 2}$$
arises from the pole at $s=0$.
Even though there are infinitely many poles on the line $\Re(s)=0$, their contribution is small because of the rapid decay of $|\Gamma(it)|$ when $t$ is real and $|t|\to\infty$.
More generally, suppose that $f(n)$ is such that $|f(n)|$ does not grow too rapidly, and define
$$
F(s) = \sum_{n=1}^{\infty}\frac{f(n)}{n^s}.
$$
Then we have that
$$
G(x) = \sum_{n=1}^{\infty}f(n) e^{-n/x}=\frac{1}{2\pi i}\int_{c-i\infty}^{c+i\infty}F(s)x^s\Gamma(s)ds,
$$
where $c>0$ is large enough to ensure that the integrand converges absolutely.  An asymptotic for $G(x)$ (or maybe only an upper bound for $|G(x)|$) will depend on the growth of $|F(s)|$ and on the location of and residues at the poles of $F$ (if any poles exist at all).  The specific application above follows when $f(n)$ is the indicator function of whether $n$ is a power of $2$.
(To be clear, my logs are all in the natural base.)
ADDED:  The full expansion is
$$
\sum_{n=0}^{\infty}e^{-2^n/x} = \frac{\log x-\gamma}{\log 2}+\frac{1}{2}+\frac{2}{\log 2}\sum_{j=1}^{\infty}\Re\Big(x^{\frac{2\pi ij}{\log 2}}\Gamma\Big(\frac{2\pi i j}{\log 2}\Big)\Big)-\sum_{j=1}^{\infty}\frac{(-1)^{j}}{j!}\frac{x^{-j}}{2^j-1}.
$$
