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.