The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A289217 a(1)=1, a(n)=a(n-1) plus the second prime greater than a(n-1). 1
1, 4, 11, 28, 59, 126, 257, 526, 1073, 2164, 4367, 8758, 17537, 35088, 70187, 140388, 280795, 561612, 1123315, 2246642, 4493329, 8986712, 17973451, 35946942, 71893933, 143787890, 287575797, 575151614, 1150303251, 2300606554, 4601213127, 9202426258 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
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
Sequence in context: A282641 A031127 A239031 * A329141 A090539 A262050
KEYWORD
nonn
AUTHOR
Harvey P. Dale, Jun 28 2017
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 8 13:28 EDT 2024. Contains 373217 sequences. (Running on oeis4.)