cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A206587 Numbers k such that the periodic part of the continued fraction of sqrt(k) has even length.

This page as a plain text file.
%I A206587 #14 Jul 12 2021 02:03:40
%S A206587 1,3,4,6,7,8,9,11,12,14,15,16,18,19,20,21,22,23,24,25,27,28,30,31,32,
%T A206587 33,34,35,36,38,39,40,42,43,44,45,46,47,48,49,51,52,54,55,56,57,59,60,
%U A206587 62,63,64,66,67,68,69,70,71,72,75,76,77,78,79,80,81,83,84
%N A206587 Numbers k such that the periodic part of the continued fraction of sqrt(k) has even length.
%C A206587 This is A206586 and the squares, A000290.
%H A206587 T. D. Noe, <a href="/A206587/b206587.txt">Table of n, a(n) for n = 1..1000</a>
%t A206587 Select[Range[100], IntegerQ[Sqrt[#]] || EvenQ[Length[ContinuedFraction[Sqrt[#]][[2]]]] &]
%o A206587 (PARI)
%o A206587 cyc(cf) = {
%o A206587   if(#cf==1, return([])); \\ There is no cycle
%o A206587   my(s=[]);
%o A206587   for(k=2, #cf,
%o A206587     s=concat(s, cf[k]);
%o A206587     if(cf[k]==2*cf[1], return(s)) \\ Cycle found
%o A206587   );
%o A206587   0 \\ Cycle not found
%o A206587 }
%o A206587 select(n->#cyc(contfrac(sqrt(n)))%2==0, vector(400, n, n)) \\ _Colin Barker_, Oct 19 2014
%Y A206587 Cf. A003814 (period has odd length).
%Y A206587 Cf. A000290, A206586.
%K A206587 nonn
%O A206587 1,2
%A A206587 _T. D. Noe_, Mar 20 2012