OFFSET
1,1
LINKS
Ivan Neretin, Table of n, a(n) for n = 1..10000
EXAMPLE
a(1)=2, the first prime. The smallest integer >=2 that yields a prime when added to 2 is 3, so a(2)=3. The smallest integer >=3 that yields a prime when added to 2+3 is 6 so a(3)=6.
MATHEMATICA
s = 0; NestList[(s += #; NextPrime[s + # - 1] - s) &, 2, 61] (* Ivan Neretin, May 14 2015 *)
nxt[{t_, a_}]:=Module[{k=a}, While[CompositeQ[t+k], k++]; {t+k, k}]; NestList[nxt, {2, 2}, 70][[;; , 2]] (* Harvey P. Dale, Sep 01 2024 *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Neil Fernandez, Dec 18 2002
STATUS
approved