OFFSET
1,1
COMMENTS
The length of the sequence is given in A071194.
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
EXAMPLE
n=2: p(2)=3, 3+7+11+13+17+19+23+29 = 127 is the shortest partial sum with initial prime 3; it ends with p(10) = 29 = a(2);
n=6: p(6)=13, 13+17+19+23+29 = 101, so the end-prime = a(6) = 29.
MATHEMATICA
Prime@ Table[k = 1; While[! PrimeQ@ Total@ Prime@ Range[n, n + k], k++]; n + k, {n, 57}] (* Michael De Vlieger, Mar 25 2017 *)
PROG
(PARI) a(n, p=prime(n))=my(q=p); while(!isprime(p+=q=nextprime(q+1)), ); q
apply(p->a(0, p), primes(30)) \\ Charles R Greathouse IV, Jun 16 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, May 16 2002
EXTENSIONS
Edited and escape clause added by N. J. A. Sloane, Nov 17 2020
STATUS
approved