Chess and maths

Sissa's chessboard: how many grains of rice? The calculation explained step by step

One grain on the first square, two on the second, four on the third… The legend of Sissa is the favourite exercise of secondary school maths teachers for showing what exponential growth really is.

In brief

The problem of Sissa's chessboard is to double a grain of rice on each of the 64 squares: the last square carries 263 grains and the total is 264 − 1, or 18,446,744,073,709,551,615 grains. That is several hundred billion tonnes of rice, hundreds of years of the world's harvest.

The legend is told in many ways, but its mathematical mainspring never changes. A king wants to reward the inventor of chess, a sage whom tradition calls Sissa. The sage asks for a reward that looks modest: one grain on the first square of the chessboard, two on the second, four on the third, and so on, doubling on each square up to the 64th. The king agrees with a laugh… then discovers that all the grain in the kingdom will not be enough.

The legend of Sissa's chessboard in a few lines

Depending on the version, the reward is in grains of wheat or grains of rice, and the king goes by different names (Belkib, for example, in several French-language accounts). The story is a legend: it does not tell the real origin of chess. The oldest known written account of this story is attributed to the historian Ibn Khallikan, in 1256. What matters here is the calculation, and it is relentless.

Sissa's chessboard problem
A problem that consists of placing 1 grain on the first square of a chessboard, then doubling the number of grains on each following square. Square n carries 2n−1 grains, and the total over the 64 squares is 264 − 1 = 18,446,744,073,709,551,615 grains.

The typical wording of a 4e exercise

In one form or another, here is the exercise found in many secondary school workbooks (4e in France, pupils aged 13–14):

  1. How many grains of rice are there on the 2nd, 3rd and 4th squares? Write these numbers as powers of 2.
  2. How many grains are there on the 10th square? On the 64th square?
  3. How many grains are there in all on the first 5 squares? Compare with the number of grains on the 6th square. What do you notice?
  4. Deduce the total number of grains on the chessboard.

The calculation step by step

1. Grains on a given square

On the 1st square there is 1 grain, which can be written 20. On the 2nd, 2 = 21. On the 3rd, 4 = 22. On the 4th, 8 = 23. At each square the exponent goes up by 1, but it is always one behind the square's number. So square number n carries 2n−1 grains: the 10th square carries 29 = 512, and the 64th carries 263 = 9,223,372,036,854,775,808.

2. The total: one observation that does it all

Let us add up the first squares: 1 + 2 + 4 + 8 + 16 = 31. The next square carries 32. The total of the previous squares is always the next square minus 1. This can be checked at every step: 1 = 2 − 1, 1 + 2 = 4 − 1, 1 + 2 + 4 = 8 − 1… The total of the 64 squares is therefore the “65th square” minus 1, that is 264 − 1.

3. The proof, for older pupils

Let S = 1 + 2 + 22 + … + 263. Multiply by 2: 2S = 2 + 22 + … + 263 + 264. Subtract the first line from the second: almost all the terms vanish, leaving 2S − S = 264 − 1. So S = 264 − 1. This is a special case of the sum of a geometric sequence with common ratio 2, studied in the première year (age 16–17).

264 − 1 = 18 446 744 073 709 551 615

In words: eighteen quintillion, four hundred and forty-six quadrillion, seven hundred and forty-four trillion, seventy-three billion, seven hundred and nine million, five hundred and fifty-one thousand, six hundred and fifteen. A school calculator generally displays 264 as 1.844674407 × 1019: it does not have enough digits to write it out in full, so it cannot show the difference between 264 and 264 − 1.

Square-by-square table

SquarePowerGrains on the squareRunning total
12011
22123
32247
423815
5241631
6253263
72664127
827128255
928256511
10295121 023
1621532 76865 535
322312 147 483 6484 294 967 295
332324 294 967 2968 589 934 591
632624 611 686 018 427 387 9049 223 372 036 854 775 807
642639 223 372 036 854 775 80818 446 744 073 709 551 615

Two remarks strike pupils. First, the first rank of the chessboard (8 squares) holds only 255 grains: a small handful. Second, the last square on its own holds one more grain than the 63 previous squares put together. This is the hallmark of exponential growth: each doubling weighs as much as all the history before it.

How many tonnes of rice? An order of magnitude

To go from grains to tonnes, you need an assumption about the mass of a grain, which varies by variety. A grain of rice weighs a few hundredths of a gram: the Wikipedia article on the problem uses 0.04 g, and agronomic measurements on some varieties give slightly more than 0.025 g (about 26 g per thousand grains). The two assumptions give:

Mass of one grain (assumption)Total massYears of world production
0,025 g≈ 461 billion tonnes≈ 590 years
0,04 g≈ 738 billion tonnes≈ 950 years

Calculation: 18,446,744,073,709,551,615 × mass of one grain. Compared with a world harvest of about 776 million tonnes of rice in 2022 (FAOSTAT data as reported by Wikipedia). With wheat grains of 65 mg, the assumption used by the English-language Wikipedia article, the total exceeds 1,199 billion tonnes.

Another way of putting it: counting one grain per second, without ever stopping, it would take about 585 billion years to count all the grains, more than forty times the estimated age of the Universe.

Finding the order of magnitude without a calculator

A useful trick in class: 210 = 1,024, which is roughly 1,000 = 103. Now 264 = 24 × (210)6, so roughly 16 × (103)6 = 16 × 1018 = 1.6 × 1019. The true value is 1.84 × 1019: the approximation underestimates a little, because each “1,024 ≈ 1,000” loses 2.4%, six times in a row. It is a good exercise on powers and on scientific notation.

The questions pupils ask

What if we triple instead of doubling?

With tripling, square n carries 3n−1 grains, and the total is (364 − 1) ÷ 2. The same method (multiply S by 3, then subtract) gives the result. The number obtained exceeds 1030.

How many squares are needed to exceed a million grains?

The total after n squares is 2n − 1. Since 219 = 524,288 and 220 = 1,048,576, you need 20 squares to exceed a million grains in total. And you need 30 squares to exceed a billion (230 − 1 = 1,073,741,823).

Why does 264 keep coming up in computing?

Because a number written on 64 bits can take exactly 264 different values. The largest positive integer that can be encoded in unsigned 64 bits is therefore 264 − 1: the same number as Sissa's.

Going further

The chessboard hides other gigantic numbers. The number of possible chess games, estimated by Claude Shannon, makes Sissa's look tiny: see more very large chessboard numbers with the Shannon number. For more geometric problems, head to the chessboard's mathematical puzzles. And to keep your mind sharp between two exercises, Le Palais des Échecs offers a mathematical logic test to practise with.

Frequently asked questions

How many grains of rice are there on a chessboard?

In the legend of Sissa, the number of grains doubles on each square, starting from 1. The total is 264 − 1 = 18,446,744,073,709,551,615 grains, or several hundred billion tonnes of rice.

What is 2 to the power of 64?

264 = 18,446,744,073,709,551,616, or about 1.84 × 1019. The total number of grains on Sissa's chessboard is one less: 18,446,744,073,709,551,615.

What is 2 to the power of 63?

263 = 9,223,372,036,854,775,808. This is the number of grains placed on the 64th and last square of Sissa's chessboard.

Why is the total 2 to the power of 64 minus 1?

Because the sum 1 + 2 + 4 + … + 263 is a geometric sequence with common ratio 2: calling this sum S, 2S − S = 264 − 1. More simply, the total of the first squares is always the next square minus 1.