A276689 Least term in the periodic part of the continued fraction expansion of sqrt(n) or 0 if n is square.
0, 0, 2, 1, 0, 4, 2, 1, 1, 0, 6, 3, 2, 1, 1, 1, 0, 8, 4, 1, 2, 1, 1, 1, 1, 0, 10, 5, 2, 1, 2, 1, 1, 1, 1, 1, 0, 12, 6, 4, 3, 2, 2, 1, 1, 1, 1, 1, 1, 0, 14, 7, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 0, 16, 8, 1, 4, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 0, 18, 9, 6, 1
Offset: 0
Keywords
Links
- Chai Wah Wu, Table of n, a(n) for n = 0..10000
Programs
-
Python
from sympy import continued_fraction_periodic def A276689(n): x = continued_fraction_periodic(0,1,n) return min(x[1]) if len(x) > 1 else 0
Comments