Trigonometric sum of type $\sum^{n}_{k=1}\cos^{n}(k\theta)$ 
Finding sum of $$\sum^{1007}_{k=1}\left(\cos \left(\frac{k\pi}{2007}\right)\right)^{2014}$$

$\bf{Attempt:}$ With the help of $\displaystyle \cos x = \frac{e^{ix}+e^{-ix}}{2}$ and substitute $\displaystyle \frac{\pi}{2007} = \theta$
$$\sum^{1007}_{k=1}\left(\cos k\theta\right)^{2014} = \sum^{1007}_{k=1}\bigg(\frac{e^{ix}+e^{-ix}}{2}\bigg)^{2014}$$
Could some help me to solve it, thanks 
 A: I will provide a solution for the case in which the denominator is $1007$, as noted in the comments (in my opinion, the value of $2007$ is a typo).
You are on the right way. Applying $\displaystyle \cos x = \frac{e^{ix}+e^{-ix}}{2}\,\,\,$ and setting $z=e^{\frac{\pi i}{1007}}\,$, we 
get that the summation is equivalent to
$$ \sum^{1007}_{k=1}\bigg(\frac{z^{k}+z^{-k}}{2}\bigg)^{2014}\\  =   \frac{1}{2^{2014}} \sum^{1007}_{k=1}\bigg(z^{k}+z^{-k}\bigg)^{2014} $$
Expanding this last term with use of the binomial theorem, we get
$$ \frac{1}{2^{2014}}    \sum^{2014}_{i=0}  \sum^{1007}_{k=1}     \binom{2014}{i} \bigg[z^{k(2014-i)}z^{-ki} \bigg]   \\   =  \frac{1}{2^{2014}} \sum^{2014}_{i=0}   \sum^{1007}_{k=1}     \binom{2014}{i} (z^w)^k    $$ 
where $i=0,1,2...2014 \,\,\,\,$ and $w=   2014-2i \,\,\,\,$. Taking into account that $z^{2014}=1\,\,$, now note that the quantity $ \sum^{1007}_{k=1} (z^w)^k \,\, $ is equal, for $z^w \neq 1\,\,$, to a sum of the roots of unity in the complex plane, homogeneously spaced around the unit circle. So it is different from to zero only when $z^w=1\,\,$. This occurs for $i=0\,\,$,$i=1007\,\,$, and $i=2014\,\,$. So, calculating the sums only for these values of $i$, we get
$$ \frac{1}{2^{2014}}  \left[1017+1017 \binom{2014}{1017}+1017 \right] \\  =\frac{1007}{2^{2014}}  \left[2+\binom{2014}{1017}\right] \approx 17.9013...   $$
This numerical result for the initial sum reported in the OP is confirmed by WA here.
