login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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. 2
-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, 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, -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 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
COMMENTS
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.
LINKS
Eric Weisstein's World of Mathematics, Periodic Continued Fraction
EXAMPLE
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.
PROG
(Small Basic)
For n=1 To 500
x=math.Power(n, .5)
y=x-math.Floor(x)
If y<>0 Then
x1=1/y
x2=1/(x1-math.Floor(x1))
a1=x2/x1
a2=a1-math.floor(a1)
If a2 > 0.999999 or a2 < 0.0000001 then
a=math.Round(a1)
TextWindow.Write(a+", ")
Else
TextWindow.Write(0+", ")'noninteger
Endif
Else
TextWindow.Write(-1+", ")'zero division, Square number
EndIf
EndFor
CROSSREFS
Cf. A062731.
Sequence in context: A088226 A344309 A358338 * A117586 A307988 A268917
KEYWORD
sign
AUTHOR
Kival Ngaokrajang, Jul 04 2014
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 9 05:44 EDT 2024. Contains 372344 sequences. (Running on oeis4.)