# A trigonometric sum (is it a Ramanujan sum?)

Let A be the following set: $A=\{x \in \mathbb{N}^+: x\lt3003 \text{ and } (x,3003)=1 \}$.

I am asked to find the value of $$\sum_{n\in A}\sin^2\left( \frac{n\pi}{3003}\right).$$

• Write $\sin(x)=\frac{e^{ix}-e^{-ix}}{2i}$. Use that $e^{2i\pi/3003}$ and its powers are the roots of $x^{3003}-1=0$. In particular their sum is zero. – Olivia Jul 9 '17 at 13:39
• but n is not equal to 1,3,7,11,... – MoNtiDeaD MoonDogs Jul 9 '17 at 13:43
• because (x,3003) is not equal to 1. – MoNtiDeaD MoonDogs Jul 9 '17 at 13:44
• $$(m,n)=(n-m,n)$$ – lab bhattacharjee Jul 9 '17 at 13:45
• @Olivia: that is not true. The primitive third roots of unity sum to $-1$, since $\Phi_3(x)=x^2\color{red}{+x}+1$. – Jack D'Aurizio Jul 9 '17 at 13:54

For starters, we have $3003=3\cdot 7\cdot 11\cdot 13$, hence $|A|=\varphi(3003)=1440$.
$\sin^2\theta = \frac{1}{2}\left(1-\cos(2\theta)\right)$, hence the given sum equals $720$ minus half the real part of the sum of the roots of the cyclotomic polynomial $$\Phi_{3003}(x) = x^{1440}-x^{1439}+x^{1437}+\ldots$$ and by Vieta's theorem it follows that $$\sum_{n\in A}\sin^2\left(\frac{\pi n}{3003}\right) = \color{red}{720-\frac{1}{2}}.$$

By Von Sterneck's formula for Ramanujan sums we get that, in general,

$$\sum_{\substack{1\leq n \leq M \\ \gcd(n,M)=1}}\!\!\!\sin^2\left(\frac{\pi n}{M}\right) = \frac{\varphi(M)-\mu(M)}{2}$$ where $\varphi$ is Euler's totient function and $\mu$ is Moebius' function.

• how to get first equation $\Phi_{3003}(x) = x^{1440}-x^{1439}+x^{1437}+\ldots$ Can I have text to learn more? – MoNtiDeaD MoonDogs Jul 9 '17 at 14:16
• @MoNtiDeaDMoonDogs: the other coefficients are irrelevant. You can compute a cyclotomic polynomial (en.wikipedia.org/wiki/Cyclotomic_polynomial) by Moebius formula $$\Phi_n(x)=\prod_{d\mid n}(x^d-1)^{\mu(n/d)}$$ that follows from the inclusion/exclusion principle. Then it is clear what the coefficient of $x^{n-1}$ (related with the sum of the roots) is: it is $\Phi_n'(0)= -\mu(n)$. – Jack D'Aurizio Jul 9 '17 at 14:20
• @MoNtiDeaDMoonDogs: you're welcome. – Jack D'Aurizio Jul 9 '17 at 14:26
• @JackD'Aurizio: Very nice and concise answer. (+1) Could you provide a reference for this beautiful Von Sterneck formula? – Markus Scheuer Jul 9 '17 at 15:31
• It is discussed in the linked Wikipedia page about Ramanujan sums. Indeed this is a very special case, related with the fact that the moebius function can be represented as an exponential sum. – Jack D'Aurizio Jul 9 '17 at 15:35