Is anything known about the growth of this function? In[1130]:= NestWhile[{2*Ceiling[1/#[[1]]] - 1 - 1/#[[1]], #[[2]] + 1} &, {3/8, 0}, #[[1]] != 0 &] Out[1130]= {0, 20} In[1131]:= NestWhile[{2*Ceiling[1/#[[1]]] - 1 - 1/#[[1]], #[[2]] + 1} &, {22/7, 0}, #[[1]] != 0 &] Out[1131]= {0, 519} In[1132]:= NestWhile[{2*Ceiling[1/#[[1]]] - 1 - 1/#[[1]], #[[2]] + 1} &, {355/113, 0}, #[[1]] != 0 &] Out[1132]= {0, 67107847} Checks: In[1133]:= Timing[ NestWhile[{1/(2*Floor[#[[1]]] + 1 - #[[1]]), #[[2]] + 1} &, {0, 0}, #[[1]] != 22/7 &]] Out[1133]= {0.005219, {22/7, 519}} In[1134]:= Timing[ NestWhile[{1/(2*Floor[#[[1]]] + 1 - #[[1]]), #[[2]] + 1} &, {0, 0}, #[[1]] != 355/113 &]] Out[1134]= {700.483896, {355/113, 67107847}} --rwg On Sat, Oct 5, 2013 at 6:20 PM, Bill Gosper <billgosper@gmail.com> wrote:
In[1106]:= NestList[2*Ceiling[1/#] - 1 - 1/# &, 3/8, 22]
Out[1106]= {3/8, 7/3, 4/7, 5/4, 1/5, 4, 3/4, 5/3, 2/5, 5/2, 3/5, 4/3, 1/4, 3, 2/3, 3/2, 1/3, 2, 1/2, 1, 0, Indeterminate, Indeterminate}
So 3/8 is the "20th rational".
The 68th iterate on √2: In[1127]:= ContinuedFraction[ Nest[Simplify[2*Ceiling[1/#] - 1 - 1/#] &, Sqrt[2], 68]]
Out[1127]= {1, 1, 1, 1, 1, 1, 1, 1, 1, {2}}
I.e., it tries to disguise √2 as the golden ratio by sticking nine 1s on the front. Many other iterates of this process produce CFs with only 1s and 2s. --rwg