login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 


Numbers k such that the continued fraction for sqrt(k) has odd period and if the last term of the periodic part is deleted then there are a pair of central terms both equal to 4.
1

%I #32 Aug 18 2021 00:33:16

%S 274,370,481,797,953,1069,1249,1313,1378,1381,1514,1657,1658,1733,

%T 1889,2125,2297,2377,2554,2557,2833,2834,2929,2941,3226,3329,3338,

%U 3433,3541,3761,3874,3989,4093,4106,4441,4442,4561,4682,4685,4933,4937,5197,5450

%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 then there are a pair of central terms both equal to 4.

%H T. D. Noe, <a href="/A031417/b031417.txt">Table of n, a(n) for n = 1..999</a>

%e The simple continued fraction for sqrt(274) = [16; 1, 1, 4, 4, 1, 1, 32, ...] with odd period 7 and central term 4. Another example is sqrt(481) = [21; 1, 13, 1, 1, 1, 4, 4, 1, 1, 1, 13, 1, 42, ...] with odd period 13 and central term 4. - _Michael Somos_, Apr 03 2014

%t n = 1; t = {}; While[Length[t] < 50, n++; If[! IntegerQ[Sqrt[n]], c = ContinuedFraction[Sqrt[n]]; len = Length[c[[2]]]; If[OddQ[len] && c[[2, (len + 1)/2]] == 4, AppendTo[t, n]]]]; t (* _T. D. Noe_, Apr 03 2014 *)

%t cf4Q[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]] == cf[[(len-1)/2]]==4]; Select[Range[5500],cf4Q] (* _Harvey P. Dale_, Jul 28 2021 *)

%Y Cf. A031404-A031423.

%Y Subsequence of A003814.

%K nonn

%O 1,1

%A _David W. Wilson_

%E a(1) corrected by _T. D. Noe_, Apr 03 2014

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 23 21:13 EDT 2024. Contains 376182 sequences. (Running on oeis4.)