|
|
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
|
|
|
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)
(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))
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|