Ambition

Ambition

Long, long ago in an ancient land, there lived a very wise man who happened to be the Vizier at the court of a great Sultan.

Months and years passed by and the great Sultan died, and his young prince replaced him. Being young, the prince lacked experience. He started spending more than his father used to. The wise Vizier decided to teach the brash prince a lesson!

The prince set a contest and as a reward, decided to give the winner whatever he wished, boasting of his wealth, being under the illusion that his wealth was virtually endless. The Vizier won, and asked the prince for the prize: a single grain of wheat and a chessboard!

“What?! Just a grain of wheat! Are you insulting my wealth?” yelled the prince.

“No! Your majesty!” The Vizier explained. “You have to promise to double that grain of wheat until the chessboard is full. On the first day, you give me one grain of wheat on the first square of the chessboard, on the second day you double it on the second square (giving me two grains), on the third, you double that on the third square (giving me four grains), and so on, until the sixty-fourth square on the chessboard.”

“You being so smart, I would have thought you would ask for something more substantial”, the young prince said. “Anyway, if this is your wish I will grant you that.”

And so, on the second day, the Vizier got 2 grains, on the third, he got 4 grains, and the young prince couldn't help making fun of the Vizier.

By the sixth day, the Vizier got 32 grains of wheat. By the eighth day and the end of the first row, he got a mere 128 grains. By the sixteenth day and the end of the second row, he got 32,768 grains.

Where was this leading to? Was it worth it for the Vizier?

By the end of the game (it was a mind game, wasn't it?) can you guess how many grains the Vizier would get in all?

The prince could not provide enough grains to give the Vizier a chessboard's worth of grains. Why? Study the progress of the number of grains on the individual squares and the corresponding running total in the table below. There are not enough grains in the whole world to give the Vizier the sum of 18,446,744,073,709,551,615 grains! Indeed, that many grains would cover the entire earth several inches deep.

SquareGrains on SquareRunning Total
111
223
347
4815
51631
63263
764127
8128255
9256511
105121,023
111,0242,047
122,0484,095
134,0968,191
148,19216,383
1516,38432,767
1632,76865,535
1765,536131,071
18131,072262,143
19262,144524,287
20524,2881,048,575
211,048,5762,097,151
222,097,1524,194,303
234,194,3048,388,607
248,388,60816,777,215
2516,777,21633,554,431
2633,554,43267,108,863
2767,108,864134,217,727
28134,217,728268,435,455
29268,435,456536,870,911
30536,870,9121,073,741,823
311,073,741,8242,147,483,647
322,147,483,6484,294,967,295
334,294,967,2968,589,934,591
348,589,934,59217,179,869,183
3517,179,869,18434,359,738,367
3634,359,738,36868,719,476,735
3768,719,476,736137,438,953,471
38137,438,953,472274,877,906,943
39274,877,906,944549,755,813,887
40549,755,813,8881,099,511,627,775
411,099,511,627,7762,199,023,255,551
422,199,023,255,5524,398,046,511,103
434,398,046,511,1048,796,093,022,207
448,796,093,022,20817,592,186,044,415
4517,592,186,044,41635,184,372,088,831
4635,184,372,088,83270,368,744,177,663
4770,368,744,177,664140,737,488,355,327
48140,737,488,355,328281,474,976,710,655
49281,474,976,710,656562,949,953,421,311
50562,949,953,421,3121,125,899,906,842,623
511,125,899,906,842,6242,251,799,813,685,247
522,251,799,813,685,2484,503,599,627,370,495
534,503,599,627,370,4969,007,199,254,740,991
549,007,199,254,740,99218,014,398,509,481,983
5518,014,398,509,481,98436,028,797,018,963,967
5636,028,797,018,963,96872,057,594,037,927,935
5772,057,594,037,927,936144,115,188,075,855,871
58144,115,188,075,855,872288,230,376,151,711,743
59288,230,376,151,711,744576,460,752,303,423,487
60576,460,752,303,423,4881,152,921,504,606,846,975
611,152,921,504,606,846,9762,305,843,009,213,693,951
622,305,843,009,213,693,9524,611,686,018,427,387,903
634,611,686,018,427,387,9049,223,372,036,854,775,807
649,223,372,036,854,775,80818,446,744,073,709,551,615