OFFSET
1,1
COMMENTS
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.
LINKS
FORMULA
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) and Volume(N)-N > Volume(N-1)-(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.
EXAMPLE
N Volume
8 8
26 27
34 36
42 45
44 48
54 60
56 64
66 75
68 80
80 96
PROG
(Java)
int lastMax = 0;
int lastGain = -1;
for (int voxels = 8; voxels <= 1000; voxels++)
{
int max = 0;
for (int depth = voxels / 4; depth >= 2; depth--)
{
for (int width = voxels / (2 * depth); width >= 2; width--)
{
int remaining = voxels - 2 * width * depth;
int height = 2 + remaining / (2 * (width - 1 + depth - 1));
int volume = width * depth * height;
if (max < volume)
{
max = volume;
}
}
}
if (lastMax < max)
{
lastMax = max;
int gain = max - voxels;
if (lastGain < gain)
{
lastGain = gain;
System.out.println("%e A166084 " + voxels + " " + max);
}
}
}
CROSSREFS
KEYWORD
nonn
AUTHOR
Mark Jeronimus, Oct 06 2009, Dec 01 2009
EXTENSIONS
Minor edits by N. J. A. Sloane, Dec 05 2009
Long example moved to a file and code indented by Li-yao Xia, Nov 02 2014
STATUS
approved