A386316 a(n) = the minimum value of (x + 2)*(y + 2) such that x*y >= n.
4, 9, 12, 15, 16, 20, 20, 24, 24, 25, 28, 30, 30, 35, 35, 35, 36, 40, 40, 42, 42, 45, 48, 48, 48, 49, 54, 54, 54, 56, 56, 60, 60, 63, 63, 63, 64, 70, 70, 70, 70, 72, 72, 77, 77, 77, 80, 80, 80, 81, 84, 88, 88, 88, 88, 90, 90, 96, 96, 96, 96, 99, 99, 99, 100, 104, 104, 108
Offset: 0
Examples
a(5) = a(6) = 20 because the 4 X 5 array is the smallest with at least 5 interior elements, and the smallest with at least 6 interior elements.
Crossrefs
Cf. A386318.
Programs
-
Mathematica
Table[Minimize[{(x+2)(y+2), x y >= n && x>=0 && y>=0}, {x,y}, Integers][[1]], {n, 0, 67}] (* Giovanni Resta, Jul 21 2025 *)
-
PARI
a(n) = my(m=oo, mm); for (x=0, n, for (y=0, n, if ((x*y >= n) && (mm=(x + 2)*(y + 2)) <= m, m = mm););); m; \\ Michel Marcus, Jul 21 2025
-
Python
import math def a(n): if n == 0: return 4 min_val = 3*(n+2) for x in range(1, math.isqrt(n)+1): y = (n + x - 1) // x if (x + 2) * (y + 2) < min_val: min_val = (x + 2) * (y + 2) return min_val
Comments