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.

A206582 The least nonsquare number s having exactly n twos in the periodic part of the continued fraction of sqrt(s).

This page as a plain text file.
%I A206582 #13 May 14 2024 00:44:43
%S A206582 5,2,19,45,71,153,199,589,301,989,526,1711,739,1633,631,3886,1324,
%T A206582 4897,2524,7021,2374,4189,2311,10033,3571,3901,2326,8869,4789,10873,
%U A206582 6301,10921,6451,11929,6841,12709,7996,13561,7351,19177,9949,16969,12286,22969,11341
%N A206582 The least nonsquare number s having exactly n twos in the periodic part of the continued fraction of sqrt(s).
%p A206582 V:= Array(0..50):  count:= 0:
%p A206582 with(NumberTheory):
%p A206582 for i from 2 while count < 51 do
%p A206582   if issqr(i) then next fi;
%p A206582   cf:= Term(ContinuedFraction(sqrt(i)),periodic);
%p A206582   v:= numboccur(cf[2],2);
%p A206582   if v <= 50 and V[v] = 0 then
%p A206582     V[v]:= i; count:= count+1;
%p A206582   fi;
%p A206582 od:
%p A206582 convert(V,list); # _Robert Israel_, May 13 2024
%t A206582 nn = 50; zeros = nn; t = Table[0, {nn}]; k = 2; While[zeros > 0, If[! IntegerQ[Sqrt[k]], cnt = Count[ContinuedFraction[Sqrt[k]][[2]], 2]; If[cnt <= nn && t[[cnt]] == 0, t[[cnt]] = k; zeros--]]; k++]; Join[{5}, t]
%Y A206582 Cf. A206578 (n ones), A206583 (n threes), A206584 (n fours), A206585 (n fives).
%K A206582 nonn
%O A206582 0,1
%A A206582 _T. D. Noe_, Mar 19 2012
%E A206582 Corrected by _Robert Israel_, May 13 2024