OFFSET
0,2
LINKS
Harvey P. Dale, Table of n, a(n) for n = 0..1000
EXAMPLE
The numbers of the form 7*k - 1 that are greater than a(6) = 23 form the sequence that starts 27,34,41,48,... The first prime of this sequence is 41. So a(7) = 41.
MAPLE
A140327 := proc(n) option remember ; local a, k ; if n = 0 then 1; else for a from A140327(n-1)+1 do if isprime(a) then for k from 0 do if a = n*k-1 then RETURN(a) ; elif n*k-1 > a then break ; fi ; od: fi ; od: fi ; end: seq(A140327(n), n=0..80) ; # R. J. Mathar, Jun 19 2008
MATHEMATICA
nxt[{n_, a_}]:=Module[{k=Floor[a/(n+1)]+1, lst}, lst=(n+1)Range[k, k+50]-1; {n+1, SelectFirst[lst, #>a&&PrimeQ[#]&]}]; NestList[nxt, {0, 1}, 60][[All, 2]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jan 01 2018 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, May 26 2008
EXTENSIONS
More terms from R. J. Mathar, Jun 19 2008
STATUS
approved