A question posed by Sir Walter Raleigh about cannonballs inadvertently led to a puzzle that mathematicians have been trying to solve for centuries