The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A327898 a(n) is the nearest integer to the reciprocal of the difference between the square root of n and the nearest integer to this square root unless n is a perfect square, in which case a(n) equals 0. 2
0, 2, -4, 0, 4, 2, -3, -6, 0, 6, 3, 2, -3, -4, -8, 0, 8, 4, 3, 2, -2, -3, -5, -10, 0, 10, 5, 3, 3, 2, -2, -3, -4, -6, -12, 0, 12, 6, 4, 3, 2, 2, -2, -3, -3, -5, -7, -14, 0, 14, 7, 5, 4, 3, 2, 2, -2, -3, -3, -4, -5, -8, -16, 0, 16, 8, 5, 4, 3, 3, 2, 2, -2, -3 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
If n is a perfect square, i.e., 1, 4, 9, or 16, then the computation is not possible and a(n) is given as 0.
LINKS
FORMULA
a(n) = round(1/(sqrt(n)-round(sqrt(n)))) for n not a square; a(n) = 0 otherwise.
MATHEMATICA
Array[If[IntegerQ@ #2, 0, Round[1/(#2 - Round[#2])]] & @@ {#, Sqrt@ #} &, 64] (* Michael De Vlieger, Sep 29 2019 *)
PROG
(PARI) a(n)={if(issquare(n), 0, my(t=sqrt(n)); round(1/(t-round(t))))} \\ Andrew Howroyd, Sep 30 2019
CROSSREFS
Cf. A000290 (squares), A013942, A091453 (if floor is used instead of round).
Sequence in context: A338475 A134352 A152648 * A140875 A364315 A115368
KEYWORD
sign
AUTHOR
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 June 4 22:04 EDT 2024. Contains 373102 sequences. (Running on oeis4.)