OFFSET
1,2
LINKS
T. D. Noe, Table of n, a(n) for n = 1..1000
MATHEMATICA
Select[Range[100], IntegerQ[Sqrt[#]] || EvenQ[Length[ContinuedFraction[Sqrt[#]][[2]]]] &]
PROG
(PARI)
cyc(cf) = {
if(#cf==1, return([])); \\ There is no cycle
my(s=[]);
for(k=2, #cf,
s=concat(s, cf[k]);
if(cf[k]==2*cf[1], return(s)) \\ Cycle found
);
0 \\ Cycle not found
}
select(n->#cyc(contfrac(sqrt(n)))%2==0, vector(400, n, n)) \\ Colin Barker, Oct 19 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
T. D. Noe, Mar 20 2012
STATUS
approved