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, 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
Keywords
Links
- Charles R Greathouse IV, Table of n, a(n) for n = 2..10000
Programs
-
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 *)
-
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
Extensions
More terms from Peter J. C. Moses, Dec 02 2016
Comments