OFFSET
1,4
COMMENTS
EXAMPLE
The partial sums are 1, 1/2, 1/6, 5/12, 13/60, 23/60, 101/420, 307/840, 1201/2520, 1453/2520, ...
MAPLE
f:=proc(n) if isprime(n) then -1/n else 1/n fi; end; g:=proc(n) add(f(i), i=1..n); end;
MATHEMATICA
Table[Numerator[HarmonicNumber[n] - 2*Sum[1/Prime[i], {i, 1, PrimePi[n]}]], {n, 1, 30}] (* Stefan Steinerberger, Feb 23 2006 *)
Accumulate[Table[If[PrimeQ[n], -1/n, 1/n], {n, 30}]]//Numerator (* Harvey P. Dale, Aug 13 2021 *)
CROSSREFS
KEYWORD
nonn,frac
AUTHOR
N. J. A. Sloane, Feb 23 2006
STATUS
approved