The expression (in a notebook with Wolfram Mathematica 12.0.0)

Sum[s[i, j] - s[j, i], {j, b}, {i, b}]

Produces the result

1/2 b EulerPhi[b]

Can anyone explain this? Some forgotten prank hidden in the kernel's built-in rules?

Edit: Sum[i - j, {i, k}, {j, k}] does the same; any variable names can be used.

  • $\begingroup$ Run ClearAll[s] and try again. $\endgroup$ – AccidentalFourierTransform Aug 11 at 23:45
  • $\begingroup$ I swear I shut down the entire program and restarted it, with the same result. However, the gremlin has gone. (It was doing the same for the difference of any expression with two variables swapped.) I'll have to assume I had created some substitution rule that somehow did not clear. $\endgroup$ – qman Aug 11 at 23:53
  • $\begingroup$ It's back. I rebooted my computer, started Mathematica, and that was the first thing I entered into a fresh notebook. Same result. $\endgroup$ – qman Aug 12 at 0:35
  • $\begingroup$ Unfortunately, I cannot reproduce any of your results. $\endgroup$ – AccidentalFourierTransform Aug 12 at 0:48
  • $\begingroup$ Okay, thanks. Weird. Mathematica and I just do not get on. $\endgroup$ – qman Aug 12 at 0:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.