login
A133489
a(1)=2. For n >= 2, a(n) = a(n-1) + 1 + (the largest prime among the first n-1 terms of the sequence {a(k)}).
1
2, 5, 11, 23, 47, 95, 143, 191, 383, 767, 1151, 2303, 3455, 4607, 5759, 6911, 13823, 20735, 27647, 55295, 82943, 110591, 138239, 276479, 414719, 552959, 691199, 1382399, 2073599, 2764799, 3455999, 6911999, 10367999, 13823999, 17279999
OFFSET
1,1
LINKS
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
Sequence in context: A348855 A175867 A083005 * A060153 A086219 A153893
KEYWORD
nonn
AUTHOR
Leroy Quet, Nov 30 2007
EXTENSIONS
More terms from Stefan Steinerberger, Dec 03 2007
STATUS
approved