OFFSET
1,2
EXAMPLE
a(7) = 17. So a(8) = the largest prime <= 17 + 7 = 24, which is 23.
MATHEMATICA
PrevPrim[n_] := Block[{k = n - 1}, While[ !PrimeQ[k], k-- ]; k]; a[1] = 1; a[n_] := a[n] = PrevPrim[a[n - 1] + n]; Array[a, 55] (* Robert G. Wilson v *)
a[1]=1; a[n_]:=NextPrime[a[n-1]+n, -1]; Table[a[n], {n, 55}] (* James C. McMahon, Jun 16 2024 *)
PROG
(PARI) {print1(a=1, ", "); for(n=2, 55, print1(a=precprime(a+n-1), ", "))} \\ Klaus Brockhaus, Jan 06 2006
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Jan 05 2006
EXTENSIONS
More terms from Klaus Brockhaus and Robert G. Wilson v, Jan 06 2006
STATUS
approved