Prove $a_0=a_1=\dots =a_{p-1}$ If $w=\cos \frac{2\pi}{p}+i\sin \frac{2\pi}{p}$ and $p$ is a prime and $a_0,a_1,\dots ,a_{p-1}$ are non zero integers and $a_{p-1}w^{p-1}+\dots +a_1w+a_0=0$ Prove $a_0=a_1=\dots =a_{p-1}$
I got a solution somewhere but don't know how it works:
"The thing is that $\Phi_p (X)$ is irreducible (except for 2 cuz parity) and it divides $P(X)=\sum\limits_{i=0}^{p-1} a_iX^i$
 A: $\mathbb Z[x]$ is the ring of polynomials with integer co-efficients. Definition: Any $f(x)\in Z[x]$ is irreducible in $Z[x]$ iff whenever $g(x), h(x)\in \mathbb Z[x]$ and $f(x)=g(x)h(x)$ then at least one of $g(x),h(x)$ is a constant.
$(\bullet)$. Let $f(x)\in \mathbb Z[x]$ be irreducible in $Z[x]$ with deg$(f(x))>0$ and let  $z\in \mathbb C$ satisfy $f(z)=0.$ If $0\ne g(x)\in \mathbb Z[x]$ and $g(z)=0$ then $g(x)=f(x)h(x)$ for some $h(x)\in \mathbb Z[x].$
Theorem. (Eisenstein). If $f(x)=\sum_{j=0}^n A_jx^j\in \mathbb Z[x]$ with $n\geq 1$, and if  $p$ is a prime number  such that...... (i) $p$ does not divide $A_n,$ and (ii) $p$ divides $A_j$ for $0\leq j\leq n-1,$ and (iii) $p^2$ does not divide $A_0,$...... then $f(x)$ is irreducible in $\mathbb Z[x].$ This is usually called Eisenstein's Criterion:  A sufficient (but not necessary) condition for $f(x)\in \mathbb Z[x]$ to be irreducible in $\mathbb Z[x].$ 
With $p$ prime and $w=\cos (2\pi /p) +i \sin (2\pi /p)$ we have $0=w^p-1=(w-1)f_p(w),$  where $$f_p(x)=\sum_{j=0}^{p-1}x^j$$ and $w\ne 1$ so $f_p(w)=0.$
For $x\ne 1$ let $x=y+1$ and we  have $$f_p(x)=\frac {x^p-1}{x-1} =\frac {(y+1)^p-1}{y}= \sum_{j=0}^{p-1}\binom {p}{j+1}y^j= k_p(y).$$
Now $p$ is prime so $\binom {p}{j+1}$ is divisible by $p$ for  $0\leq j\leq p-2.$ And $\binom {p}{p}=1$ while $\binom {p}{1}=p$ is not divisible by $p^2.$ So $k_p(x)$ meets Eisenstein's Criterion: $k_p(y)$ is irreducible in $Z[y].$
Therefore $f_p(x)$ is irreducible in $\mathbb Z[x].$ 
Because if $f_p(x)=g(x)h(x)$ with $g(x),h(x)\in \mathbb Z[x]$ then  $k_p(y)=f_p(x-1)=g(x-1)h(x-1)=g(y)h(y)$ so at least one of $g(y),h(y)$ is constant.
Finally, if $g_p(x)=\sum_{j=0}^{p-1} a_jx^j\in \mathbb Z[x]$ and not all $a_j$ are $0,$ and if $g_p(w)=0$ then  by $(\bullet)$ there exists $h(x)\in \mathbb Z[x]$ such that $g_p(x)=h(x)f_p(x).$ This implies $$p-1\geq \deg (g_p(x))=\deg (h(x))+\deg (f_p(x))=\deg (h(x))+p-1$$ so $h(x)$ is a constant: $h(x)= K. $ Then $a_j=K$ for $0\leq j\leq p-1.$
Remark. I have employed a typical abuse of notation, using $f(x), k_p(y),$ etc., to denote  functions and using $f(z),f(w),$ etc., to denote numbers.
A: $w$ is a primitive $p$-th root of unity in $\mathbf C$ and its minimal polynomial is the cyclotomic polynomial
$$\Phi_p(X)=X^{p-1}+X^{p-2}+\dots+X+1. $$
As all minimal polynomial it generates the ideal $I(w)\subset\mathbf Q[X]$ of all polynomials which vanish at $w$. So there's a polynomial $Q(X)$ such that
$$F(X):=a_{p-1}X^{p-1}+a_{p-2}X^{p-2}+\dots+a_1X+a_0=Q(X)\Phi_p(X).$$
However, as $F(X)$ and $\Phi_p(X)$ have the same degree $p-1$, $Q(X)$ must be a constant $c$, so
$$a_{p-1}=a_{p-2}=\dots=a_1=a_0=c.$$
A: With
$w = \cos \dfrac{2\pi}{p} + i \sin \dfrac{2\pi}{p}, \tag 1$
$p$ a prime, 
we have
$w^p = 1, \tag 2$
whence
$(w - 1)(\sum_0^{p - 1} w^i) = w^p - 1 = 0; \tag 3$
since $w \ne 1$, this implies
$\phi_p(w) = \sum_0^{p - 1} w^i = w^{p - 1} + w^{p - 2} + \ldots + w + 1 = 0. \tag 4$
An easy and well-known application of Eisenstein's criterion shows that the polynomial
$\phi_p(x) = \sum_0^{p - 1} x^i = x^{p - 1} + x^{p - 2} + \ldots + x + 1 = 0 \tag 5$
is irreducible over $\Bbb Q$; thus, since $w$ satisfies $\phi_p(x)$, this polynomial must be the minimal polynomial of $w$ over $\Bbb Q$; indeed, if there were non-constant $f(x) \in \Bbb Q[x]$ with $f(w) = 0$ of minimum degree $\deg f(x) < \deg \phi_p(x)$, then by the division algorithm for polynomials we could write
$\phi_p(x) = q(x) f(x) + r(x), \tag 6$
with either (i.) $r(x) = 0$, or (ii.) $r(x) \ne 0$ and $\deg r(x) < \deg f(x)$; in case (ii.), from (6) we would have
$r(w) = \phi_p(w) - q(w) f(w) = 0, \tag 7$
and if $\deg r(x) = 0$, (7) implies $r(x) = 0$ identically, contradicting $r(x) \ne 0$; thus, $\deg r(x) \ge 1$, and  since $\deg r(x) < \deg f(x)$, this contradicts the minimality of $f(x)$ as a non-constant polynomial with $f(w) = 0$; thus we rule out case (ii), whence $r(x) = 0$ so that
$\phi_n(x) = q(x) f(x); \tag 8$
this, however, contradicts the irreducibility of $\phi_p(x)$; thus $\phi_p(x)$ is the minimal polynomial of $w$ over $\Bbb Q$.
Now suppose $0 \ne a_i \in \Bbb Z$, $0 \le i \le p -1$ and $a_{p - 1} = a_{p - 2} = \ldots = a_1 = a_0$ does not hold; consider
$a(x) = \sum_0^{p - 1} a_ix^i = a_{p - 1} x^{p - 1} + a_{p - 2} x^{p - 2}  + \ldots + a_1 x + a_0. \tag 9$
Assuming $a(w) = 0$, we form the polynomial
$\Delta(x) = a_{p - 1} \phi_p(x) - a(x) = \sum_0^{p - 1}(a_{p - 1} - a_i)x^i \ne 0, \tag{10}$
since $a_i \ne a_{p - 1}$ for some $i$, $0 \le i \le p - 2$.  We have
$\Delta(w) = a_{p - 1} \phi_p(w) - a(w) =  0; \tag{11}$
but $\deg \Delta(x) < p - 1$, again contradicting the minimality of $\phi_p(x)$; thus we must have $\Delta(x) = 0$ or $a_{p - 1} = a_i$, $0 \le i \le p -1$, in which case
$a(x) = a_{p- 1} \phi_p(x). \tag {12}$
Nota Bene:  In fact, the restriction of the $a_i$ to $a_i \in \Bbb Z$ does not appear essential to the above argument; we could as well have taken 
the $a_i \in \Bbb Q$.  End of Note.
