login
A158662
Sum of primes <= n if 1 is counted as a prime.
6
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,2
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).
LINKS
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 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Jaroslav Krizek, Mar 23 2009, Apr 12 2009
STATUS
approved