OFFSET
1,2
LINKS
Robert Israel, Table of n, a(n) for n = 1..1000
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
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Nov 08 2020
STATUS
approved