We fix a pair $( p , q ) \in E _ { 3 } := \left\{ ( p , q ) \in \left( \mathbf { N } ^ { * } \right) ^ { 2 } : p > q \right\}$, and set $\theta _ { k } := ( 2 k + 1 ) \dfrac { \pi } { p }$.
Show that
$$\sum _ { k = 0 } ^ { \lfloor p / 2 \rfloor - 1 } \cos \left( q \theta _ { k } \right) = \begin{cases} 0 & \text{if } p \text{ is even} \\ \dfrac { ( - 1 ) ^ { q + 1 } } { 2 } & \text{if } p \text{ is odd} \end{cases}$$