OFFSET
1,1
COMMENTS
For n >= 2, a(n) is also the smallest absolute value of all negative values in row n of the triangle D(n, m) = n^2 - m^2 - 2*n*m, for 2 <= m + 1 <= n. The negative values in row n start with m = floor(n/(1 + sqrt(2))) + 1 = ceiling(n/(1 + sqrt(2))). See also a comment on A087056 for the smallest positive numbers in row n >= 3. - Wolfdieter Lang, Jun 11 2015
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
FORMULA
a(n) = A087058(n) - 2*n^2 = A087057(n)^2 - 2*n^2 = (1 + A001951(n))^2 - 2*n^2 = (1 + floor(n*sqrt(2)))^2 - 2*n^2.
a(n) = 2*c(n)^2 - (n - c(n))^2, with c(n) := ceiling(n/(1 + sqrt(2))), n >= 1. - Wolfdieter Lang, Jun 11 2015
EXAMPLE
a(10) = 25 because the difference between 2*10^2 = 200 and the next greater square number (225) is 25.
MATHEMATICA
(Floor[Sqrt[#]]+1)^2-#&/@Table[2n^2, {n, 80}] (* Harvey P. Dale, Jan 15 2023 *)
PROG
(PARI) a(n) = (1 + sqrtint(2*n^2))^2 - 2*n^2 \\ Michel Marcus, Jun 25 2013
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Jens Voß, Aug 07 2003
STATUS
approved