OFFSET
2,1
COMMENTS
Sequence A213898 lists fixed points of this sequence.
MATHEMATICA
f[m_, n_] := Block[{c, k = 1}, c[x_, y_] := ContinuedFraction[x FromContinuedFraction[Join[{x}, Table[m, {y}], {x}]]]; While[First@ c[n, k] != Last@ c[n, k], k++]; k]; f[9, #] & /@ Range[2, 120] (* Michael De Vlieger, Sep 16 2015 *)
PROG
(PARI) cf(v)={t=v[#v]; forstep(i=#v-1, 1, -1, t=v[i]+1/t); t}
A262219(n, d=9)=for(k=1, 9e9, (c=contfrac(cf(vector(k+2, i, if(i>1&&i<k+2, d, n)))*n))[1]==c[#c]&&return(k))
CROSSREFS
KEYWORD
nonn
AUTHOR
M. F. Hasler, Sep 15 2015
STATUS
approved