# A Possible Bug Concerning The Sum $\sum_{k=1}^{n}\frac{\cos(\pi k)}{\csc(\pi k)}$?

Question: For reference see this post in MSE. I noticed on WolframAlpha the summation $$\sum_{k=1}^{n}\frac{\cos(\pi > k)}{\csc(\pi k)}$$ returns the result $$\phi(n)$$; which is the Euler phi function. Of course this summation should equal zero. A commentator suggested it might be bug in WolframAlpha as the Mathematica code: Sum[Cos[Pi k]/Csc[Pi k], {k, 1, n}] returns 0. At least this was the case running on Windows 10, x86, running version 12.1.1.0. Another commentator showed the same code returns EulerPhi[n] running version 12.0.0.0 on macOS. Is this a bug in Mathematica?

• The code correctly returns zero in the current version, so there's no bug. I also get EulerPhi[n] in V12.0, so there was a bug. Sep 9, 2020 at 18:33
• @MichaelE2 might you answerize that so I can accept your answer. Any guess what might be going on in WolframAlpha or in prior versions ? Sep 9, 2020 at 18:34

Version V12.1.1:

Sum[Cos[Pi k]/Csc[Pi k], {k, 1, n}]

(*  0  *)


Version V12.0.0:

Sum[Cos[Pi k]/Csc[Pi k], {k, 1, n}]

(*  EulerPhi[n]  *)


It seems there was a bug in the earlier version of V12. It's possible that Wolfram|Alpha is using V12.0 (but questions about the workings of W|A are off-topic on this site).