cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

This page as a plain text file.
%I A096491 #17 Aug 07 2024 15:11:35
%S A096491 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,
%T A096491 10,10,10,10,6,12,12,12,12,12,12,12,12,12,12,12,12,7,14,14,14,14,14,
%U A096491 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
%N 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.
%e A096491 For n=127: the period={3,1,2,2,7,11,7,2,2,1,3,22}, max=a(127)=22.
%p A096491 A096491 := proc(n)
%p A096491 if issqr(n) then
%p A096491 sqrt(n) ;
%p A096491 else
%p A096491 numtheory[cfrac](sqrt(n),'periodic','quotients') ;
%p A096491 %[2] ;
%p A096491 max(op(%)) ;
%p A096491 end if;
%p A096491 end proc:
%p A096491 # _R. J. Mathar_, Mar 18 2010
%t A096491 u=1;Do[s=Max[Last[ContinuedFraction[n^(1/2)]]];tc[[u]]=s;u=u+1, {n, 1, m}]
%Y A096491 Cf. A003285, A013646.
%K A096491 nonn
%O A096491 1,2
%A A096491 _Labos Elemer_, Jun 29 2004
%E A096491 Definition revised by _N. J. A. Sloane_, Mar 18 2010