Limiting behaviour of elementary sequence I am curious about the limiting behaviour of a certian sequence of functions
$$f_n:=\left(\sum_{k=1}^{\infty} 2^{-k} e^{i2^{k}/n}\right)^n$$
-where $i$ is the imaginary unit-to get a conjecture about the behaviour as $n$ tends to infinity I truncated the series at $1000$ (matlab does not really allow higher powers).
Then the modulus of the first $100$ items, i.e. $\{ \vert f_n \vert; n\in \{1,...,100\}\}$ of the sequence are shown here 
So I find it hard to say whether the sequence tends to zero or not. Can one say analytically whether it converges or keeps on oscillating?
 A: Assume that $n$ goes to infinity so that $\lim 2^{m_0}/n=\alpha$ for certain integer $m_0$ which grows together with $n$. Then $|f_n|\to F(\alpha)$, where
$$
F(\alpha)=\exp\left(-\alpha^{-1}\sum_{t=-\infty}^\infty 2^{-t}\sin^2 2^t\alpha\right). \quad\quad(\star)
$$
Note that $F(2\alpha)=2F(\alpha)$ for $\alpha>0$, but $F$ is not constant. (Is there a short way to verify this being not constant without explicit accurate enough calculations?) So we may suppose without loss of generality that $2^{m_0}\leqslant n<2^{m_0+1}$.
Denoting $$z_n=\sum_{j=1}^{\infty} 2^{-j} e^{i2^{j}/n}$$
we get $$|f_n|^2=(z_n\overline{z_n})^n,\\z_n\overline{z_n}=\sum_{j,k=1}^\infty 
2^{-(j+k)}e^{i(2^j-2^k)/n}=\sum_{j,k=1}^\infty 
2^{-(j+k)}\cos\frac{2^j-2^k}n=\\
1-4\sum_{j>k}2^{-(j+k)}\sin^2\frac{2^{j-1}-2^{k-1}}n=1-\sum_{m=1}^\infty S_m,\quad S_m:=\sum_{\ell=0}^{m-1}2^{-m-\ell}\sin^2\frac{2^{m}-2^{\ell}}n.$$
Let's bound $S_m$. If $m\leqslant m_0$, i.e., $2^m\leqslant n$, we have $\sin \frac{2^m-2^l}n=\Theta(\frac{2^m-2^l}n)=\Theta(\frac{2^m}n)$ and $S_m=\Theta(\frac{2^m}{n^2})$. Thus $$\sum_{m\leqslant m_0} S_m=\Theta\left(\frac1{n^2}\sum_{m\leqslant m_0} 2^m\right)=\Theta\left(\frac1n\right).$$
If $m>m_0$, we may bound the sine by 1 that gives
$$
S_m\leqslant \sum_{\ell=0}^{m-1}2^{-m-l}=2^{1-m},
$$
thus
$$
\sum_{m> m_0} S_m\leqslant \sum_{m>m_0} 2^{1-m}\leqslant \frac4n.
$$
We get $z_n\overline{z_n}=1-\Theta(1/n)$ that is equivalent to $\log |f_n|=\Theta(1)$.
Now fix $\varepsilon>0$. We may find large $M$ such that $$\sum_{m:|m-m_0|>M} S_m<\varepsilon n^{-1}$$ from above estimates. Therefore with accuracy $\varepsilon$ the value of $n\sum_m S_m$ comes from $m$ near $m_0$. Denote $m_0=m+t$, and fix an integer $t$. We get
$$
S_m\sim 2^{1-m_0-t}\sin^2 \frac{2^{m_0+t}}n
\sim 2\alpha^{-1} n^{-1} 2^{-t} \sin^2 2^t\alpha.
$$
This gives $(\star)$.
