
EXAMPLE

For n=239 the quotient periods are: [[15],[2,5,1,2,4,15,4,2,1,5,2,30]], (1/2)+(1/5)+1+(1/2)+(1/4)+(1/15)+(1/4)+(1/2)+1+(1/5)+(1/2)+(1/30) = 5.


MATHEMATICA

Do[ If[ IntegerQ[ Apply[ Plus, 1/Last[ ContinuedFraction[ Sqrt[n]]]]], Print[n]], {n, 2, 10^5 } ]
