OFFSET
1,2
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
FORMULA
a(n) ~ k*2^n, where k = 2.142606837.... - Charles R Greathouse IV, Jun 29 2017
EXAMPLE
a(3) = 11 because a(2) = 4, the first prime greater than 4 is 5, the second prime greater than 4 is 7, and 4 + 7 = 11.
MATHEMATICA
NestList[#+NextPrime[#, 2]&, 1, 40]
PROG
(PARI) step(n)=n+nextprime(nextprime(n+1)+1)
a(n)=if(n>1, step(a(n-1)), 1) \\ Charles R Greathouse IV, Jun 29 2017
(Python)
from sympy import nextprime
from sympy.core.cache import cacheit
@cacheit
def step(n): return n + nextprime(nextprime(n))
def a(n): return n if n<2 else step(a(n - 1))
print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jul 22 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Harvey P. Dale, Jun 28 2017
STATUS
approved