OFFSET
0,1
MATHEMATICA
nn = 50; zeros = nn; t = Table[0, {nn}]; k = 2; While[zeros > 0, If[! IntegerQ[Sqrt[k]], cnt = Count[ContinuedFraction[Sqrt[k]][[2]], 4]; If[cnt <= nn && t[[cnt]] == 0, t[[cnt]] = k; zeros--]]; k++]; Join[{2}, t]
With[{tbl=Table[{n, Count[If[IntegerQ[Sqrt[n]], {1}, ContinuedFraction[Sqrt[n]][[2]]], 4]}, {n, 2, 110000}]}, Table[SelectFirst[tbl, #[[2]]==k&], {k, 0, 40}]][[All, 1]] (* Harvey P. Dale, Oct 05 2022 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
T. D. Noe, Mar 19 2012
STATUS
approved