cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-2 of 2 results.

A024850 Let c(k) denote the k-th composite number and p(k) the k-th prime number; then a(n) = Sum_{i=n*(n-1)/2+1 .. n*(n+1)/2} c(i) - Sum_{i=1..n} p(i).

Original entry on oeis.org

2, 9, 21, 46, 84, 135, 206, 308, 429, 583, 772, 987, 1265, 1552, 1906, 2308, 2767, 3278, 3840, 4478, 5201, 5956, 6783, 7704, 8706, 9777, 10976, 12241, 13591, 14985, 16546, 18230, 20019, 21862, 23824, 25907, 28111, 30474, 32897, 35482, 38208, 41125, 44159, 47239, 50516, 53944
Offset: 1

Views

Author

Amarnath Murthy and Benoit Cloitre, Jun 23 2002

Keywords

Examples

			a(1) = 4 - 2 = 2.
a(2) = 6 + 8 - 2 - 3 = 9.
a(3) = 9 + 10 + 12 - 2 - 3 - 5 = 21.
		

Crossrefs

Cf. A071411.

Formula

a(n) = A072475(n) - A007504(n) [corrected by Sean A. Irvine, Jul 26 2019].

Extensions

a(7) and a(8) corrected and more terms from Sean A. Irvine, Jul 26 2019

A072476 Difference between the sum of first n prime numbers and the sum of first n composite numbers.

Original entry on oeis.org

-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
Offset: 1

Views

Author

Amarnath Murthy, Jun 20 2002

Keywords

Crossrefs

Cf. A071411.
Partial sums of A038529.

Programs

  • 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 *)

Extensions

Edited by Robert G. Wilson v, Jun 21 2002
Showing 1-2 of 2 results.