How to find no. of polynomials over a finite field satisfying given condition. If i am given with a polynomial $$g(x) = \sum_{i=0}^4 a_ix^i$$ where $a_i \in \mathbb{F}_{2^k}$, finite field with $2^k$ elements. How to find out the no of such polynomials $g(x)$ such that either $g(w) = 0$ or $g(w^{-1}) = 0$, where $w$ is primitive $5^{th}$ root of unity. 
 A: You are asking for the number of polynomials $g(x)$ of degree $\le4$ such that $g(x)$ is divisible by the minimal polynomial of either $w$ or $w^{-1}$ over $K=\Bbb{F}_{2^k}$. The answer depends on the degree of those minimal polynomials (they actually coincide for three quarters of choices of $k$), so we split the treatment accordingly.
A key parameter is the extension degree $m=[K(w):K]$. Because $5\mid (2^4-1)$, the smallest field containing $w$ is $\Bbb{F}_{2^4}$. Therefore the extension degree $m$ is the smallest positive integer such that $4\mid (mk)$. An alternative way of saying the same thing is that $m$ is the smallest positive integer such that $5\mid 2^{mk}-1$. Clearly, $m=4$ when $k$ is odd, $m=2$ when $k\equiv2\pmod4$ and $m=1$ when $4\mid k$. 
Case 1: $m=1$, or $4\mid k$. In this case $5\mid 2^k-1$ so $w$ is actually an element of $K$ as is obviously also $w^{-1}=w^4$. The minimal polynomial of $w$ is $x-w$. Therefore we have $g(w)=0$ if and only if $g(x)=(x-w)h(x)$ for some polynomial $h(x)=h_0+h_1x+h_2x^2+h_3x^3\in K[x]$. All those four coefficients $h_i$ can be chosen freely, so there are $2^{4k}$ such polynomials. Similarly we see that $g(w^{-1})=0$ if and only if $g(x)=(x-w^{-1})h(x)$ for some at most cubic polynomial $h(x)$. Superficially this gives us another $2^{4k}$ polynomials $g(x)$. But, we are double counting those polynomials $g(x)$ that have both $w$ and $w^{-1}$ as zeros. This happens if and only if 
$g(x)=(x-w)(x-w^{-1})f(x)$ for some polynomial $f(x)$ that can be at most quadratic. As $f(x)=f_0+f_1x+f_2x^2$ has three coefficients we can choose freely, there are $2^{3k}$ ways this can happen. The conclusion is that

when $4\mid k$ the number of polynomials $g(x)$ is $2^{4k}+2^{4k}-2^{3k}=2^{4k+1}-2^{3k}$.

Case 2: $m=2$, or $k\equiv2\pmod4$. Here $5\nmid 2^k-1$ but $5\mid 2^{2k-1}=(2^k-1)(2^k+1)$. Therefore $5\mid 2^k+1$ and $2^k\equiv-1\pmod5$. In this case the minimal polynomial $m(x)$ of $w$ over $K$ is a quadratic. By Galois theory
$$m(x)=(x-w)(x-w^{2^k})=(x-w)(x-w^{-1})=x^2+\omega x+1,$$
where $\omega=w+w^{-1}$ is an element of $K$. Actually, aided by a discrete logarithm table of $\Bbb{F}_{16}$ we can easily verify that $\omega$ is one of the third primitive roots of unity in $K$ (the choice of the third root of unity depends on the choice of which fifth root of unity we call $w$). Anyway, in this case $g(w)=0$ if and only if $g(w^{-1})=0$ if and only if $g(x)=m(x)f(x)$ for some polynomial $f(x)=f_0+f_1x+f_2x^2$. Again, we can choose the coefficients $f_0,f_1,f_2$ any which way we want and

when $k\equiv2\pmod4$ the number of such polynomials $g(x)$ is $2^{3k}$.

Case 3: $m=4$, $k$ odd. In this time the minimal polynomial of $w$ has degree four. Because $w$ is trivially a zero of $m(x)=(x^5-1)/(x-1)=x^4+x^3+x^2+x+1$, this is then also the minimal polynomial. As in case 2, $m(x)$ is also the minimal polynomial of $w^{-1}$. In this case we must have
$g(x)=m(x)r(x)$, but by considering the degrees we see that $r(x)$ must be a constant polynomial. Therefore there are $2^k$ choices of $r(x)$.

When $k$ is odd the number of polynomials $g(x)$ with either $w$ or $w^{-1}$ as a zero is $2^k$.

A: I believe the answer is: $1.$ Indeed, $q(x) = \sum_{i=0}^4 x^i$ is such a polynomial (for both $w$ and $1/w$), now let $g(x)$ be your polynomial, and consider $h(x)=g(x) - a_0 q(x)$ this will vanish at $w,$ but it is divisible by $x,$ and if $h(x)$ were not the zero polynomial, $w$ would satisfy an equation of degree less than four, which would make it not primitive.
