OFFSET
1,1
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
EXAMPLE
The largest prime among the first 7 terms of the sequence is a(5)=47. So a(8) = a(7) + 1 + 47 = 143 + 1 + 47 = 191.
MATHEMATICA
a = {2}; Do[AppendTo[a, a[[ -1]] + 1 + Select[a, PrimeQ[ # ] &][[ -1]]], {40}]; a (* Stefan Steinerberger, Dec 03 2007 *)
nxt[{lp_, a_}]:=With[{c=a+lp+1}, {If[PrimeQ[c], c, lp], c}]; NestList[nxt, {2, 2}, 40][[;; , 2]] (* Harvey P. Dale, Apr 29 2023 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Nov 30 2007
EXTENSIONS
More terms from Stefan Steinerberger, Dec 03 2007
STATUS
approved