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.

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

This page as a plain text file.
%I A386318 #21 Jul 28 2025 09:00:23
%S A386318 4,9,12,15,16,21,20,27,24,25,28,39,30,45,36,35,36,57,40,63,42,45,52,
%T A386318 75,48,49,60,55,54,93,56,99,60,65,76,63,64,117,84,75,70,129,72,135,78,
%U A386318 77,100,147,80,81,84,95,90,165,88,91,90,105,124,183,96,189,132,99,100,105,104,207
%N A386318 a(n) = the minimum value of (x + 2)*(y + 2) such that x*y = n.
%C A386318 Smallest number of elements in a rectangular array with precisely n interior elements.
%C A386318 If baking square brownies in a rectangular pan, a(n) is the minimum number of brownies required to have precisely n gooey center brownies.
%C A386318 A063655(n) gives the smallest semiperimeter b+d of an integral rectangle with area n = b*d. Here, a(n) = (b+2)(d+2) = n + 2*(A063655(n)) + 4.
%C A386318 a(n) >= A386316(n) since A386316 relaxes the conditions to x*y >= n rather than equality.
%F A386318 a(p) = 3*(p+2) for p prime.
%F A386318 a(n) = (x + 2)*(y + 2) for n = x*y semiprime (a term of A001358).
%F A386318 a(k^2) = (k+2)^2 = A386316(k^2).
%F A386318 a(n) = n + 2*(A063655(n)) + 4.
%e A386318 a(5) = 21 because the 3 X 7 array is the unique array with precisely 5 interior elements.
%e A386318 a(12) = 30 because the 5 X 6 array is the smallest with precisely 12 interior elements (the others being 3 X 14 and 4 X 8).
%t A386318 a[n_] := Min[((# + 2)*(n/# + 2))& /@ Select[Divisors[n], #^2 <= n &]]; Array[a, 100] (* _Amiram Eldar_, Jul 19 2025 *)
%o A386318 (PARI) a(n) = vecmin(apply(x->((x + 2)*(n/x + 2)), divisors(n))); \\ _Michel Marcus_, Jul 19 2025
%o A386318 (Python)
%o A386318 from sympy import divisors
%o A386318 def A386318(n):
%o A386318     if n == 0: return 4
%o A386318     l = len(d:=divisors(n))
%o A386318     return (d[(l-1)>>1]+2)*(d[l>>1]+2) # _Chai Wah Wu_, Jul 27 2025
%Y A386318 Cf. A386316, A063655.
%K A386318 nonn,easy
%O A386318 0,1
%A A386318 _Ben Orlin_, Jul 18 2025