OFFSET
1,1
COMMENTS
We start with the primes, 2 3 5 7 11 13 17 19 ..., and form the partial sums (starting with the first two terms), 2+3 = 5, ..., but whenever the partial sum is a prime, we remove it from the list of primes to be added later. Thus, 5 will not be added, and the next term in the partial sums is 2+3+7 = 12, and then 2+3+7+11 = 23, which is again prime, thus not used (later) in the partial sum. The primes that are removed are 5, 23, 53, 101, 359, 487, 631, 1669,... and the partial sums are A247658.
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..1000
PROG
(Haskell)
a247657 n = a247657_list !! (n-1)
a247657_list = f 0 $ drop 2 a000040_list where
f z (p:ps) | a010051' z' == 1 = z' : f z' (delete z' ps)
| otherwise = f z' ps
where z' = z + p
-- Reinhard Zumkeller, Oct 01 2014
(PARI) {omit=[]; s=2; forprime(p=3, 999, if(vecsearch(omit, p), omit=vecextract(omit, "^1"); next); isprime(s+=p)||next; print1(s", "); omit=concat(omit, s))} \\ M. F. Hasler, Oct 04 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
Daniel Joyce, Oct 01 2014
STATUS
approved