A045717 For each prime p take the sum of nonprimes < p.
1, 1, 5, 11, 38, 50, 95, 113, 176, 306, 336, 506, 623, 665, 800, 1050, 1330, 1390, 1710, 1917, 1989, 2369, 2612, 3042, 3693, 3990, 4092, 4407, 4515, 4848, 6408, 6795, 7465, 7603, 8899, 9049, 9819, 10619, 11114, 11964, 12844, 13024, 14698, 14890, 15475
Offset: 1
Examples
For p=7 we get 1+4+6=11.
Crossrefs
Cf. A000040.
Programs
-
Mathematica
nn=200;With[{np=Complement[Range[nn],Prime[Range[PrimePi[nn]]]]}, Table[ Total[Select[np,#
-
PARI
a(n) = {my(p = prime(n)); sum (i=1, p-1, i*(! isprime(i)));} \\ Michel Marcus, Sep 28 2013
-
PARI
a(n)=my(p=prime(n),s=1); forcomposite(k=4,p,s+=k);k \\ Charles R Greathouse IV, Sep 28 2013
Extensions
Corrected and extended by Erich Friedman.
Comments