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”).

A278950
Start with X = prime(n). Repeatedly replace X with X - ceiling(X/n); a(n) is the number of steps to reach a number <= ceiling(n*log(n)).
1
1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 3, 3, 5, 5, 5, 5, 6, 5, 6, 6, 6, 6, 6, 6, 7, 6, 6, 5, 7, 8, 8, 7, 7, 7, 6, 7, 8, 8, 8, 7, 8, 7, 7, 8, 9, 9, 9, 8, 10, 10, 11, 11, 10, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 13, 12, 12, 12, 12, 12, 12, 11, 11, 12, 13, 12, 13, 12, 13, 13, 13, 15, 15, 16, 16, 16, 15, 15, 16, 16, 16, 15, 15, 15, 15, 14, 15, 16, 15, 15, 15, 15, 14, 15, 15, 15, 16, 16, 16, 17, 18
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
Sequence in context: A179938 A081412 A082863 * A029411 A165093 A066088
KEYWORD
nonn
AUTHOR
Vladimir Shevelev, Dec 02 2016
EXTENSIONS
More terms from Peter J. C. Moses, Dec 02 2016
STATUS
approved