# Number of Terms in Expansion of Polynomial

Let

\[\begin{align*}P(x)&=\displaystyle\prod_{n=1}^{10}\left(x^{2^n}-x^{2^{n-1}}+1\right)\\&=(x^2-x+1)(x^4-x^2+1)\ldots(x^{1024}-x^{512}+1).\end{align*}\]

Let \(N\) be the number of terms with non-zero coefficients when \(P(x)\) is expanded (including the constant term). What is the remainder when \(N\) is divided by \(1000\)?