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!)
A096491 a(n) = sqrt(n) of n if n is a perfect square, otherwise a(n) = largest term in period of continued fraction expansion of square root of n. 7
1, 2, 2, 2, 4, 4, 4, 4, 3, 6, 6, 6, 6, 6, 6, 4, 8, 8, 8, 8, 8, 8, 8, 8, 5, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 6, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 7, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 8, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
EXAMPLE
n=127: the period={3,1,2,2,7,11,7,2,2,1,3,22}, max=a[127]=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:
# R. J. Mathar, Mar 18 2010
MATHEMATICA
u=1; Do[s=Max[Last[ContinuedFraction[n^(1/2)]]]; tc[[u]]=s; u=u+1, {n, 1, m}]
CROSSREFS
Sequence in context: A087627 A195051 A219654 * A217871 A362872 A306390
KEYWORD
cofr,nonn
AUTHOR
Labos Elemer, Jun 29 2004
EXTENSIONS
Definition revised by N. J. A. Sloane, Mar 18 2010
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 18 18:58 EDT 2024. Contains 371781 sequences. (Running on oeis4.)