OFFSET
1,3
COMMENTS
max(a(n)/n) approaches sqrt(2), and the indices of the maxima are apparently in A227792. - Ralf Stephan, Sep 23 2013
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000
FORMULA
EXAMPLE
a(10) = 4 because the difference between 2*10^2 = 200 and the nearest square number (196) is 4.
MATHEMATICA
dnsn[n_]:=Module[{c=2n^2, a, b}, a=Floor[Sqrt[c]]^2; b=Ceiling[Sqrt[c]]^2; Min[c-a, b-c]]; Array[dnsn, 80] (* Harvey P. Dale, Jul 01 2017 *)
CROSSREFS
KEYWORD
AUTHOR
Jens Voß, Aug 07 2003
STATUS
approved