Mathematica recently offered me this expression as the result of an evaluation: HarmonicNumber[r, -r]. I initially thought this must be equivalent to Sum[1/k^r, {k, 1, r}], but it appears I'm wrong:

TrueQ[HarmonicNumber[r, -r] == Sum[1/k^r, {k, 1, r}]]


Can someone please tell me what the equivalent of HarmonicNumber[r, -r] is when written in Sum form? I'm sure it's a dumb question (and I'm sure I could ask MMA to do it for me, if I only knew how), but I'd appreciate an answer nonetheless.

  • 2
    $\begingroup$ That's not what TrueQ is for. Please check its documentation. $\endgroup$ – Szabolcs Dec 11 '18 at 16:24
  • $\begingroup$ Have you looked under Details and Options in the documentation of HarmonicNumber? The sum form is given there for any integer input value. $\endgroup$ – Szabolcs Dec 11 '18 at 16:28
  • $\begingroup$ OK I will, and thank you. But can you please tell me how I can find what HarmonicNumber[r, -r] means? $\endgroup$ – Richard Burke-Ward Dec 11 '18 at 16:29

You were only missing a sign:

HarmonicNumber[r, -r] == Sum[1/k^-r, {k, 1, r}]


  • $\begingroup$ Thanks Henrik. I thought I was being dumb! I'll mark as read when the timer allows. $\endgroup$ – Richard Burke-Ward Dec 11 '18 at 16:34
  • $\begingroup$ Richard, you are always welcome. $\endgroup$ – Henrik Schumacher Dec 11 '18 at 16:53

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