In the middle of the 18th century, King Frederick the Great of Prussia became interested in creating a lottery to raise money. As was his custom when mathematical matters were involved, he called upon Leonhard Euler for counsel.