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.

A097853 Period of continued fraction for square root of n (or 1 if n is a square).

This page as a plain text file.
%I A097853 #13 Jan 09 2025 09:22:08
%S A097853 1,1,2,1,1,2,4,2,1,1,2,2,5,4,2,1,1,2,6,2,6,6,4,2,1,1,2,4,5,2,8,4,4,4,
%T A097853 2,1,1,2,2,2,3,2,10,8,6,12,4,2,1,1,2,6,5,6,4,2,6,7,6,4,11,4,2,1,1,2,
%U A097853 10,2,8,6,8,2,7,5,4,12,6,4,4,2,1,1,2,2,5,10,2,6,5,2,8,8,10,16,4,4,11,4,2,1,1,2,12
%N A097853 Period of continued fraction for square root of n (or 1 if n is a square).
%e A097853 1 is a square. 2 has continued fraction [1;2,2,2...], 3 has [1;1,2,1,2,1,2...]. - _Georg Fischer_, Jun 14 2019
%p A097853 a:= n-> `if`(issqr(n), 1, nops(numtheory[cfrac](
%p A097853          sqrt(n), 'periodic', 'quotients')[2])):
%p A097853 seq(a(n), n=1..120);  # _Alois P. Heinz_, Jun 14 2019
%t A097853 a[n_] := If[IntegerQ[Sqrt[n]], 1, Length[ContinuedFraction[Sqrt[n]][[2]]]];
%t A097853 Table[a[n], {n, 1, 103}] (* _Jean-François Alcover_, Jan 09 2025 *)
%Y A097853 See A003285, which is the main entry for this sequence.
%K A097853 nonn,easy
%O A097853 1,3
%A A097853 _N. J. A. Sloane_, Sep 01 2004