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.
%I A276689 #26 Aug 02 2017 16:33:04 %S A276689 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, %T A276689 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, %U A276689 1,4,1,1,1,2,1,1,1,1,1,1,1,1,0,18,9,6,1 %N A276689 Least term in the periodic part of the continued fraction expansion of sqrt(n) or 0 if n is square. %C A276689 If r > 0 is even, then a((rm/2)^2+m) = r for all m >= 1 and a((r^2-2)^2/4 + (r+1)^3) = r. %C A276689 If r is odd, then a((rm)^2+2m) = r for all m >= 1 and a(r^4 + r^3 + 5(r+1)^2/4) = r. %H A276689 Chai Wah Wu, <a href="/A276689/b276689.txt">Table of n, a(n) for n = 0..10000</a> %o A276689 (Python) %o A276689 from sympy import continued_fraction_periodic %o A276689 def A276689(n): %o A276689 x = continued_fraction_periodic(0,1,n) %o A276689 return min(x[1]) if len(x) > 1 else 0 %Y A276689 Cf. A031424, A003285, A091453, A096491. %K A276689 nonn %O A276689 0,3 %A A276689 _Chai Wah Wu_, Sep 28 2016