OFFSET

1,1

COMMENTS

For convenience "nonprime(n)" is used for "n-th nonprime". Here the nonprimes start at 0 (see A141468), so nonprime(1) to nonprime(20) are 0, 1, 4, 6, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 22, 24, 25, 26, 27, 28.

EXAMPLE

n = 1: nonprime(1+1) = 1, nonprime(1+2) = 4. Sum of all nonprimes from nonprime(1) = 0 to nonprime(4) = 6 is 0+1+4+6, hence a(1) = 11.

n = 4: nonprime(4+1) = 8, nonprime(4+2) = 9. Sum of all nonprimes from nonprime(8) = 12 to nonprime(9) = 14 is 12+14, hence a(4) = 26.

n = 11: nonprime(11+1) = 18, nonprime(11+2) = 20. Sum of all nonprimes from nonprime(18) = 26 to nonprime(20) = 28 is 26+27+28, hence a(11) = 81.

PROG

(Magma) Nonprimes:=[0] cat [ n: n in [1..120] | not IsPrime(n) ];

NthNonprime:= func< n | Nonprimes[n] >;

[ &+[ k: k in [NthNonprime(p)..NthNonprime(q)] | not IsPrime(k) ] where p is NthNonprime(n+1) where q is NthNonprime(n+2): n in [1..60] ];

CROSSREFS

KEYWORD

nonn

AUTHOR

Juri-Stepan Gerasimov, Jun 18 2009

EXTENSIONS

Edited and corrected (a(47)=175 inserted) by Klaus Brockhaus, Jun 22 2009

STATUS

approved