As requested in the comments:
We start by factoring the polynomial $x^{1024}-1$. To do that, we note that $1$ is a root, as is every $2^k-$root of $1$ for $k=0,\cdots 10$. For $k>0$ such a root of unity is also a $2^{k-1}-$st root of $-1$ so our polynomial is divisible by $$(x-1)\times \prod_{k=0}^9(x^{2^k}+1)$$
Comparing the lead terms shows that this is in fact equal to our polynomial.
Now, let $x=3$. We remark that $$3\equiv -1 \pmod 4 \implies 3^{2i}+1\equiv 2 \mod 4$$ so most of the terms in the product are divisible by $2$ but not by $4$. $3-1=2$, of course, and $3+1=4$ is the only term in the product divisible by a higher power of $2$. $(3-1)(3+1)$ then gives us a factor of $2^3$ and the other nine terms in the product each give us exactly one factor of $2$, making the answer $12$ as desired.