cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A070218 a(1) = 2; a(n) is the smallest prime greater than the sum of all previous terms.

This page as a plain text file.
%I A070218 #33 Sep 21 2021 19:31:20
%S A070218 2,3,7,13,29,59,127,241,487,971,1949,3889,7789,15569,31139,62297,
%T A070218 124577,249181,498331,996689,1993357,3986711,7973419,15946841,
%U A070218 31893713,63787391,127574789,255149591,510299171,1020598339,2041196683,4082393387,8164786771,16329573527
%N A070218 a(1) = 2; a(n) is the smallest prime greater than the sum of all previous terms.
%C A070218 Grows exponentially: ceiling(log_2(a(n))) = n. - _Labos Elemer_, May 08 2002
%H A070218 Vojtech Strnad, <a href="/A070218/b070218.txt">Table of n, a(n) for n = 1..2000</a> (first 200 terms from Zak Seidov)
%p A070218 s:= proc(n) option remember; `if`(n<1, 0, s(n-1)+a(n)) end:
%p A070218 a:= proc(n) option remember; `if`(n<1, 0, nextprime(s(n-1))) end:
%p A070218 seq(a(n), n=1..35);  # _Alois P. Heinz_, Sep 21 2021
%t A070218 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 *)
%t A070218 bb={2};s=2;Do[p=Prime[PrimePi[s]+1];s=s+p;bb=Append[bb, p], {k, 32}];bb (Seidov)
%t A070218 Nest[Append[#,NextPrime[Total[#]]]&,{2},30] (* _Zak Seidov_, Oct 28 2011 *)
%o A070218 (PARI) print1(s=2);for(n=2,99,print1(", "t=nextprime(s+1));s+=t)
%o A070218 (Python)
%o A070218 from sympy import nextprime
%o A070218 def aupton(terms):
%o A070218     alst, s = [2], 2
%o A070218     while len(alst) < terms:
%o A070218         p = nextprime(s)
%o A070218         alst.append(p)
%o A070218         s += p
%o A070218     return alst
%o A070218 print(aupton(31)) # _Michael S. Branicky_, Sep 21 2021
%Y A070218 Cf. A063807, A151800.
%K A070218 nonn
%O A070218 1,1
%A A070218 _Amarnath Murthy_, May 01 2002
%E A070218 More terms from _Labos Elemer_, May 08 2002
%E A070218 Corrected by _Zak Seidov_, May 21 2005