# Strange result for sum $\sum _{k=1}^{\infty } \frac{\sin (k (k-1))}{k}$

In this sum over $$k$$

Sum[Sin[k (k - 1)]/k, {k, 1, ∞}]

the result still containes the summation index $$k$$.

 (* Out 1/2 I (Log[E^-I (E^I - E^(I k))] - Log[E^(-I k) (-E^I + E^(I k))]) *)


What is happening here?

If the sum were divergent, Mathematica would normally return the input.

Sum[1/k, {k, 1, ∞}]


(* Out= $$\sum _{k=1}^{\infty } \frac{1}{k}$$ *)

Nevertheless plotting the r.h.s. (designated by $$f$$) as a function of $$k$$

Plot[2/π f, {k, -2 π + 1, 1.1 + 6 π},
PlotLabel -> "Result of a 'strange sum'", AxesLabel -> {"k", "f(k)"},
PlotRange -> {{-2 π + 1, 4 π + 1}, All}] we see that it is discontinuous and in the range from $$-\frac{\pi}{2}$$ to $$\frac{\pi}{2}$$.

This could be an indication the the sum is divergent delivering values in this range. I have not studied the convergence, but confined myself to the Mathematica question.

Cross reference to the convergence question: https://math.stackexchange.com/q/3466339/198592

• Looks like a bug to me. NSum complains of convergence failure. I'd expect logarithmic divergence here, although I can't prove it. – John Doty Dec 6 '19 at 18:59
• @JohnDoty it seems to converge to around 0.313: try Table[Sin[k*(k-1)]/k, {k, 10^7}] // N // Total. Maybe ask at math.stackexchange.com if you need the exact limit. – Roman Dec 6 '19 at 19:20
• Isn't this one of those cases where it is not known whether the sum converges? i.e., where we would need a good understanding of the convergents of $\pi$ to decide (which we don't have)? I seem to remember a similar sum on overflow... – AccidentalFourierTransform Dec 6 '19 at 23:32
• @Roman I think you're right. The numerator seems sufficiently oscillatory that its mean converges (slowly) toward zero, and that should be sufficient to get the series to converge. Mathematicians, don't shoot me, I'm just a physicist ツ – John Doty Dec 6 '19 at 23:42
• That is a bug beyond any doubts. The sum seems to converge to $1/\pi$, but that is a separate question. – yarchik Dec 7 '19 at 15:15

This is not a serious bug because of

Sum[Sin[k^2 - k]/k, {k, 1, Infinity}]


$$\sum _{k=1}^{\infty } -\frac{\sin \left(k-k^2\right)}{k}$$

I have strong doubts concerning the existence of a closed-form expression for the sum of the series under consideration.

Addition. Following the documentation to Sum and NSum, I obtain a confirmation of the convergence of the series under consideration:

NSum[Sin[k^2 - k]/k,{k,2,Infinity},AccuracyGoal->1,PrecisionGoal->1, WorkingPrecision -> 20]


0.2

• It's still a bug to yield nonsense. – John Doty Dec 6 '19 at 23:38
• @the down-voter: What is wrong in my answer? TIA. – user64494 Dec 7 '19 at 14:01
• I have not down voted, but I cannot understand your answer. How does it answers the question. – yarchik Dec 7 '19 at 15:20
• @ user64494 +1 I understand your solution as stating that the sum is returned unevaluated, and I consider this a valuable contribution. Mathematic obviously could not find out if the sum is convergent or not, and did the right thing. BTW I have observed in several occasions that Mathematica "appreciates" cooperation from the user when it comes to rearranging expressions. – Dr. Wolfgang Hintze Dec 7 '19 at 15:33
• @ John Doty thanks, bug report sent by email. Waiting for response from Wolfram. – Dr. Wolfgang Hintze Dec 8 '19 at 8:56