login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A350546 Numbers k such that the period of the continued fraction for sqrt(k) is a prime. 0
3, 6, 8, 11, 12, 13, 15, 18, 20, 24, 27, 29, 30, 35, 38, 39, 40, 41, 42, 48, 51, 53, 56, 58, 61, 63, 66, 68, 72, 73, 74, 80, 83, 84, 85, 87, 89, 90, 97, 99, 102, 104, 105, 110, 120, 123, 125, 130, 132, 143, 146, 147, 148, 150, 152, 156, 157, 168, 171, 173, 182, 185, 193, 195, 198, 200 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
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
Sequence in context: A294086 A350159 A308221 * A277732 A026604 A013642
KEYWORD
nonn
AUTHOR
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 03:08 EDT 2024. Contains 371918 sequences. (Running on oeis4.)