login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A070805
a(1) = 2; a(n) = largest prime not exceeding the sum of all previous terms.
0
2, 3, 5, 7, 17, 31, 61, 113, 239, 467, 941, 1879, 3761, 7523, 15031, 30071, 60149, 120299, 240599, 481181, 962363, 1924721, 3849437, 7698893, 15397783, 30795571, 61591147, 123182281, 246364571, 492729101, 985458239, 1970916449
OFFSET
1,1
MATHEMATICA
tb[0]={} tb[x_] := Union[tb[x-1], m[x]] m[x_] := {Prime[PrimePi[Apply[Plus, tb[x-1]]]]} Union[Delete[Flatten[Table[m[w], {w, 1, 20}]], 1], {2}]
nxt[{t_, p_}]:=Module[{c=If[PrimeQ[t], t, NextPrime[t, -1]]}, {t+c, c}]; Join[ {2}, NestList[nxt, {5, 3}, 40][[All, 2]]] (* Harvey P. Dale, Jun 21 2020 *)
CROSSREFS
Cf. A070218.
Sequence in context: A048418 A074788 A262833 * A255161 A103385 A103389
KEYWORD
nonn
AUTHOR
Labos Elemer, May 08 2002
STATUS
approved