login
A066039
Largest prime less than or equal to the sum of first n primes (A007504).
1
2, 5, 7, 17, 23, 41, 53, 73, 97, 127, 157, 197, 233, 281, 317, 379, 439, 499, 563, 631, 709, 787, 863, 953, 1051, 1153, 1259, 1367, 1471, 1583, 1709, 1847, 1987, 2113, 2273, 2423, 2579, 2741, 2909, 3083, 3259, 3433, 3637, 3823, 4027, 4219, 4423, 4657
OFFSET
1,1
LINKS
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
Sequence in context: A176676 A307452 A066028 * A142341 A318731 A256062
KEYWORD
nonn
AUTHOR
Robert G. Wilson v, Dec 12 2001
EXTENSIONS
Previous Mathematica program replaced by Harvey P. Dale, Jul 24 2022
STATUS
approved