TITLE: Evaluate the sum with special function
QUESTION [9 upvotes]: Evaluate the following sum: $$\sum \limits_{n=1}^{\infty}\dfrac{2^{<n>}+2^{-<n>}}{2^n}$$ where $<n>$ the nearest integer to $\sqrt{n}$.

REPLY [6 votes]: Since $(k−1/2)^2 = k^2 −k+1/4$ and $(k+1/2)^2 = k^2 +k+1/4$, it follows
that $<j>=k$ if and only if $k^2 −k+1\le j\le k^2+k$. Hence 
$$
\begin{align}
\lim_{n\to \infty}\sum_{j=1}^n \frac{2^{<j>}+2^{-<j>}}{2^j}&=\sum_{k=1}^\infty \sum_{<j>=k}^{k^2+k}\frac{2^{<j>}+2^{-<j>}}{2^j}\\
&=\sum_{k=1}^\infty \sum_{n=k^2-K+1}^{k^2+k}\frac{2^k+2^{-k}}{2^n}\\
&=\sum_{k=1}^\infty (2^k +2^{−k})(2^{−k^2+k}−2^{−k^2−k})\\
&=\sum_{k=1}^\infty(2^{−k(k−2)}−2^{−k(k+2)})\\
&=\sum_{k=1}^\infty 2^{−k(k−2)} -\sum_{k=3}^\infty 2^{−k(k−2)}=3
\end{align}
$$