The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A338785 a(n) is the least number k such that continued fraction for sqrt(prime(k)) has period n. 1
1, 2, 13, 4, 6, 8, 21, 11, 30, 14, 18, 27, 44, 41, 29, 43, 37, 34, 68, 36, 42, 94, 147, 58, 88, 47, 186, 93, 142, 75, 110, 90, 112, 67, 178, 228, 82, 114, 100, 222, 187, 105, 191, 143, 204, 131, 180, 115, 172, 177, 197, 133, 263, 272, 353, 175, 231, 242, 322, 157 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
FORMULA
a(n) = A000720(A059800(n)).
EXAMPLE
sqrt(prime(1)) = sqrt(2) = 1 + 1/(2 + 1/(2 + ...)), period 1.
sqrt(prime(2)) = sqrt(3) = 1 + 1/(1 + 1/(2 + 1/(1 + 1/(2 + ...)))), period 2.
sqrt(prime(13)) = sqrt(41) = 6 + 1/(2 + 1/(2 + 1/(12 + 1/(2 + 1/(2 + 1/(12 + ...)))))), period 3.
MAPLE
N:= 100: # for a(1)..a(N)
A:= Vector(N): count:= 0: p:= 1:
for n from 1 while count < N do
p:= nextprime(p);
v:= nops(numtheory:-cfrac(sqrt(p), periodic, quotients)[2]);
if v <= N and A[v] = 0 then count:= count+1; A[v]:= n; fi
od:
convert(A, list); # Robert Israel, Nov 11 2020
MATHEMATICA
Table[SelectFirst[Range[500], Length[Last[ContinuedFraction[Sqrt[Prime[#]]]]] == n &], {n, 60}]
CROSSREFS
Sequence in context: A286459 A358433 A344540 * A335817 A093079 A095417
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Nov 08 2020
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 June 5 01:34 EDT 2024. Contains 373102 sequences. (Running on oeis4.)