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.

A158662 Sum of primes <= n if 1 is counted as a prime.

Original entry on oeis.org

1, 3, 6, 6, 11, 11, 18, 18, 18, 18, 29, 29, 42, 42, 42, 42, 59, 59, 78, 78, 78, 78, 101, 101, 101, 101, 101, 101, 130, 130, 161, 161, 161, 161, 161, 161, 198, 198, 198, 198, 239, 239, 282, 282, 282, 282, 329, 329, 329, 329, 329, 329
Offset: 1

Views

Author

Jaroslav Krizek, Mar 23 2009, Apr 12 2009

Keywords

Comments

a(n) = A034387(n) + 1. a(p) - a(p-1) = p, for p = primes (A000040), a(c) - a(c-1) = 0, for c = composite numbers (A002808).

Crossrefs

Programs

  • Mathematica
    Module[{nn=60,c},c=Join[{1},Prime[Range[PrimePi[nn]]]];Table[Total[ Select[ c,#<=n&]],{n,nn}]] (* Harvey P. Dale, Jun 01 2014 *)
    Accumulate[Join[{1},Table[If[PrimeQ[n],n,0],{n,60}]]] (* Harvey P. Dale, Feb 27 2017 *)