A

# wheat and chessboard problem

According to one myth, chess was invented by Grand Vizier Sissa Ben Dahir and then given to King Shirham of India. The king was so pleased that he offered his subject a great reward in gold, but the wily vizier said that he would be happy merely to have some wheat: one grain for the first square of the chessboard, two grains for the second square, four for the third, and so on, doubling each time. The king thought this a very modest request, granted it, and asked for a bag of wheat to be brought in. However the bag was emptied by the 20th square. The king asked for another bag, but then realized that this entire bag was needed for the next square. In 20 more squares, as many bags would have been exhausted as there were grains in the first bag! The number of grains on the 64th square would have been 263, and the total for the whole board

264 - 1 = 18,446,744,073,709,551,615.

This is more wheat than in the entire whole world; in fact, it would fill a building 40 km long, 40 km wide, and 300 meters tall.