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”).

A070218
a(1) = 2; a(n) is the smallest prime greater than the sum of all previous terms.
7
2, 3, 7, 13, 29, 59, 127, 241, 487, 971, 1949, 3889, 7789, 15569, 31139, 62297, 124577, 249181, 498331, 996689, 1993357, 3986711, 7973419, 15946841, 31893713, 63787391, 127574789, 255149591, 510299171, 1020598339, 2041196683, 4082393387, 8164786771, 16329573527
OFFSET
1,1
COMMENTS
Grows exponentially: ceiling(log_2(a(n))) = n. - Labos Elemer, May 08 2002
LINKS
Vojtech Strnad, Table of n, a(n) for n = 1..2000 (first 200 terms from Zak Seidov)
MAPLE
s:= proc(n) option remember; `if`(n<1, 0, s(n-1)+a(n)) end:
a:= proc(n) option remember; `if`(n<1, 0, nextprime(s(n-1))) end:
seq(a(n), n=1..35); # Alois P. Heinz, Sep 21 2021
MATHEMATICA
tb[0]={} tb[x_] := Union[tb[x-1], m[x]] m[x_] := {Prime[1+PrimePi[Apply[Plus, tb[x-1]]]]} Flatten[Table[m[w], {w, 1, 10}]] (* Labos Elemer, May 08 2002 *)
bb={2}; s=2; Do[p=Prime[PrimePi[s]+1]; s=s+p; bb=Append[bb, p], {k, 32}]; bb (Seidov)
Nest[Append[#, NextPrime[Total[#]]]&, {2}, 30] (* Zak Seidov, Oct 28 2011 *)
PROG
(PARI) print1(s=2); for(n=2, 99, print1(", "t=nextprime(s+1)); s+=t)
(Python)
from sympy import nextprime
def aupton(terms):
alst, s = [2], 2
while len(alst) < terms:
p = nextprime(s)
alst.append(p)
s += p
return alst
print(aupton(31)) # Michael S. Branicky, Sep 21 2021
CROSSREFS
Sequence in context: A199582 A255516 A113884 * A048456 A333313 A262829
KEYWORD
nonn
AUTHOR
Amarnath Murthy, May 01 2002
EXTENSIONS
More terms from Labos Elemer, May 08 2002
Corrected by Zak Seidov, May 21 2005
STATUS
approved