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 A244658 #22 Feb 16 2025 08:33:23 %S A244658 -1,1,2,-1,1,2,0,4,-1,1,2,3,0,0,6,-1,1,2,0,4,0,0,0,8,-1,1,2,0,0,5,0,0, %T A244658 0,0,10,-1,1,2,3,4,0,6,0,0,0,0,0,12,-1,1,2,0,0,0,0,7,0,0,0,0,0,0,14, %U A244658 -1,1,2,0,4,0,0,0,8,0,0,0,0,0,0,0,16,-1,1,2,3,0,0,6,0,0,9,0,0,0,0,0,0,0,0,18,-1,1,2,0,4,5 %N A244658 a(n) = x/(x1-floor(x1)) where x = sqrt(n) - floor(sqrt(n)), x1 = 1/x, a(n) = -1 if division by zero, a(n) = 0 for nonintegers. %C A244658 Inspired by the square root of three poem in "Harold and Kumar" the movie. This operation can be done in iterations for which some n seem to give all integer results after iteration k >= 2. Some of them have periodic properties similar to that of the continued fraction method (but not exactly the same). When a(n) is arranged as a table read by rows, the row sums would be A062731. See illustrations in links. %H A244658 Kival Ngaokrajang, <a href="/A244658/a244658.pdf">Illustration for n = 1..20 and iteration k = 1..10</a> %H A244658 <a href="/A244658/a244658_1.pdf">a(n) arrange as table for n = 1..168</a> %H A244658 answers.yahoo, <a href="http://answers.yahoo.com/question/index?qid=20080426220447AAmyddH">What are the words to the math poem in "Harold and Kumar"?</a> %H A244658 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PeriodicContinuedFraction.html">Periodic Continued Fraction</a> %e A244658 For n = 3, x = sqrt(3) - floor(sqrt(3)) = 0.732050807..., x1 = 1/x = 1/0.732050807... = 1.366025403..., x1 - floor(x1) = 0.366025403..., a(3) = 0.732050807.../0.366025402... = 2. %o A244658 (Small Basic) %o A244658 For n=1 To 500 %o A244658 x=math.Power(n,.5) %o A244658 y=x-math.Floor(x) %o A244658 If y<>0 Then %o A244658 x1=1/y %o A244658 x2=1/(x1-math.Floor(x1)) %o A244658 a1=x2/x1 %o A244658 a2=a1-math.floor(a1) %o A244658 If a2 > 0.999999 or a2 < 0.0000001 then %o A244658 a=math.Round(a1) %o A244658 TextWindow.Write(a+", ") %o A244658 Else %o A244658 TextWindow.Write(0+", ")'noninteger %o A244658 Endif %o A244658 Else %o A244658 TextWindow.Write(-1+", ")'zero division, Square number %o A244658 EndIf %o A244658 EndFor %Y A244658 Cf. A062731. %K A244658 sign %O A244658 1,3 %A A244658 _Kival Ngaokrajang_, Jul 04 2014