login
A031408
Numbers k such that the continued fraction for sqrt(k) has even period 2*m and the m-th term of the periodic part is 5.
1
27, 31, 43, 47, 104, 128, 160, 192, 231, 303, 375, 408, 435, 472, 536, 635, 664, 715, 776, 815, 835, 912, 1115, 1135, 1215, 1239, 1267, 1464, 1488, 1575, 1603, 1616, 1631, 1712, 1744, 1752, 1840, 1883, 1967, 1968, 2000, 2043, 2051, 2096, 2135, 2224, 2259
OFFSET
1,1
MATHEMATICA
n = 1; t = {}; While[Length[t] < 50, n++; If[! IntegerQ[Sqrt[n]], c = ContinuedFraction[Sqrt[n]]; len = Length[c[[2]]]; If[EvenQ[len] && c[[2, len/2]] == 5, AppendTo[t, n]]]]; t (* T. D. Noe, Apr 04 2014 *)
ep5Q[n_]:=Module[{s=Sqrt[n], cf, len}, cf=If[IntegerQ[s], {1}, ContinuedFraction[ s][[2]]]; len=Length[cf]; EvenQ[len]&&cf[[len/2]] == 5]; Select[ Range[ 2500], ep5Q] (* Harvey P. Dale, Apr 24 2016 *)
CROSSREFS
KEYWORD
nonn
STATUS
approved