# Wheat and chessboard problem

Hi, does anybody of you know of the Wheat chessboard legend?

If not, it goes something like this:

Shihram, ruler of India, was quite a abusive ruler. To show him the wrongness of his ways without risking his own live, Sissa developed a game in which the king was the most important figure, but was not able to do anything without his pawns. You may have already guessed that, but this game was chess. Playing chess with Sissa, Shihram became a more calm ruler. To reward Sissa for this, Shihram granted him a wish. And Sissa wished to have wheat grains put onto a chessboard, one grain on the first field, two on the second, four on the third and so on. Shihram started laughing and granted his wish, still being annoyed because he thought Sissa was wishing for so little. Two days later, he asked his underlings if Sissa had gotten his reward, but was told that his underlings were still calculating. Two more days later, he was told that the reward was not yet calculated, but already much more then all wheat in his whole kingdom.

So how much was it exactly?

A chessboard has 64 fields so we would have:

We notice if we wrote this in binary, this would be:

which we also can write as:

or again in decimal:

so how do we calculate this without a calculator?

Lets assume we know: $1024 = 2\^{10}$ so we get $w = 2\^4 \cdot 1024\^6$.

Now the question is, how much is $1024\^6$?

Spliting it into $(1000 + 24)\^6$ and using Pascal’s triangle

leads us to this:

which means we only need to calculate the powers of 24, the higher the power of 24 the less effect it will have on the final result so we can even ignore higher orders of 24 if we are not interested in calculating the value exactly. Suddenly, 64 multiplications become 6 multiplications for the powers of 24, 6 additions and one final multiplications with 16.

Actually calculating them will give us $\approx 18.447 \cdot 10\^{18}$ wheat grains. No wonder they could not find enough of it \^\^

So how did Shihram solve this without refusing to grant Sissa his wish?

Shihram became very angry when he understood that Sissa had tricked him into granting an unfulfillable wish. But his underling had an idea how to still grant Sissa his wish. Sissa should come to him and count his reward one grant at a time!