OFFSET
1,1
COMMENTS
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
LINKS
Robert Israel, Table of n, a(n) for n = 1..2500
EXAMPLE
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.
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.
MAPLE
filter:= proc(n)
not issqr(n) and nops(numtheory:-cfrac(sqrt(n), periodic, quotients)[2])=6
end proc:
select(filter, [$1..1000]); # Robert Israel, Nov 21 2019
MATHEMATICA
Select[Range[500], Length[Last[ContinuedFraction[Sqrt[#]]]] == 6 &] (* Alonso del Arte, Mar 04 2018 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved