OFFSET
2,9
COMMENTS
The sequence is based on the well known Rosser's inequality, prime(n) >= ceiling(n*log(n)), n >= 2, and the Een Eigen Rij algorithm (cf. A278586).
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 2..10000
MATHEMATICA
f[n_] := Length@ NestWhileList[# - Ceiling[#/n] &, Prime@ n, # > Ceiling[n*Log[ n]] &] - 1; Array[f, 80, 2] (* Robert G. Wilson v, Dec 02 2016 *)
PROG
(PARI) a(n, x=prime(n))=my(t=ceil(log(n)*n), s); while(x>t, x -= (x-1)\n + 1; s++); s \\ Charles R Greathouse IV, Dec 02 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Shevelev, Dec 02 2016
EXTENSIONS
More terms from Peter J. C. Moses, Dec 02 2016
STATUS
approved