# Why is k in the output of Sum[Log[k]^2/k^k, {k,1,Infinity}]?

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.

• "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. Jun 18, 2023 at 14:55
• NSum[Log[k]^2/k^k, {k, 1, Infinity}] evaluates to 0.173225 Jun 18, 2023 at 15:12
• Seems fixed in V13.3.1 or at least partially. It returns unevaluated. Dec 25, 2023 at 0:56

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 *)
SumSumParserDumpsumParserEvaluate[
k^-k Log[k]^2, {{k, 1, \[Infinity]}}, {}] =.;

InternalInheritedBlock[{SumInfiniteSumDumpInfiniteLogarithmicSeries},
SumInfiniteSumDumpInfiniteLogarithmicSeries[
Log[SumInfiniteSumDumpk_]^
SumInfiniteSumDumpn_ SumInfiniteSumDumpk_^
SumInfiniteSumDumpm_, {SumInfiniteSumDumpk_,
SumInfiniteSumDumpmin_, \[Infinity]}] /; ((IntegerQ[
SumInfiniteSumDumpm] && SumInfiniteSumDumpm < -2) || !
NumericQ[SumInfiniteSumDumpm]) && (IntegerQ[
SumInfiniteSumDumpn] && SumInfiniteSumDumpn >= 1) &&
IntegerQ[SumInfiniteSumDumpmin] &&
SumInfiniteSumDumpmin >= 1 =.;
SumInfiniteSumDumpInfiniteLogarithmicSeries[
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[SumInfiniteSumDumpInfiniteLogarithmicSeries];*)

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.

• Wow! How do you find this function SumInfiniteSumDumpInfiniteLogarithmicSeries ? Jun 21, 2023 at 5:09
• Thanks! Quite interesting! Jun 21, 2023 at 17:12
• [Oops, forgot a double backtick.] First Block[{Sumprint = 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 GeneralUtilitiesPrintDefinitions to inspect the code. There are many internal debugging hooks that end in Print or print. Jun 21, 2023 at 17:23
  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.