OFFSET
1,1
COMMENTS
More generally, let b(1)>1, m >0, b(n) be the smallest integer > b(n-1) such that b(n) is prime if n is prime, then limit n ->infinity b(n)/n =L exists and b<L<b+1.
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
FORMULA
There is a constant C such that limit n ->infinity a(n)/n = C =1.72...
MATHEMATICA
nxt[{n_, a_}]:={n+1, If[PrimeQ[n+1], NextPrime[a], a+1]}; NestList[nxt, {1, 2}, 80][[;; , 2]] (* Harvey P. Dale, Sep 13 2024 *)
PROG
(PARI) a(n)=if(n<2, 2, if(isprime(n), nextprime(a(n-1)+1), a(n-1)+1))
CROSSREFS
KEYWORD
nonn
AUTHOR
Benoit Cloitre, Feb 06 2003
STATUS
approved