OFFSET
1,1
MATHEMATICA
Composite[n_Integer] := FixedPoint[n + PrimePi[ # ] + 1 &, n + PrimePi[n] + 1]; Table[ Sum[ Prime[i] - Composite[i], {i, 1, n}], {n, 1, 55}]
Module[{nn=60, pr, cm}, pr=Prime[Range[nn]]; cm=Take[Select[Range[2nn], CompositeQ], nn]; Accumulate[ pr-cm]](* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Dec 08 2017 *)
CROSSREFS
KEYWORD
sign
AUTHOR
Amarnath Murthy, Jun 20 2002
EXTENSIONS
Edited by Robert G. Wilson v, Jun 21 2002
STATUS
approved