OFFSET
0,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..2500 (first 201 terms from Harry J. Smith)
EXAMPLE
0 + 2 = 2, 2 + 3 = 5, 5 + 7 = 12, 12 + 13 = 25, 25 + 29 = 54, ...
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 *)
PROG
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
Pedro Ortiz-Villajos (perico1(AT)erols.com), Aug 20 2001
EXTENSIONS
More terms from Harvey P. Dale and Jason Earls, Aug 20 2001
STATUS
approved