<s>[INST] $F(x , y)=\cos ^{y}\left(\frac{\pi}{x}\right)+\cos ^{y}\left(\frac{3 \pi}{x}\right)+\cos ^{y}\left(\frac{5 \pi}{x}\right)$ I am stuck with this problem , may you help me , it is from Spanish math olympiad  ....
Given
$F(x , y)=\cos ^{y}\left(\frac{\pi}{x}\right)+\cos ^{y}\left(\frac{3 \pi}{x}\right)+\cos ^{y}\left(\frac{5 \pi}{x}\right)$
Calculate
$M=F(7 , 2)+F(7 , 3)+F(7 , 5)-F(7 , 6)$
a) $37 / 32$
b) $7 / 4$
c) $19 / 16$
d) $53 / 32$
e)$41 / 32$
 [/INST] First let's define 
$$p_n:=\left(2\cos\frac\pi7\right)^n+\left(2\cos\frac{5\pi}7\right)^n+\left(2\cos\frac{3\pi}7\right)^n\quad(n\in\mathbb{Z}) $$
$$p_0=3,\quad p_1=1,\quad p_2=5$$
$$\forall n\in\mathbb{Z}c\quad p_{n+3}-p_{n+2}-2p_{n+1}+p_n=0$$
Then your sum is :
$$M=\dfrac{p_2}{4}+\dfrac{p_3}{8}+\dfrac{p_5}{32}-\dfrac{p_6}{64} $$
So 
$$ M= \dfrac{5}{4}+\dfrac{4}{8}+\dfrac{16}{32}-\dfrac{38}{64}=\dfrac{106}{64}=\dfrac{53}{32} $$
Nota bene:
The expression of $p_n$ can be deduced to the fact that :
$$x^3-\frac{x^2}2-\frac x2+\frac18=0$$
has for roots $$\cos\frac\pi7,\quad-\cos\frac{2\pi}7,\quad\cos\frac{3\pi}7$$
and using the relation between coefficient of your polynom and the roots.
</s>