What is the exact value of the following limit?
$$L=\lim_{n\to\infty}\left(\frac{n}{2}+\min_{x\in\mathbb{R}}\sum_{k=0}^n{\cos(2^k x)}\right)$$
Experimenting on desmos suggests the following claims:
$\sum_{k=0}^n{\cos{(2^k x)}}$ is minimized when $x\approx \left(2m\pm\dfrac{2}{3}\right)\pi,m\in\mathbb{Z}$, with the approximation approaching equality as $n\to\infty$
$L\approx -0.704$
I do not know how to prove these claims.
(This question was inspired by another question.)

This is far from an answer. The goal is to simplify the expression and to connect this problem with ergodic theory. We first note that w.l.o.g, we can assume $x\in[0,\pi]$. Denote $y=x/\pi$. Let the binary expansion of $y$ be $0.y_{1}y_{2}…y_{k}…$ (we exclude the expansion ending with all $0$ to make it unique). Then some algebra will show for $k\geq 1$ $cos(2^ky\pi)=cos(2*(0.y_{k}y_{k+1}…)*\pi)$.
Now let us define a few maps. Let $G$ maps $y\in[0,1]$ to the spaces of sequences (with each entry being either 0 or 1) $(y_{1},y_{2},……)$ using the binary expansion and let $G^{-1}$ be the inverse. Then define the Bernoulli shift $T$ on $(y_{1},y_{2},……)$ by $T(y_{1},y_{2},……)= (y_{2},y_{3},……)$
Finally, $\frac{1}{n}\sum_{k=1}^{k=n}cos(2^kx)=\frac{1}{n}\sum_{k=1}^{k=n}cos(2\pi G^{-1}T^{k-1}Gy)$. Then by using the Birkhoff ergodic theorem, for almost all $y$, the above converges to $\int_{0}^{1}cos(2\pi t)dt = 0$. But for $ y=\frac{2}{3}=0.101010…$, an explicit calculation shows that in this special case, the limit is $-\frac{1}{2}$