OFFSET
2,1
COMMENTS
Consider the continued fraction [0;c1,c2,...,cm] of k/n, with k<n and gcd(k,n)=1. Let f(k,n) be the maximum of the ci. Then a(n) is the minimum value of f(k,n).
Zaremba conjectured that a(n)<=5, a bound that is attained for n in A195901. It appears that n=150 may be the largest integer with a(n)=5, while n=6234 may be the largest integer with a(n)=4.
LINKS
Robin Visser, Table of n, a(n) for n = 2..10000 (terms n = 2..2000 from T. D. Noe).
MATHEMATICA
Table[c=ContinuedFraction[Select[Range[n-1], GCD[ #, n]==1&]/n]; Min[Max/@c], {n, 150}]
PROG
(PARI) vecmax(v)=my(mx=v[1]); for(i=2, #v, mx=max(mx, v[i])); mx
a(n)=vecmin([vecmax(contfrac(k/n))|k<-[1..n], gcd(k, n)==1]) \\ Charles R Greathouse IV, Jul 18 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
T. D. Noe, Jul 08 2008
EXTENSIONS
Edited by Max Alekseyev, Sep 25 2011
STATUS
approved