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.

Showing 1-1 of 1 results.

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

Original entry on oeis.org

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, 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, 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
Offset: 1

Views

Author

Labos Elemer, Feb 27 2001

Keywords

Comments

From Jianing Song, May 01 2021: (Start)
The old name was "Quotient cycle length of sqrt(n^2+4)."
Essentially the same as A010695 and A021400. (End)

Examples

			For even n, sqrt(n^2+4) = [n; n/2, 2*n], hence a(n) = 2.
For odd n > 1, sqrt(n^2+4) = [n; (n-1)/2, 1, 1, (n-1)/2, 2*n], hence a(n) = 5.
		

Crossrefs

Period of continued fraction for sqrt(n^2+k): A059853 (k=3), this sequence (k=4), A059854 (k=5).

Programs

  • Maple
    with(numtheory): [seq(nops(cfrac(sqrt(k^2+4), 'periodic', 'quotients')[2]), k=1..100)];
  • Mathematica
    a[n_] := Length @ ContinuedFraction[Sqrt[n^2 + 4]][[2]]; Array[a, 100] (* Amiram Eldar, May 13 2020 *)

Formula

a(n) = 2 for even n, a(n) = 5 for odd n > 1.
a(n) = A003285(n^2+4). - Jianing Song, May 01 2021
Showing 1-1 of 1 results.