OFFSET
1,1
REFERENCES
Kenneth H. Rosen, Elementary Number Theory and Its Applications, Addison-Wesley, 1984, page 426 (but beware of errors!).
LINKS
T. D. Noe, Table of n, a(n) for n = 1..1000
Mack, Austin and Timothy Sawicki (2012) Pell's Equations Through Dynamical Systems [Broken link?]
FORMULA
see Mack, Austin and Timothy Sawicki(2012)
EXAMPLE
The continued fraction for sqrt(7) is [2;1,1,1,4,...] with period 4, so 7 is in the sequence. The continued fractions sqrt(3) = [1;1,2,...] with period 2 and sqrt(13) = [3;1,1,1,1,6,...] with period 5 do not have period 4, so 3 and 13 are not in the sequence. - Michael B. Porter, Sep 20 2016
MATHEMATICA
cfp4Q[n_]:=Module[{sr=Sqrt[n]}, !IntegerQ[sr]&&Length[ ContinuedFraction[ sr][[2]]]==4]; Select[Range[500], cfp4Q] (* Harvey P. Dale, Jul 29 2014 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved