%I #17 Jul 11 2023 15:29:38
%S 8,12,16,18,20,24,27,28,30,32,36,40,45,48,54,60,64,72,75,80,84,90,96,
%T 100,105,112,120,125,128,140,144,150,160,168,175,180,192,200,210,216,
%U 225,240,245,252,256,270,280,288,294,300,315,324,336,343,350,360,378
%N Maximal volume of a closed box created by using at most n voxels as the boundary, skipping values of n for which the volume is the same as for n-1.
%C For example, a 3 X 3 X 3 box can be created by using top and bottom plates of 3 X 3 X 1 voxels, and using 8 voxels to connect them, totaling 26 voxels.
%H Li-yao Xia, <a href="/A166083/a166083.txt">Examples of (N, Volume(N)), N<1000</a>
%F For each N (starting at 8), calculate the max Volume(N)=w*h*d such that (N <= (w*h*d - (w-1)*(h-1)*(d-1)). Keep only those N for which Volume(N)>Volume(N-1). The minimum box is 2 X 2 X 2 voxels to prevent overlapping voxels (multiple voxels occupying the same location in space) or degenerate cases.
%e N Volume
%e 8 8
%e 12 12
%e 16 16
%e 18 18
%e 20 20
%e 24 24
%e 26 27
%e 28 28
%e 30 30
%e 32 32
%o (Java)
%o int lastMax = 0;
%o for (int voxels = 8; voxels <= 1000; voxels++) {
%o int max = 0;
%o for (int depth = voxels / 4; depth >= 2; depth--) {
%o for (int width = voxels / (2 * depth); width >= 2; width--) {
%o int remaining = voxels - 2 * width * depth;
%o int height = 2 + remaining / (2 * (width - 1 + depth - 1));
%o int volume = width * depth * height;
%o if (max < volume) {
%o max = volume;
%o }
%o }
%o }
%o if (lastMax < max) {
%o lastMax = max;
%o System.out.println(voxels + " " + max);
%o }
%o }
%Y Cf. A166082 (full sequence without conditions), A166084 (sequence where the enclosed empty space must increase).
%K nonn
%O 1,1
%A _Mark Jeronimus_, Oct 06 2009, Dec 01 2009
%E Minor edits by _N. J. A. Sloane_, Dec 05 2009