OFFSET
1,5
COMMENTS
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
The "n-th nonsquare integer" in the definition is A005117(n + 1). - Michael B. Porter, Jun 06 2018
LINKS
A.H.M. Smeets, Table of n, a(n) for n = 1..10000
PROG
(Python)
from math import isqrt
from sympy.ntheory.continued_fraction import continued_fraction_periodic
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
CROSSREFS
KEYWORD
nonn
AUTHOR
Benoit Cloitre, Nov 07 2004
STATUS
approved