OFFSET
1,1
EXAMPLE
13 is a term because the continued fraction for sqrt(13) is (3;1,1,1,1,6,1,1,1,1,6,...), whose periodic part is (1,1,1,1,6); its length (the period) is 5 (a prime).
MATHEMATICA
Select[Range@200, PrimeQ@Length@Last@ContinuedFraction[Sqrt[#]]&]
PROG
(PARI) isokf(n, p) = {localprec(p); my(cf = contfrac(sqrt(n))); setsearch(Set(cf), 2*cf[1]); }
f(n) = {if (issquare(n), 0, my(p=100); while (! isokf(n, p), p+=100); localprec(p); my(cf = contfrac(sqrt(n))); for (k=2, #cf, if (cf[k] == 2*cf[1], return (k-1))); ); } \\ A003285
isok(k) = isprime(f(k)); \\ Michel Marcus, Jan 05 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Giorgos Kalogeropoulos, Jan 04 2022
STATUS
approved