login
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 31.
0

%I #12 Aug 18 2021 00:10:32

%S 6109,12149,19681,20530,30397,40973,55921,57346,70514,71578,73189,

%T 87977,89165,91565,110665,111997,128693,132298,133754,151169,151946,

%U 155861,157441,159029,159826,178813,203341,206957,212441,234250,235217,236186,237157,238130

%N 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 31.

%t cf31Q[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]] == 31]; Select[Range[250000],cf31Q] (* _Harvey P. Dale_, Jun 01 2018 *)

%K nonn

%O 1,1

%A _David W. Wilson_

%E Corrected and extended by _Harvey P. Dale_, Jun 01 2018