%I M1826 #19 Jan 08 2018 02:38:41
%S 2,8,12,8,16,24,20,32,18,24,40,48,28,48,60,32,32,56,72,80,36,64,84,96,
%T 50,40,72,96,112,120,44,80,108,128,140,72,48,88,120,144,160,168,52,96,
%U 132,160,180,192,98,56,104,144,176,200,216,224,60
%N Frequency of n-th largest distance in N times N grid, N > n.
%D V. Reddy and S. Skiena, Frequencies of large distances in integer lattices, in Graph theory, combinatorics and algorithms, Vol. 1, 2 (Kalamazoo, MI, 1992), 981-989, Wiley-Intersci. Publ., Wiley, New York, 1995.
%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H S. Skiena, <a href="/A007543/a007543.pdf">Email to N. J. A. Sloane, Jun. 1994</a>
%F a(n) = 2 * n if n is a perfect square, otherwise a(n) = 4 * (n - f(n)) * (ceiling(2 * sqrt(n)) - n + f(n)) where f(n) = floor(floor(2 * sqrt(n))^2 / 4) [from Reddy and Skiena]. - _Sean A. Irvine_, Jan 08 2018
%Y Cf. A007544.
%K nonn
%O 1,1
%A _N. J. A. Sloane_
%E More terms from _Sean A. Irvine_, Jan 08 2018