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
Michel Marcus, Table of n, a(n) for n = 1..10000
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
KEYWORD
sign
AUTHOR
Sebastian F. Orellana, Sep 29 2019
STATUS
approved