Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Mathematica tells the series below doesn't converge. I think it converges. What would the proper way to write things be as an input?

Sum[((-1)^(n) Log[1 + 2 n])/(1 + 2 n), {n, 0, Infinity}]
share|improve this question
By the alternating series test it's clear the series converges, but it seems the convergence is very slow. – A_math_ninja Apr 25 '13 at 18:54
What version of Mathematica are you using? It doesn't tell me that it does not converge. It simply can't calculate it. v9.0.1 here. – Szabolcs Apr 25 '13 at 18:57
@Szabolcs I use v8.0 here. – A_math_ninja Apr 25 '13 at 18:58
Yes, I can reproduce that in v8. It seems it was a bug in v9, 'fixed' in a certain way in v9. No answer is better than a wrong answer. – Szabolcs Apr 25 '13 at 18:59
@belisarius We've been talking to ourself for days now... – Daniel Lichtblau Apr 25 '13 at 21:38

You can sum your infinite series by shifting the sum over n along by 1/2, which then simplifies the summand to a form that Mathematica can handle.

(1/(-1)^(1/2)) Sum[((-1)^n Log[2 n])/(2 n), {n, 1/2, Infinity, 1}]

(* (1/4) (Pi Log[4] + StieltjesGamma[1, 1/4] - StieltjesGamma[1, 3/4]) *)

The overall factor 1/(-1)^(1/2) cancels the (-1)^(1/2) factor that is introduced by shifting the sum in this way.

Numerically this evaluates to -0.192901, as expected.

share|improve this answer

To get an actual answer in this case, you could simply retreat to the numerical evaluation of this sum. It works by simply changing Sum to NSum in your code:

NSum[((-1)^(n) Log[1 + 2 n])/(1 + 2 n), {n, 0, Infinity}]

(* ==> -0.192901 *)
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.