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.

A099725 a(n) is the number of 1's in the period of the continued fraction of the square root of the n-th nonsquare integer.

This page as a plain text file.
%I A099725 #30 Jul 20 2024 15:45:21
%S A099725 0,1,0,0,3,1,0,0,0,4,2,1,0,0,2,0,4,2,2,1,0,0,0,2,0,4,3,2,2,1,0,0,0,0,
%T A099725 0,0,6,6,2,6,2,1,0,0,2,2,2,0,0,4,6,2,2,4,2,1,0,0,4,0,2,2,2,0,4,4,3,6,
%U A099725 2,2,2,1,0,0,0,2,6,0,3,0,0,5,4,6,8,2,2,8,2,1,0,0,6,0,0,4,2,4,4,0,4,4,6,2,7
%N A099725 a(n) is the number of 1's in the period of the continued fraction of the square root of the n-th nonsquare integer.
%C A099725 For sufficiently large period lengths, the fraction of 1's in the repeating part tends to log(4/3)/log(2) = 0.415... as from the Gauss-Kuzmin distribution, i.e., a(n) tends to 0.415...*A013943(n) for sufficiently large A013943(n). - _A.H.M. Smeets_, Jun 02 2018
%C A099725 The "n-th nonsquare integer" in the definition is A005117(n + 1). - _Michael B. Porter_, Jun 06 2018
%H A099725 A.H.M. Smeets, <a href="/A099725/b099725.txt">Table of n, a(n) for n = 1..10000</a>
%o A099725 (Python)
%o A099725 from math import isqrt
%o A099725 from sympy.ntheory.continued_fraction import continued_fraction_periodic
%o A099725 def A099725(n): return (continued_fraction_periodic(0,1,n+(k:=isqrt(n))+int(n>=k*(k+1)+1))[-1]).count(1) # _Chai Wah Wu_, Jul 20 2024
%Y A099725 Cf. A005117, A013647, A013943.
%K A099725 nonn
%O A099725 1,5
%A A099725 _Benoit Cloitre_, Nov 07 2004