A158662 Sum of primes <= n if 1 is counted as a prime.
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
Keywords
Links
- Harvey P. Dale, Table of n, a(n) for n = 1..1000
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 *)
Comments