Background
I have been recently toying with the following function:
$$ f(x) = x - x^2 + x^4 - x^8 + x^{16} - \dots = \sum_{r=0}^\infty (-1)^{r}x^{2^r}$$
My idea was to expand around $x \to \phi$ where $\phi + \phi^2 = 1$ and evaluate the answer for the first $n$ terms.
It's obvious the answer must be of the form:
$$ f(\phi) = \lim_{n \to \infty}(a_1(n) + a_2(n) \phi)$$
where $a_1(n)$ and $a_2(n)$ is the sum of the first $n$ terms in the simplified to the form: $$\sum_{r=0}^n (-1)^{r}\phi^{2^r} = \underbrace{\text{Integer}_1}_{a_1(n)} + \underbrace{\text{Integer}_2}_{a_2(n)} \phi $$
Question
Is there any nice asymptotic or exact expression a for $a_1(n)$ and $a_2(n)$?