OFFSET
1,3
COMMENTS
Computed by doing all computations over the integers (multiply by n) and by truncating modulo n^250. This avoids the explosion of the integers (of order 2^(2^k) after k iterations) and gives the correct answer if the final index i(n) is < 250 (or perhaps 249 or 248). If the algorithm does not stop before 245 one should increase precision (work with n^500 or even higher). - Roland Bacher
Always reaches an integer for n <= 100. - Roland Bacher, Aug 30 2002
Always reaches an integer for n <= 200. - N. J. A. Sloane, Sep 04 2002
Always reaches an integer for n <= 500 by comparing results with index 1000 and index 2500. - Robert G. Wilson v, Sep 11 2002
Always reaches an integer for n <= 3000. The Mathematica program automatically adjusts the modulus m required to find the first integral iterate. - T. D. Noe, Apr 10 2006
Always reaches an integer for n <= 5000. - Ben Branman, Feb 12 2011
LINKS
T. D. Noe, Table of n, a(n) for n=1..3000
EXAMPLE
a(7) = 3 since 8/7 -> 16/7 -> 48/7 -> 48.
MATHEMATICA
Table[{n, First[Flatten[Position[Map[Denominator, NestList[ # Ceiling[ # ] &, (n + 1)/n, 20]], 1]]]}, {n, 1, 20}]
f[n_] := Block[{k = (n + 1)/n, c = 0}, While[ !IntegerQ[k], c++; k = Mod[k*Ceiling[k], n^250]]; c]; Table[ f[n], {n, 1, 100}]
Table[lim=50; While[k=0; x=1+1/n; m=n^lim; While[k<lim-3 && !IntegerQ[x], x=Mod[x*Ceiling[x], m]; k++ ]; k==lim-3, lim=2*lim]; k, {n, 1000}] (* T. D. Noe, Apr 10 2006 *)
CROSSREFS
KEYWORD
nonn,nice
AUTHOR
N. J. A. Sloane, Aug 29 2002
EXTENSIONS
a(5)-a(10), a(12)-a(18), a(20) = 11 from Ed Pegg Jr, Aug 29 2002
T. D. Noe also found a(5) and remarks that the final integer is 9.5329600...*10^57734. - Aug 29 2002
a(11) from T. D. Noe, who remarks that the final integer is 5.131986636061311...*10^13941166 - Aug 29 2002
a(19) and a(21) onwards from Roland Bacher, Aug 30 2002
STATUS
approved