login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Minimum number of 4's such that n*[n; 4, ..., 4, n] = [x; ..., x] for some x, where [...] denotes simple continued fractions.
2

%I #8 Sep 17 2015 04:39:33

%S 1,3,1,4,3,7,3,3,9,9,3,6,7,19,7,2,3,5,9,7,9,7,3,24,13,11,7,13,19,9,15,

%T 19,5,39,3,18,5,27,19,19,7,43,9,19,7,15,7,55,49,11,13,8,11,9,7,11,13,

%U 57,19,4,9,7,31,34,19,67,5,7,39,69,3,36,37,99,5,39,27,25,39,35,19,27,7,14,43,27,19,10,19,55,7,19,15,29,15,48,55,19

%N Minimum number of 4's such that n*[n; 4, ..., 4, n] = [x; ..., x] for some x, where [...] denotes simple continued fractions.

%C Sequence A213893 lists fixed points of this sequence.

%t 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[4, #] & /@ Range[2, 120] (* _Michael De Vlieger_, Sep 16 2015 *)

%o (PARI) cf(v)={t=v[#v];forstep(i=#v-1,1,-1,t=v[i]+1/t);t}

%o A262214(n,d=4)=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))

%Y Cf. A213648, A262212 - A262220, A213900, A262211;

%Y Cf. A000057, A213891 - A213899, A261311.

%K nonn

%O 2,2

%A _M. F. Hasler_, Sep 15 2015