A064934 Smallest prime (or noncomposite) strictly greater than sum of previous terms (with a(0)=1).
1, 2, 5, 11, 23, 43, 89, 179, 359, 719, 1433, 2879, 5749, 11497, 22993, 45989, 91997, 183971, 367949, 735901, 1471807, 2943599, 5887213, 11774429, 23548853, 47097697, 94195421, 188390809, 376781623, 753563269, 1507126519, 3014253049
Offset: 0
Keywords
Links
- Harry J. Smith, Table of n, a(n) for n=0..200
Programs
-
Mathematica
NextPrim[n_Integer] := Block[ {k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; a = {1}; Do[a = Append[a, NextPrim[ Apply[ Plus, a]]], {n, 1, 32} ]; a Module[{s={1}},Do[AppendTo[s,NextPrime[Total[s]]],{40}];s] (* Harvey P. Dale, Dec 29 2012 *) nxt[{t_,a_}]:=Module[{c=NextPrime[t]},{t+c,c}]; NestList[nxt,{1,1},40][[All,2]] (* Harvey P. Dale, Nov 27 2021 *)
-
PARI
{ for (n=0, 200, if (n, a=nextprime(s + 1); s+=a, a=s=1); write("b064934.txt", n, " ", a) ) } \\ Harry J. Smith, Sep 29 2009
Comments