<s>[INST] Calculation limit: $\lim\limits_{n\to\infty} \sum\limits_{k=0}^n \frac{1}{2^k-n}$ 
$$\lim_{n\to\infty} \sum_{k=0}^n \frac{1}{2^k-n}$$

My main issue with the sequence $a_k=\frac{1}{2^k-n}$ is that there will always be a value of $k$ for which the sequence will not be properly defined (at least if $n=2^k$ for some value of $k$). Having said that, if we ignore this issue, I am not really sure what might be the proper way to calculate this limit (Sandwich theorem? )
Will be happy to hear some thoughts. Thank you!
 [/INST] Consider the subsequence of $n \not= 2^m$. Now it makes sense talking of the sequence and the limit (if it exists). Write $n=2^m + r$ with $r\in(0,2^m)$.
Then $\lfloor\log{n}\rfloor = m$ and $\lceil\log{n}\rceil = m+1$. Notice that $m\to \infty$ as $n \to \infty$, but the same is not true for $r$. So
$$
\sum_{k=0}^n \frac{1}{2^k-n} = \sum_{k=0}^{\lfloor\log{n}\rfloor} \frac{1}{2^k-n} + \sum_{k=\lceil\log{n}\rceil}^n \frac{1}{2^k-n}
$$
The LHS can be rewritten as
\begin{align}
0>\sum_{k=0}^{\lfloor\log{n}\rfloor} \frac{1}{2^k-n} 
&=\sum_{k=0}^{\lfloor\log{n}\rfloor}\frac{-1}{n-2^k} \\
&=\sum_{k=0}^{m}\frac{-1}{2^m + r -2^k}  \\
&=\sum_{k=0}^{m}\frac{-1}{r + 2^m - 2^k}  \\
&=\sum_{k=0}^{m}\frac{-1}{r + \sum_{j=k}^{m-1} 2^j}  \\
&= \frac{-1}{r}+\sum_{k=1}^{m-1}\frac{-1}{r + \sum_{j=i}^{m-1} 2^j}  \\
\end{align}
However we have $r + \sum_{j=i}^{m-1} 2^j \geq 2^{m-1}$ so $\sum_{k=1}^{m-1}\frac{-1}{r + \sum_{j=i}^{m-1} 2^j}$ is bounded by $\sum_{k=1}^{m-1}\frac{-1}{2^{m-1}} = \frac{m-1}{2^{m-1}}$.
Finally, the LHS is
$$
\sum_{k=0}^{\lfloor\log{n}\rfloor} \frac{1}{2^k-n} \geq \frac{-1}{r} + \frac{-(m-1)}{2^{m-1}} ``\to \frac{-1}{r}"
$$
More formally, we can write $r=r(n)$, $m=m(n)$ and
$$
\lim_{n\to\infty} \text{LHS} = \lim_{n\to\infty} \frac{-1}{r(n)}
$$
The RHS can be written as
\begin{align}
0<\sum_{k=\lceil\log{n}\rceil}^n \frac{1}{2^k-n} &= \sum_{i=0}^{n-\lceil\log{n}\rceil} \frac{1}{2^{\lceil\log{n}\rceil + i}-n} \\ 
&= \sum_{i=0}^{n-(m+1)} \frac{1}{2^{m+1 + i}-(2^m+r)} \\
&= \frac{1}{2^{m+1}-(2^m+r)} + \sum_{i=1}^{n-(m+1)} \frac{1}{2^{m+1}2^{i}-(2^m+r)} = \cdots
\end{align}
However, $-(2^m+r) \geq -2^{m+1}$, so
\begin{align}
\cdots&\leq \frac{1}{2^{m+1}-2^m-r} + \sum_{i=1}^{n-(m+1)} \frac{1}{2^{m+1}(2^{i}-1)} \\
&=\frac{1}{2^m-r} + \frac{1}{2^{m+1}}\sum_{i=1}^{n-(m+1)} \frac{1}{2^{i}-1} \\
&\leq \frac{1}{2^m-r} + \frac{1}{2^{m+1}}\frac{1}{2} "\to \frac{1}{2^{m}-r}",
\end{align}
or more formally
$$
\lim_{n\to\infty} \text{RHS} = \lim_{n\to\infty} \frac{1}{2^{m(n)}-r(n)}.
$$
We can conclude that the limit doesn't exist. Consider the two subsequences
$\{n_{1,j} = 2^{j-1} - 1\}$ $(m_1 = {j-1}, r_1=2^{j-1}-1)$ and $\{n_{2,j} = 2^j+1\}$ $(m_2=j, r_2=1)$. Then
$$
\lim_{n_1 \to \infty}\text{LHS} = 0, \quad \lim_{n_1 \to \infty}\text{RHS} = -1,
$$
$$
\lim_{n_1 \to \infty} \sum_{k=0}^\infty \frac{1}{2^k-n_1} = -1,
$$
and
$$
\lim_{n_2 \to \infty}\text{LHS} = -1, \quad \lim_{n_2 \to \infty}\text{RHS} = 0,
$$
$$
\lim_{n_2 \to \infty} \sum_{k=0}^\infty \frac{1}{2^k-n_2} = -1.
$$
Therefore the sequence doesn't converge. You can find many other convergent subsequences, for example a sequence converging to $0$ or to $\frac{\pm 1}{d}$ for any $d$.
Essentially the whole sum reduces to only two terms
\begin{align}
\lim_{n\to\infty}\sum_{k=0}^{n}\frac{1}{2^k-n} &= \lim_{n\to\infty}\left(\frac{1}{2^{\lfloor \log{n}\rfloor} - n} + \frac{1}{2^{\lceil \log{n}\rceil} - n}\right) \\
&= \lim_{n\to\infty}\left( \frac{1}{2^m - r} - \frac{1}{r}\right).
\end{align}
</s>