login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A071899
a(0)=1 and for n>0: a(n) = least prime>a(n-1) of form 1+k*n.
2
1, 2, 3, 7, 13, 31, 37, 43, 73, 109, 131, 199, 229, 313, 337, 421, 433, 443, 487, 571, 601, 631, 661, 691, 769, 1051, 1093, 1297, 1373, 1451, 1471, 1489, 1601, 1783, 1871, 2311, 2341, 2591, 2699, 2731, 2801, 2953, 3067, 3527, 3697, 4051
OFFSET
0,2
EXAMPLE
n=5: in the sequence 1+k*5: 6,11,16,21,26,31,36,41,... the first prime >13=a(4) is 31, therefore a(5)=31.
MATHEMATICA
a[0] = 1; a[1] = 2; a[n_] := a[n] = (p = NextPrime[a[n-1]]; While[True, If[Mod[p, n] == 1, Break[], p = NextPrime[p]]]; p); Table[a[n], {n, 0, 45}] (* Jean-François Alcover, Oct 10 2011 *)
lp[{n_, p_}]:=Module[{np=NextPrime[p]}, While[!IntegerQ[(np-1)/(n+1)], np= NextPrime[np]]; {n+1, np}]; Transpose[NestList[lp, {0, 1}, 50]][[2]] (* Harvey P. Dale, May 12 2015 *)
CROSSREFS
Sequence in context: A048456 A333313 A262829 * A242389 A102644 A014234
KEYWORD
nonn,nice
AUTHOR
Reinhard Zumkeller, Jun 12 2002
STATUS
approved