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.

Original entry on oeis.org

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

Views

Author

Ben Orlin, Jul 18 2025

Keywords

Comments

Smallest number of elements in a rectangular array with at least n interior elements.
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.
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.
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.

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
    

Formula

a(k^2) = (k+2)^2 = A386318(k^2).
a(k^2 - 1) = (k+1)(k+3) = A386318(k^2 - 1).