TITLE: Finding out the coeffcient next to $x^2$ in $(\cdots(x-2)^2-2)^2\cdots-2)^2$.
QUESTION [5 upvotes]: In need to find out the coefficient next to $x^2$ in polynomial $(\cdots(x-2)^2-2)^2\cdots-2)^2$, where we nest the expression $(x-2)^2$ n times.
Meaning that for $n=1$ we get $(x-2)^2$, for $n=2$ we get $((x-2)^2-2)^2=(x^2-4x+2)^2$
Which I won't even try to expand, since already I see that no trivial recurrence applies...

REPLY [5 votes]: Let's find the recurrance for the low order terms of 
$$f_n(x)=(\cdots(x-2)^2-2)^2\cdots -2)^2 =a_n+b_nx+c_bx^2+x^3(\ldots)$$
where $f_1(x)=(x-2)^2=x^2-4x+4$ and $f_{n+1}(x)=(f_n(x)-2)^2$.
We find
$$\begin{align}f_{n+1}(x)&=(a_n-2+b_nx+c_nx^2+x^3(\ldots))^2\\
&=(a_n-2)^2+2(a_n-2)b_nx+(b_n^2+2(a_n-2)c_n)x^2+x^3\cdot(\ldots)
 \end{align}$$
Note that the starting value $a_1=4$ and the recursion $a_{n+1}=(a_n-2)^2$ lead to $a_n=4$ for all $n$. Thus for $b_n$ we have the recursion $b_{n+1}=4b_n$ and forom the starting value see (and prove by induction) $b_n=-4^n$.  Thus for $c_n$ we have the starting value $c_1=1$ and $$c_{n+1}=16^n+4c_n $$
Playing with the first few values a striking pattern emerges in their binary representation. From that pattern we guess
$$c_n= \frac{4^n-1}{3}\cdot 4^{n-1}$$
and verify by induction that this guess is correct.