Summing a series

How would I go about finding the sum of an alternating series that consist of 1 -1/2 + 1/3 -1/4 + 1/5... to the 8th term using a mathematical formula or is there no formula I can use

migrated from mathematica.stackexchange.comAug 20 '18 at 23:20

This question came from our site for users of Wolfram Mathematica.

• Is this a question related to the Mathematica programming language or about math? In the second case, this is the wrong forum. – Fraccalo Aug 19 '18 at 16:45

Here is a formula for the nth partial sum:

aharmonic[n_] = Sum[-(-1)^k/k, {k, n}]


(-1)^(1 + n) LerchPhi[-1, 1, 1 + n] + Log[2]

The 8th partial sum:

aharmonic[8]


533/840

Table of the first 10 values:

aharmonic[Range[10]]


{1, 1/2, 5/6, 7/12, 47/60, 37/60, 319/420, 533/840, 1879/2520, 1627/2520}

One method would be to use Table.

Total[Table[If[EvenQ[n], -(1/n), 1/n], {n, 1, 8, 1}]]

• a.k.a. Sum[-(-1)^n/n, {n, 1, 8}]. – AccidentalFourierTransform Aug 19 '18 at 17:19
• That's very graceful! – Carl Lange Aug 19 '18 at 18:03