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!)
A087060 Difference between 2n^2 and the nearest square number. 7

%I #13 Jul 01 2017 10:52:37

%S 1,1,2,4,1,8,2,7,7,4,14,1,14,8,9,17,2,23,7,16,18,7,31,4,25,17,14,32,1,

%T 36,14,23,31,8,49,9,34,28,17,49,2,47,23,28,46,7,62,16,41,41,18,68,7,

%U 56,34,31,63,4,73,25,46,56,17,89,14,63,47,32,82,1,82,36,49,73,14,103,23,68

%N Difference between 2n^2 and the nearest square number.

%C max(a(n)/n) approaches sqrt(2), and the indices of the maxima are apparently in A227792. - _Ralf Stephan_, Sep 23 2013

%H Alois P. Heinz, <a href="/A087060/b087060.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = min [A087056(n), A087059(n)] = min [2*n^2 - (floor[n*sqrt(2)])^2, (1 + floor[n*sqrt(2)])^2 - 2*n^2]

%e a(10) = 4 because the difference between 2*10^2 = 200 and the nearest square number (196) is 4.

%t 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 *)

%Y Cf. A001951, A087055, A087056, A087057, A087058, A087059.

%K easy,nonn,look

%O 1,3

%A _Jens Voß_, Aug 07 2003

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 2 10:17 EDT 2024. Contains 373038 sequences. (Running on oeis4.)