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 A013943 #35 Feb 16 2025 08:32:32 %S A013943 1,2,1,2,4,2,1,2,2,5,4,2,1,2,6,2,6,6,4,2,1,2,4,5,2,8,4,4,4,2,1,2,2,2, %T A013943 3,2,10,8,6,12,4,2,1,2,6,5,6,4,2,6,7,6,4,11,4,2,1,2,10,2,8,6,8,2,7,5, %U A013943 4,12,6,4,4,2,1,2,2,5,10,2,6,5,2,8,8,10,16,4,4,11,4,2,1,2,12,2,2,9,6,8,15,2,6,6 %N A013943 Period of continued fraction for sqrt(m), m = n-th nonsquare. %H A013943 Ray Chandler, <a href="/A013943/b013943.txt">Table of n, a(n) for n = 1..10000</a> (first 1000 terms from Vincenzo Librandi) %H A013943 Kival Ngaokrajang, <a href="/A013943/a013943_1.pdf">Illustration of initial terms, periodic are colored</a>. %H A013943 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/ContinuedFraction.html">Continued Fraction</a>. %t A013943 nonSquares = Select[Range[120], !IntegerQ[Sqrt[#]]&]; a[n_] := Length[ Last[ ContinuedFraction[ Sqrt[ nonSquares[[n]] ]]]]; Table[a[n], {n, 1, Length[nonSquares]}] (* _Jean-François Alcover_, May 27 2013 *) %o A013943 (Python) %o A013943 from math import isqrt %o A013943 from sympy.ntheory.continued_fraction import continued_fraction_periodic %o A013943 def A013943(n): return len(continued_fraction_periodic(0,1,n+(k:=isqrt(n))+int(n>=k*(k+1)+1))[-1]) # _Chai Wah Wu_, Jul 20 2024 %Y A013943 Cf. A003285, A035015. %K A013943 nonn,easy %O A013943 1,2 %A A013943 _Clark Kimberling_