# WolframAlpha and the sum $\sum_{k=1}^{n}\frac{\cos(\pi k)}{\csc(\pi k)}$

Question: WolframAlpha gives the following expression $$\sum_{k=1}^{n}\frac{\cos(\pi k)}{\csc(\pi k)}=\phi(n);$$ where $$\phi()$$ is the Euler totient function. You can check for yourself here. Is this incorrect ?

Surely $$\frac{\cos(\pi k)}{\csc(\pi x)}=0$$ for every natural number $$k,$$ and so the sum should always equal zero. Am I misinterpreting the output from WolframAlpha or did I type it in wrong ? I know that $$\frac{\cos(\pi k)}{\csc(\pi x)}=\frac{1}{2}\sin(2\pi k),$$ whose partial sum WolframAlpha correctly shows: check.

• Looks like a bug as Mathematica returns Sum[Cos[Pi k]/Csc[Pi k], {k, 1, n}] = 0
– Moo
Sep 9, 2020 at 17:55
• I have a version of Mathematica that returns EulerPhi[n], version 12.0.0.0 on macOS Sep 9, 2020 at 17:57
• Interesting! I am Windows 10, x86, running version 12.1.1.0. Maybe we could post this on the Mathermatica Stack Exchange.
– Moo
Sep 9, 2020 at 17:59
• Should I cross-post ? Is that allowed ? Sep 9, 2020 at 17:59
• The MMA group would want MMA only and MMA code in the post - not WA.
– Moo
Sep 9, 2020 at 18:00