8
$\begingroup$

The following sum converges to a constant. It would be much better to return unevaluated than to return something incorrect.

 Sum[Log[k]^2/k^k, {k, 1, Infinity}]
 (* (Zeta^\[Prime]\[Prime])[k] *)

What does k in the result?

Same with Sum[Log[k]^3/k^k, {k, 1, Infinity}] etc.

One similar bug has already been fixed in 11.3, see Why is "k" in the output of Sum[Log[k]/k^k, {k,1,Infinity}]?, but this not. Tested with versions 13.2, 13.1, 12.3.

$\endgroup$
3
  • 1
    $\begingroup$ "What does k in the result?" -- I assume you mean why is k there as in the title? I think you must know already. Do you really want this question answered, or are you asking for help with something else? If you are trying to report a bug, report it to WRI. The community decided long ago that this site is not a place to report bugs. $\endgroup$
    – Michael E2
    Jun 18, 2023 at 14:55
  • $\begingroup$ NSum[Log[k]^2/k^k, {k, 1, Infinity}] evaluates to 0.173225 $\endgroup$
    – Bob Hanlon
    Jun 18, 2023 at 15:12
  • $\begingroup$ Seems fixed in V13.3.1 or at least partially. It returns unevaluated. $\endgroup$
    – Goofy
    Dec 25, 2023 at 0:56

2 Answers 2

4
$\begingroup$

Here's a fix, of sorts (V13.2.1), if that is what is wanted:

(* unset cached result -- will give an error message if no
   chached result, which can be ignored *)
Sum`SumParserDump`sumParserEvaluate[
   k^-k Log[k]^2, {{k, 1, \[Infinity]}}, {}] =.;

Internal`InheritedBlock[{Sum`InfiniteSumDump`InfiniteLogarithmicSeries},
 Sum`InfiniteSumDump`InfiniteLogarithmicSeries[
    Log[Sum`InfiniteSumDump`k_]^
     Sum`InfiniteSumDump`n_ Sum`InfiniteSumDump`k_^
     Sum`InfiniteSumDump`m_, {Sum`InfiniteSumDump`k_, 
     Sum`InfiniteSumDump`min_, \[Infinity]}] /; ((IntegerQ[
         Sum`InfiniteSumDump`m] && Sum`InfiniteSumDump`m < -2) || ! 
       NumericQ[Sum`InfiniteSumDump`m]) && (IntegerQ[
       Sum`InfiniteSumDump`n] && Sum`InfiniteSumDump`n >= 1) && 
    IntegerQ[Sum`InfiniteSumDump`min] && 
    Sum`InfiniteSumDump`min >= 1 =.; 
 Sum`InfiniteSumDump`InfiniteLogarithmicSeries[
    Log[k_]^n_*k_^m_, {k_, min_, \[Infinity]}] /;
     ((IntegerQ[m] && m < -2) ||
        (Print["here"]; FreeQ[m, k] (* fix *)&&
          ! NumericQ[m])) &&
      (IntegerQ[n] && n >= 1) && IntegerQ[min] && min >= 1 :=
  (-1)^n Derivative[n][Zeta][-m] - Sum[Log[k]^n*k^m, {k, 1, min - 1}];

 (*foo=DownValues[Sum`InfiniteSumDump`InfiniteLogarithmicSeries];*)
 
 Sum[Log[k]^2/k^k, {k, 1, Infinity}]
 ]

No bug, but no result either. The Print["here"] statement may be omitted, of course. I put it in to help identify the fix. If you change k^k to k^7 or k^y, it still works (Zeta''[7] or Zeta''[y] resp.) as in Roland's answer.

$\endgroup$
3
  • $\begingroup$ Wow! How do you find this function Sum`InfiniteSumDump`InfiniteLogarithmicSeries ? $\endgroup$
    – Lacia
    Jun 21, 2023 at 5:09
  • $\begingroup$ Thanks! Quite interesting! $\endgroup$
    – Lacia
    Jun 21, 2023 at 17:12
  • 2
    $\begingroup$ [Oops, forgot a double backtick.] First Block[{Sum`print = Print}, Sum[Log[k]^2/k^k, {k, 1, Infinity}]]. Then based on the output, ?Sum*`*ogarithm*. Then I used Trace to see if/how it was called and GeneralUtilities`PrintDefinitions to inspect the code. There are many internal debugging hooks that end in Print or print. $\endgroup$
    – Michael E2
    Jun 21, 2023 at 17:23
2
$\begingroup$
  Sum[Log[x]^2/x^7,{x,1,Infinity}]
      (Zeta^\[Prime]\[Prime])[7]

     Sum[Log[n]^2/n^y,{n,1,Infinity}]/.{y->1.2}
     249.99
      Sum[Log[x]^2/x^1.2,{x,1,Infinity}]
     249.99

Seemingly, the procedure differentiates between base $x$ and exponent $x$ in $x^x$ and makes the exponent a variable pattern.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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