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.

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