cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A386316 a(n) = the minimum value of (x + 2)*(y + 2) such that x*y >= n.

This page as a plain text file.
%I A386316 #24 Aug 04 2025 00:09:39
%S A386316 4,9,12,15,16,20,20,24,24,25,28,30,30,35,35,35,36,40,40,42,42,45,48,
%T A386316 48,48,49,54,54,54,56,56,60,60,63,63,63,64,70,70,70,70,72,72,77,77,77,
%U A386316 80,80,80,81,84,88,88,88,88,90,90,96,96,96,96,99,99,99,100,104,104,108
%N A386316 a(n) = the minimum value of (x + 2)*(y + 2) such that x*y >= n.
%C A386316 Smallest number of elements in a rectangular array with at least n interior elements.
%C A386316 If baking square brownies in a rectangular pan, a(n) is the minimum number of brownies required to have at least n gooey center brownies.
%C A386316 a(n) = the minimum of A386318(m) for m >= n. If n < k^2, then the value of m that achieves this minimum is also strictly less than k^2.
%C A386316 Conjecture: As n grows, the length of the longest run grows without bound. The first run of length 50 begins at a(506269) = 509120. Up to 10^6 terms, the longest runs are of length 59.
%F A386316 a(k^2) = (k+2)^2 = A386318(k^2).
%F A386316 a(k^2 - 1) = (k+1)(k+3) = A386318(k^2 - 1).
%e A386316 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.
%t A386316 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 *)
%o A386316 (Python)
%o A386316 import math
%o A386316 def a(n):
%o A386316     if n == 0: return 4
%o A386316     min_val = 3*(n+2)
%o A386316     for x in range(1, math.isqrt(n)+1):
%o A386316         y = (n + x - 1) // x
%o A386316         if (x + 2) * (y + 2) < min_val:
%o A386316                 min_val = (x + 2) * (y + 2)
%o A386316     return min_val
%o A386316 (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
%Y A386316 Cf. A386318.
%K A386316 nonn,easy
%O A386316 0,1
%A A386316 _Ben Orlin_, Jul 18 2025