The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A071195 Final prime in sequence of primes starting with prime(n) and having prime sum (see A071194), or -1 if no such sequence exists. 5
3, 29, 11, 13, 17, 29, 23, 29, 31, 37, 41, 71, 47, 61, 73, 61, 73, 71, 73, 79, 97, 89, 97, 113, 127, 107, 137, 131, 127, 139, 149, 173, 157, 151, 157, 173, 167, 173, 227, 223, 197, 293, 211, 239, 211, 251, 227, 239, 563, 239, 269, 397, 283, 409, 283, 281, 283 (list; graph; refs; listen; history; text; internal format)
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
Sequence in context: A096621 A362466 A143234 * A292625 A030274 A249518
KEYWORD
nonn
AUTHOR
Labos Elemer, May 16 2002
EXTENSIONS
Edited and escape clause added by N. J. A. Sloane, Nov 17 2020
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 27 15:51 EDT 2024. Contains 372880 sequences. (Running on oeis4.)