login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A206582
The least nonsquare number s having exactly n twos in the periodic part of the continued fraction of sqrt(s).
4
5, 2, 19, 45, 71, 153, 199, 589, 301, 989, 526, 1711, 739, 1633, 631, 3886, 1324, 4897, 2524, 7021, 2374, 4189, 2311, 10033, 3571, 3901, 2326, 8869, 4789, 10873, 6301, 10921, 6451, 11929, 6841, 12709, 7996, 13561, 7351, 19177, 9949, 16969, 12286, 22969, 11341
OFFSET
0,1
MAPLE
V:= Array(0..50): count:= 0:
with(NumberTheory):
for i from 2 while count < 51 do
if issqr(i) then next fi;
cf:= Term(ContinuedFraction(sqrt(i)), periodic);
v:= numboccur(cf[2], 2);
if v <= 50 and V[v] = 0 then
V[v]:= i; count:= count+1;
fi;
od:
convert(V, list); # Robert Israel, May 13 2024
MATHEMATICA
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]
CROSSREFS
Cf. A206578 (n ones), A206583 (n threes), A206584 (n fours), A206585 (n fives).
Sequence in context: A356330 A306198 A327316 * A276533 A303685 A189746
KEYWORD
nonn
AUTHOR
T. D. Noe, Mar 19 2012
EXTENSIONS
Corrected by Robert Israel, May 13 2024
STATUS
approved