OFFSET
0,2
COMMENTS
Also employed Kim Walisch's primesum.
EXAMPLE
a(0) = 0 since there are no primes up to 1 which is A007097(0);
a(1) = 2 since the first Primeth recurrence, A007097(1) is 2;
a(2) = 5 since the second Primeth recurrence, A007097(2) is 3, and 2+3 = 5;
a(3) = 10 since the third Primeth recurrence, A007097(3) is 5, and 2+3+5 = 10;
a(4) = 28 since the fourth Primeth recurrence, A007097(4) is 11, 2+3+5+7+11 = 28;
a(5) = 160 since the fifth Primeth recurrence, A007097(5) is 31, and 2+3+5+7+11+13+17+19+23+29+31 = 160; etc.
MATHEMATICA
f[n_] := Block[{lmt = Nest[ Prime@# &, 1, n], p = 2, s = 0}, While[p <= lmt, s += p; p = NextPrime@ p]; s]; Array[f, 14, 0]
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert G. Wilson v, Mar 08 2017
STATUS
approved