OFFSET
1,1
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
FORMULA
It seems that lim_{n->infinity} a(n)/n = 0. - Benoit Cloitre, Apr 19 2003
a(n) = 2*A000006(n). - Benoit Cloitre, Apr 19 2003
EXAMPLE
n=31: prime(31) = 127, and the periodic part is {3,1,2,2,7,11,7,2,2,1,3,22}, so a(31)=22.
MAPLE
A096491 := proc(n)
if issqr(n) then
sqrt(n) ;
else
numtheory[cfrac](sqrt(n), 'periodic', 'quotients') ;
%[2] ;
max(op(%)) ;
end if;
end proc:
A096494 := proc(n)
option remember ;
A096491(ithprime(n)) ;
end proc: # R. J. Mathar, Mar 18 2010
MATHEMATICA
{te=Table[0, {m}], u=1}; Do[s=Max[Last[ContinuedFraction[Prime[n]^(1/2)]]]; te[[u]]=s; u=u+1, {n, 1, m}]; te
a[n_]:=IntegerPart[Sqrt[Prime[n]]] 2 IntegerPart[Sqrt[#]]&/@Prime[Range[90]] (* Vincenzo Librandi, Aug 09 2015 *)
PROG
(Haskell)
a096494 = (* 2) . a000006 -- Reinhard Zumkeller, Sep 20 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, Jun 29 2004
STATUS
approved