login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A096492
Number of distinct terms in continued fraction period of square root of n.
4
1, 1, 2, 1, 1, 2, 2, 2, 1, 1, 2, 2, 2, 3, 2, 1, 1, 2, 4, 2, 3, 4, 3, 2, 1, 1, 2, 3, 3, 2, 4, 2, 3, 3, 2, 1, 1, 2, 2, 2, 2, 2, 4, 3, 3, 5, 3, 2, 1, 1, 2, 4, 3, 4, 2, 2, 3, 2, 4, 3, 5, 3, 2, 1, 1, 2, 5, 2, 4, 3, 4, 2, 3, 2, 2, 5, 4, 3, 3, 2, 1, 1, 2, 2, 3, 4, 2, 3, 3, 2, 3, 4, 4, 6, 3, 3, 3, 3, 2, 1, 1, 2, 5, 2, 2
OFFSET
1,3
COMMENTS
Essentially the same as A028832. - Amiram Eldar, Nov 10 2021
FORMULA
a(n) = 1 if n is a square and a(n) = A028832(n) otherwise. - Amiram Eldar, Nov 10 2021
EXAMPLE
n=127: the period={3,1,2,2,7,11,7,2,2,1,3,22},distinct-terms={1,2,3,7,11,22}, so a[127]=6;
MATHEMATICA
{tc=Table[0, {m}], u=1}; Do[s=Length[Union[Last[ContinuedFraction[n^(1/2)]]]]; tc[[u]]=s; u=u+1, {n, 1, m}], tc
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, Jun 29 2004
STATUS
approved