011 Equal spheres piled to form a pyramid

Example 011
A layer of equal spheres is in the form of a square. The spheres are arranged so that each sphere is tangent to every one adjacent to it. In the spaces between sets of 4 adjacent spheres, other spheres rest, equal in size to the original. These spheres form in turn a second layer on top of the first. Successive layers of this sort form a pyramidal pile with a single sphere resting on top. If the bottom layer contains 16 spheres, what is the height of the pile in terms of the common radius r of the spheres?
 

Solution 011