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.
%I A013945 #19 Aug 09 2017 09:20:23 %S A013945 3,2,11,5,27,10,51,17,83,26,123,37,171,50,227,65,291,82,363,101,443, %T A013945 122,531,145,627,170,731,197,843,226,963,257,1091,290,1227,325,1371, %U A013945 362,1523,401,1683,442,1851,485,2027,530,2211,577,2403,626,2603,677,2811 %N A013945 Least d such that period of continued fraction for sqrt(d) contains n (n^2+2 if n odd, (n/2)^2+1 if n even). %H A013945 T. D. Noe, <a href="/A013945/b013945.txt">Table of n, a(n) for n = 1..1000</a> %H A013945 <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (0,3,0,-3,0,1). %F A013945 G.f.: x(x^5+3x^4-x^3+2x^2+2x+3)/(1-x^2)^3. - _N. J. A. Sloane_, Jun 12 2004 %e A013945 a(3) = 11 because the continued fraction for the square root of 11 is 3, {3, 6}. %t A013945 Table[If[OddQ[n], n^2 + 2, (n/2)^2 + 1], {n, 100}] (* _T. D. Noe_, Feb 28 2012 *) %o A013945 (PARI) a(n)=if(n%2, n^2+2, (n/2)^2+1) \\ _Charles R Greathouse IV_, Aug 09 2017 %Y A013945 Bisections: A164897, A002522. %K A013945 nonn,easy %O A013945 1,1 %A A013945 _Clark Kimberling_