OFFSET
1,1
LINKS
Harry J. Smith, Table of n, a(n) for n = 1..1000
EXAMPLE
a(3) = 7 because 7 is the first prime <= 10 = 2+3+5. a(4) = 17 because 17 is a prime and is equal to 2+3+5+7.
MATHEMATICA
If[PrimeQ[#], #, NextPrime[#, -1]]&/@Accumulate[Prime[Range[50]]] (* Harvey P. Dale, Jul 24 2022 *)
PROG
(PARI) { s=0; for (n=1, 1000, s+=prime(n); a=precprime(s); write("b066039.txt", n, " ", a) ) } \\ Harry J. Smith, Nov 08 2009
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert G. Wilson v, Dec 12 2001
EXTENSIONS
Previous Mathematica program replaced by Harvey P. Dale, Jul 24 2022
STATUS
approved