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.

A059855 Period of continued fraction for sqrt(n^2+4), n >= 1.

This page as a plain text file.
%I A059855 #19 Jul 10 2024 02:57:23
%S A059855 1,2,5,2,5,2,5,2,5,2,5,2,5,2,5,2,5,2,5,2,5,2,5,2,5,2,5,2,5,2,5,2,5,2,
%T A059855 5,2,5,2,5,2,5,2,5,2,5,2,5,2,5,2,5,2,5,2,5,2,5,2,5,2,5,2,5,2,5,2,5,2,
%U A059855 5,2,5,2,5,2,5,2,5,2,5,2,5,2,5,2,5,2,5,2,5,2,5,2,5,2,5,2,5,2,5,2
%N A059855 Period of continued fraction for sqrt(n^2+4), n >= 1.
%C A059855 From _Jianing Song_, May 01 2021: (Start)
%C A059855 The old name was "Quotient cycle length of sqrt(n^2+4)."
%C A059855 Essentially the same as A010695 and A021400. (End)
%H A059855 Amiram Eldar, <a href="/A059855/b059855.txt">Table of n, a(n) for n = 1..10000</a>
%F A059855 a(n) = 2 for even n, a(n) = 5 for odd n > 1.
%F A059855 a(n) = A003285(n^2+4). - _Jianing Song_, May 01 2021
%e A059855 For even n, sqrt(n^2+4) = [n; n/2, 2*n], hence a(n) = 2.
%e A059855 For odd n > 1, sqrt(n^2+4) = [n; (n-1)/2, 1, 1, (n-1)/2, 2*n], hence a(n) = 5.
%p A059855 with(numtheory): [seq(nops(cfrac(sqrt(k^2+4), 'periodic', 'quotients')[2]), k=1..100)];
%t A059855 a[n_] := Length @ ContinuedFraction[Sqrt[n^2 + 4]][[2]]; Array[a, 100] (* _Amiram Eldar_, May 13 2020 *)
%Y A059855 Cf. A003285, A010695, A021400.
%Y A059855 Period of continued fraction for sqrt(n^2+k): A059853 (k=3), this sequence (k=4), A059854 (k=5).
%K A059855 nonn,easy
%O A059855 1,2
%A A059855 _Labos Elemer_, Feb 27 2001