A031688 Numbers k such that the continued fraction for sqrt(k) has odd period and if the last term of the periodic part is deleted the two central terms are both 100.
2501, 123953, 203482, 204385, 206197, 304825, 425273, 568741, 726193, 727898, 734738, 906665, 1119805, 1124041, 1334554, 1341493, 1346129, 1565626, 1568129, 1570634, 1573141, 1578161, 1580674, 1583189, 1590746, 1593269, 1828633, 2126605, 2138285, 2144137
Offset: 1
Keywords
Links
- Chai Wah Wu, Table of n, a(n) for n = 1..1000
Programs
-
Mathematica
cf100Q[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]] == 100]; Select[Range[2200000],cf100Q] (* Harvey P. Dale, May 29 2016 *)
-
Python
from sympy import continued_fraction_periodic A031688_list = [n for n, s in ((i, continued_fraction_periodic(0,1,i)[-1]) for i in range(1,10**5)) if isinstance(s, list) and len(s) % 2 and s[(len(s)-1)//2] == 100] # Chai Wah Wu, Jun 11 2017
Extensions
Definition corrected and terms corrected and extended by Harvey P. Dale, May 29 2016