The problem of close-packing of spheres was first mathematically analyzed by Thomas Harriot around 1587, after a question on piling cannonballs on ships was posed to him by Sir Walter Raleigh on their expedition to America. 
Cannonballs were usually piled in a rectangular or triangular wooden frame, forming a three-sided or four-sided pyramid. Both arrangements produce a face-centered cubic lattice – with different orientation to the ground.  Hexagonal close-packing would result in a six-sided pyramid with a hexagonal base. 
The cannonball problem asks which flat square arrangements of cannonballs can be stacked into a square pyramid. Édouard Lucas formulated the problem as the Diophantine equation  or  and conjectured that the only solutions are  and . Here  is the number of layers in the pyramidal stacking arrangement and  is the number of cannonballs along an edge in the flat square arrangement.