login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A072476 Difference between the sum of first n prime numbers and the sum of first n composite numbers. 0
-2, -5, -8, -10, -9, -8, -5, -1, 6, 17, 28, 44, 63, 82, 104, 131, 163, 196, 233, 272, 312, 357, 405, 458, 517, 579, 642, 707, 772, 840, 921, 1004, 1092, 1181, 1279, 1378, 1481, 1589, 1700, 1816, 1937, 2058, 2187, 2317, 2450, 2584, 2729, 2884, 3042, 3201, 3362, 3527, 3693, 3868, 4048 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

LINKS

Table of n, a(n) for n=1..55.

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

Cf. A071411.

Sequence in context: A088620 A068702 A083724 * A167541 A078345 A161817

Adjacent sequences:  A072473 A072474 A072475 * A072477 A072478 A072479

KEYWORD

sign

AUTHOR

Amarnath Murthy, Jun 20 2002

EXTENSIONS

Edited by Robert G. Wilson v, Jun 21 2002

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy .

Last modified February 22 11:50 EST 2018. Contains 299452 sequences. (Running on oeis4.)