# Packing cannonballs in a tetrahedron

I have a somewhat interesting problem. Assume one has a tower of cannonballs, or spheres as pictured below

As in you have a tower of spheres where the first layer has $1$ cannonball, the next layer has $3$ cannonballs, and the $n$th layer has $n(n+1)/2$ cannonballs. Every ball is identical and has a radius of $r$. Now the problem is.

What is the smallest tetrahedron that can enclose this pyramid?

I gave it a few attempts, but they all turned out to be futile.

-
I guess the height would be linear on the number of layers in some way. So for 1 cannonball, it's $2r$. For four cannonballs it's $2r +s$ for some $s < 2r$. Then each consecutive layer should add $s$ to the height. Once you have the height it's easy trigonometry to find the side. The trouble, of course, is to find $s$. –  Arthur Sep 17 '12 at 14:34

Consider a tetrahedron $T$ that contains only the centers of all the spheres. This tetrahedron has an edge length of $a = 2r(n-1)$ and a height of $h = \frac{\sqrt{6}}{3}a$. We now want to shift all sides by $r$ so that the spheres are contained. Notice that this operation does not move the center of $T$. Distance from the center of $T$ to its side is $\frac{h}{4}$ and it will be $\frac{h}{4}+r$ after shifting. Thus the new height $h' = h+4r$ and the new edge $$a' = \frac{3}{\sqrt{6}}h' = 2r(n-1)+2\sqrt{6}r$$.
This is somewhat a convoluted method. The result is the edge of tetrahedron enclosing one sphere plus the lengths of gaps between $n$ spheres. To see it intuitively, take the corner spheres, draw lines from their centers perpendicular to nearby walls and edges and cut along those lines. Notice that from the peaces cut off, a tetrahedron with one sphere can be formed.
Doesn't that follow from the construction? By symmetry, the center of the smallest such tetrahedron $S$ is the center of $T$. Thus $S$ can be obtained by shifting walls of $T$ (scaling, in other words). Clearly, if the walls are moved by less than $r$, the balls are not contained. –  Karolis Juodelė Sep 18 '12 at 11:50