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.

Showing 1-6 of 6 results.

A063807 a(0) = 0, a(n+1) = a(n) + next prime larger than a(n).

Original entry on oeis.org

0, 2, 5, 12, 25, 54, 113, 240, 481, 968, 1939, 3888, 7777, 15566, 31135, 62274, 124571, 249148, 498329, 996660, 1993349, 3986706, 7973417, 15946836, 31893677, 63787390, 127574781, 255149570, 510299161, 1020598332, 2041196671, 4082393354, 8164786741, 16329573512
Offset: 0

Views

Author

Pedro Ortiz-Villajos (perico1(AT)erols.com), Aug 20 2001

Keywords

Examples

			0 + 2 = 2, 2 + 3 = 5, 5 + 7 = 12, 12 + 13 = 25, 25 + 29 = 54, ...
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n=0, 0, (t->
          t+nextprime(t))(a(n-1)))
        end:
    seq(a(n), n=0..35);  # Alois P. Heinz, Sep 21 2021
  • Mathematica
    Join[{0}, NestList[# + NextPrime[#] &, 2, 50]] (* Updated by Jean-François Alcover, Apr 25 2022 for a(0)=0 *)
  • PARI
    s(n)=if(n<1,n=0,s(n-1)+nextprime(s(n-1)+1)); for(n=0,21,print(s(n)))
    
  • PARI
    { for (n=0, 200, if (n, a+=nextprime(a + 1), a=0); write("b063807.txt", n, " ", a) ) } \\ Harry J. Smith, Aug 31 2009

Extensions

More terms from Harvey P. Dale and Jason Earls, Aug 20 2001

A070232 a(1) = 4; a(n) = smallest composite number greater than the sum of all previous terms.

Original entry on oeis.org

4, 6, 12, 24, 48, 95, 190, 380, 760, 1520, 3040, 6080, 12160, 24320, 48640, 97280, 194560, 389120, 778240, 1556480, 3112960, 6225920, 12451840, 24903680, 49807360, 99614720, 199229440, 398458880, 796917760, 1593835520, 3187671040
Offset: 1

Views

Author

Amarnath Murthy, May 05 2002

Keywords

Comments

a(n) = 95*2^(n-6) for n > 5.

Crossrefs

Cf. A070218.

Programs

  • Mathematica
    a = {4}; Do[b = 1 + Plus @@ a; While[ PrimeQ[b], b++ ]; a = Append[a, b], {n, 2, 30}]; a
    nxt[{t_,a_}]:=Module[{k=t+1},While[!CompositeQ[k],k++];{t+k,k}]; NestList[nxt,{4,4},30][[;;,2]] (* Harvey P. Dale, Sep 14 2024 *)

Extensions

Edited by Robert G. Wilson v, May 06 2002

A112527 a(1)=2; a(n)=smallest prime not less than the sum of all previous terms.

Original entry on oeis.org

2, 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: 1

Views

Author

Zak Seidov, Sep 10 2005

Keywords

Comments

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

Crossrefs

Cf. A070218.
Cf. A064934. [From R. J. Mathar, Aug 15 2008]

Programs

  • Mathematica
    s={2};ss=2;Do[a=If[PrimeQ[ss], ss, Prime[PrimePi[ss]+1]];AppendTo[s, a];AddTo[ss, a], {i, 35}];A112527=s
    Module[{ll={2}},Do[AppendTo[ll,NextPrime[Total[ll]-1]],{40}];ll] (* Harvey P. Dale, May 07 2012 *)
    nxt[{t_,a_}]:= Module[{c=NextPrime[t-1]}, {t+c,c}]; Rest[NestList[nxt,{0,2},40][[All,2]]] (* Harvey P. Dale, Nov 22 2019 *)

A165549 a(1) = 7; for n > 1, a(n) = smallest prime strictly greater than sum of previous terms.

Original entry on oeis.org

7, 11, 19, 41, 79, 163, 331, 653, 1307, 2617, 5231, 10463, 20929, 41863, 83717, 167437, 334877, 669763, 1339523, 2679037, 5358083, 10716163, 21432317, 42864671, 85729367, 171458671, 342917357, 685834729, 1371669443, 2743338881
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    a=7;b=11;s=a+b;lst={a,b};Do[i=1;While[ !PrimeQ[s+i],i++ ];c=s+i;AppendTo[lst,c];a=b;b=c;s+=c,{n,2*4!}];lst
    nxt[{t_,a_}]:=Module[{c=NextPrime[t]},{t+c,c}]; NestList[nxt,{7,7},30][[All,2]] (* Harvey P. Dale, Aug 03 2017 *)
  • PARI
    {m=30; s=0; v=vector(m); v[1]=7; for(n=2, m, s+=v[n-1]; v[n]=nextprime(s+1)); v} \\ Klaus Brockhaus, Sep 25 2009

Extensions

Edited by Klaus Brockhaus, Sep 25 2009

A196375 a(1)=2; a(n)=smallest prime greater than the half-sum of all previous terms.

Original entry on oeis.org

2, 2, 3, 5, 7, 11, 17, 29, 41, 59, 89, 137, 211, 307, 461, 691, 1039, 1559, 2339, 3511, 5261, 7901, 11863, 17783, 26669, 40009, 60013, 90011, 135017, 202529, 303803, 455701, 683567, 1025327, 1537997, 2307031, 3460517, 5190769, 7786151, 11679223, 17518843, 26278261
Offset: 1

Views

Author

Zak Seidov, Oct 28 2011

Keywords

Comments

a(n) <= A070218(n).
If we introduce k in the name "(sum of all previous terms)/k", then cases k=1,2 correspond to A070218, A196375, and in general case, the sequence begins with k 2's, with gradually (not monotonically) decreasing multiplicity of terms; e.g., at case k=10 the sequence begins: 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 5, 5, 5, 5, 7, 7, 7, 11, 11, 11, 11, 13, 17, 17, 17, 19, 23, 23, 29, 29, 31, 37, 41.

Crossrefs

Cf. A070218.

Programs

  • Mathematica
    Nest[Append[#,NextPrime[Total[#]/2]]&,{2},100]
  • PARI
    print1(s=2);for(i=2,99,print1(", ",t=nextprime(s/2));s+=t) \\ Charles R Greathouse IV, Dec 31 2011

A070805 a(1) = 2; a(n) = largest prime not exceeding the sum of all previous terms.

Original entry on oeis.org

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

Views

Author

Labos Elemer, May 08 2002

Keywords

Crossrefs

Cf. A070218.

Programs

  • 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 *)
Showing 1-6 of 6 results.