OFFSET
1,1
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
MATHEMATICA
Min[ContinuedFraction[Sqrt[#]][[2]]]&/@Select[Range[ 200], !IntegerQ[ Sqrt[ #]]&] (* Harvey P. Dale, May 20 2021 *)
PROG
(PARI) do(n)=my(a0=sqrtint(n), a, b=a0, c=n-a0^2, bold, cold, least=2*a0); while(1, a=(a0+b)\c; if(a<2, return(1)); least=min(least, a); bold=b; b=a*c-b; cold=c; c=(n-b^2)\c; if(b==bold || c==cold, return(least)))
first(n)=my(v=vector(n), k, i); while(1, k++; for(m=k^2+1, k^2+2*k, if(i++>n, return(v)); v[i]=do(m))) \\ Charles R Greathouse IV, Aug 10 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
Name corrected by Charles R Greathouse IV, Aug 10 2017
STATUS
approved