OFFSET
1,1
LINKS
T. D. Noe, Table of n, a(n) for n = 1..999
EXAMPLE
The simple continued fraction for sqrt(274) = [16; 1, 1, 4, 4, 1, 1, 32, ...] with odd period 7 and central term 4. Another example is sqrt(481) = [21; 1, 13, 1, 1, 1, 4, 4, 1, 1, 1, 13, 1, 42, ...] with odd period 13 and central term 4. - Michael Somos, Apr 03 2014
MATHEMATICA
n = 1; t = {}; While[Length[t] < 50, n++; If[! IntegerQ[Sqrt[n]], c = ContinuedFraction[Sqrt[n]]; len = Length[c[[2]]]; If[OddQ[len] && c[[2, (len + 1)/2]] == 4, AppendTo[t, n]]]]; t (* T. D. Noe, Apr 03 2014 *)
cf4Q[n_]:=Module[{s=Sqrt[n], cf, len}, cf=If[IntegerQ[s], {1, 1}, ContinuedFraction[ s][[2]]]; len=Length[cf]; OddQ[len]&&cf[[(len+1)/2]] == cf[[(len-1)/2]]==4]; Select[Range[5500], cf4Q] (* Harvey P. Dale, Jul 28 2021 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
a(1) corrected by T. D. Noe, Apr 03 2014
STATUS
approved