%I #17 Jul 10 2021 19:34:47
%S 19,21,22,45,52,54,57,59,70,77,88,107,111,112,114,117,131,164,165,175,
%T 178,183,187,208,216,221,232,267,270,273,275,278,280,285,294,296,303,
%U 308,350,357,371,372,374,381,387,407,418,437,456,470,498,499,507,510,514,518
%N Numbers k such that the continued fraction for sqrt(k) has period 6.
%C Includes A157265, corresponding to continued fractions [6*k+4,1,1,2,1,1,12*k+8,1,1,2,1,1,12*k+8,...]. - _Robert Israel_, Nov 21 2019
%H Robert Israel, <a href="/A020347/b020347.txt">Table of n, a(n) for n = 1..2500</a>
%e The continued fraction for sqrt(19) is 4 + 1/(2 + 1/(1 + 1/(3 + 1/(1 + 1/(2 + 1/(8 + 1/(2 + 1/(1 + 1/(3 + 1/(1 + 1/(2 + 1/(8 + ..., which has period 6, so 19 is in the sequence.
%e The continued fraction for sqrt(20) is 4 + 1/(2 + 1/(8 + 1/(2 + 1/(8 + 1/(2 + 1/(8 + ..., which has a period of 2, so 20 is not in the sequence.
%p filter:= proc(n)
%p not issqr(n) and nops(numtheory:-cfrac(sqrt(n),periodic,quotients)[2])=6
%p end proc:
%p select(filter, [$1..1000]); # _Robert Israel_, Nov 21 2019
%t Select[Range[500], Length[Last[ContinuedFraction[Sqrt[#]]]] == 6 &] (* _Alonso del Arte_, Mar 04 2018 *)
%Y Cf. A157265.
%K nonn
%O 1,1
%A _David W. Wilson_
|