A381149 a(1) = 2, a(2) = 3; thereafter, a(n) = a(n-1) + sum of prior prime terms.
2, 3, 8, 13, 31, 80, 129, 178, 227, 503, 1282, 2061, 2840, 3619, 4398, 5177, 5956, 6735, 7514, 8293, 17365, 26437, 61946, 97455, 132964, 168473, 203982, 239491, 275000, 310509, 346018, 381527, 798563, 1215599, 1632635, 2049671, 2466707, 5350450, 8234193, 11117936
Offset: 1
Keywords
Examples
For n=5, a(5) = a(4) + sum of prior primes = 13 + (2 + 3 + 13) = 31, so that 13 is counted twice.
Links
- James C. McMahon, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
Nest[Append[#,#[[-1]]+Total[Select[#,PrimeQ]]]&,{2,3},38]
-
Python
from sympy import isprime from itertools import count, islice def agen(): # generator of terms yield from [2, 3] primesum, an = 5, 3 while True: an += primesum if isprime(an): primesum += an yield an print(list(islice(agen(), 40))) # Michael S. Branicky, Feb 19 2025