Clear["Global`*"]
$Version
(* "12.2.0 for Mac OS X x86 (64-bit) (December 12, 2020)" *)
f[n_] = Sum[(-1)^(k - 1)/k, {k, n}] /. (-1)^(n + 1) :> -(-1)^n
(* (-1)^(1 + n) LerchPhi[-1, 1, 1 + n] + Log[2] *)
For large n
this converges to Log[2]
Limit[f[n], n -> Infinity]
(* Log[2] *)
The real part of f
is
f2[n_] = Assuming[Element[n, Reals],
Re[f[n]] // ComplexExpand // FullSimplify]
(* -Cos[n π] LerchPhi[-1, 1, 1 + n] + Log[2] *)
f2
is equal to f
for integer arguments:
Assuming[Element[n, Integers], f[n] == f2[n] // Simplify]
(* True *)
Graphically,
Show[
Plot[f2[n], {n, 0, 25},
PlotRange -> All,
GridLines -> {None, {Log[2]}},
GridLinesStyle ->
Directive[Gray, AbsoluteThickness[1], Dashed]],
DiscretePlot[f[n], {n, 0, 25},
PlotStyle -> ColorData[97][2]]]

Sum[(-1)^(k-1)/k,{k,n}]
satisfactory? $\endgroup$SeriesCoefficient[Log[x + 1]/(1 - x), {x, 0, n}]
... $\endgroup$