cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

This page as a plain text file.
%I A031408 #19 Aug 18 2021 00:14:06
%S A031408 27,31,43,47,104,128,160,192,231,303,375,408,435,472,536,635,664,715,
%T A031408 776,815,835,912,1115,1135,1215,1239,1267,1464,1488,1575,1603,1616,
%U A031408 1631,1712,1744,1752,1840,1883,1967,1968,2000,2043,2051,2096,2135,2224,2259
%N 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.
%H A031408 T. D. Noe, <a href="/A031408/b031408.txt">Table of n, a(n) for n = 1..1000</a>
%t A031408 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 *)
%t A031408 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 *)
%Y A031408 Cf. A031404-A031423.
%K A031408 nonn
%O A031408 1,1
%A A031408 _David W. Wilson_