login
A140327
a(0)=1. For n >=1, a(n) is the smallest prime that is > a(n-1) and equals n*k -1, for some positive integer k.
1
1, 2, 3, 5, 7, 19, 23, 41, 47, 53, 59, 109, 131, 181, 223, 239, 271, 373, 431, 569, 599, 797, 857, 919, 983, 1049, 1091, 1187, 1231, 1913, 1949, 2293, 2399, 2441, 2447, 2659, 2663, 3181, 3191, 3821, 3919, 4099, 4157, 4643, 4663, 4679, 4691, 4793, 4799, 4801
OFFSET
0,2
LINKS
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
Cf. A071899.
Sequence in context: A332583 A345335 A025019 * A346167 A163074 A230041
KEYWORD
nonn
AUTHOR
Leroy Quet, May 26 2008
EXTENSIONS
More terms from R. J. Mathar, Jun 19 2008
STATUS
approved