Given the equation
$$f(n) = \frac{2^n}{n+1} \sum_{j=0}^{n}{cos\left( \frac{j \pi}{n+1} \right)^n \left( cos \left( \frac{n j \pi}{n+1} \right) + cos \left( \frac{(n - 4) j \pi}{n+1} \right) + cos \left( \frac{(n - 8) j \pi}{n+1} \right)\right)}$$
I want to find all values of $n \ge 4$ where $f(n)$ is a power of two. Through computation I found $n = [4, 5, 10]$ produce $[8, 16, 256]$.
I can guarantee $f(n)$ always produces an natural number for any value of $n \ge 4$. In otherwords $\forall n \in \mathbb{N}, f(n) \in \mathbb{N}$.
I can see that $n+1$ must divide all non $2$ factors of the summation, but I'm stuck here.