$f(x)$ is defined such that: $$f(x)=\prod_{n=1}^{999}\cos(nx)$$
Given that solve for $k$ (which is integer):
$$f\left(\frac{2\pi}{1999}\right)=\frac{1}{2^k}$$
I tried many different methods including euler's formula, trig identities and expressing each cosine in terms of $\cos x$ using De Moivre's theorem. Then I tried to multiply these polynomials of powers of cosine and I reached some interesting results. For example first term's power will be $\dfrac{(n+1)!}{(n-1)!2!}$ and its coefficient - $a$ - will be $\dfrac{n!}{(n-2)!2!}$ with term itself $a\cos^n(x)$. Then powers are in descending order, each power equal to previous one minus 2. I wasn't able to find a rule for coefficients except the first and last one, though they are always in the form of binomial coefficients or sum of them such that highest power chooses 2 or 3 or other number. After few terms it always became really cumbersome so I couldn't continue solving it that way with just pen and paper.
All that didn't lead me even close to solving the equation though. I solved it numerically using Java app and answer was $k=999$ if I remember correctly.
Is there any way to solve it algebraically?