Interview Prep

Rice Chessboard Puzzle Answer: 18 Quintillion Grains [Solved]

rice chessboard puzzle answer: a chessboard covered in doubling piles of rice

The rice chessboard puzzle answer is 18,446,744,073,709,551,615 grains of rice: 2 to the power of 64, minus 1. The last square alone holds 9,223,372,036,854,775,808 grains, and no king could ever pay it.

Here is the question, as it appears in interview puzzle collections and Fermi-problem sets. A king offers the inventor of chess any reward he wants. The inventor asks for one grain of rice on the first square, two on the second, four on the third, doubling on every square until all 64 are filled. How much rice does the king owe?

The story is a legend, first recorded in 1256 by the scholar Ibn Khallikan. Versions differ on wheat versus rice and on the inventor’s name, but the question stays the same. This walkthrough starts small, proves the total, and weighs the result.

The Rice Chessboard Puzzle Answer in Small: Try 8 Squares First

Do not start with 64 squares. Start with 8 squares and watch the pattern appear. The table below lists the grains on each square and the running total.

Square Grains on this square Total so far
1 1 1
2 2 3
3 4 7
4 8 15
5 16 31
6 32 63
7 64 127
8 128 255

Two patterns jump out. Square 8 holds 128 grains, which is 2 to the power of 7. In general, square n holds 2 to the power of n minus 1 grains, since square 1 holds 2 to the power of 0, which is 1. The running total after 8 squares is 255, one less than 256. In short, the total after n squares is 2 to the power of n, minus 1.

After 10 squares the total is 1,023 grains, and square 10 alone holds 512. Growth looks gentle at first and then runs away. That is the whole puzzle in miniature.

Why the Rice Chessboard Puzzle Answer Is 2 to the Power of 64 Minus 1

The table gives the pattern, and one short argument turns it into a proof. Call the total S. Then S equals 1 plus 2 plus 4 plus 8, all the way up to 2 to the power of 63, the grains on square 64.

Next, double S. Every term doubles: 2 plus 4 plus 8 plus 16, up to 2 to the power of 64. Every term of S appears in 2S except the first 1, and 2S has one extra term at the end. As a result, 2S minus S leaves only that last term minus 1. So S equals 2 to the power of 64 minus 1.

Put the numbers in. The total is 18,446,744,073,709,551,615 grains, about 18.4 quintillion. Square 64 alone holds 9,223,372,036,854,775,808 grains, about 9.2 quintillion: more than half of the whole reward on one square.

Each new square also holds one more grain than all the squares before it: square 8 holds 128 grains, and squares 1 to 7 hold 127. So every square doubles the running total and adds 1. That is the rice chessboard puzzle answer in one line.

The First-Half Trap: Square 33 Beats Squares 1 to 32

Most candidates guess the first half of the board carries a fair share of the rice. It does not. The first 32 squares together hold 4,294,967,295 grains. Square 33 alone holds 4,294,967,296 grains, one grain more than the entire first half.

The second half holds 18,446,744,069,414,584,320 grains, all but 4 billion of the total. The first half is a rounding error: the first 32 squares are worth less than a single square of the second half. This is Ray Kurzweil’s “second half of the chessboard”. Growth looks harmless for a long stretch and then overwhelms everything at once, and the king who laughs at square 1 is ruined by square 33.

What 18 Quintillion Grains of Rice Actually Weighs

A huge number means little on its own, so convert it into weight. Take one grain at about 0.021 grams, the figure used in USDA cultivar trials. Multiply by 18,446,744,073,709,551,615 grains and the total is about 387 billion tonnes of rice.

World rice production is about 535.8 million tonnes a year, according to the USDA ERS Rice Outlook for 2024/25. Divide 387 billion tonnes by that figure and the answer is about 723 years. In other words, the king would need more than 700 years of everything the world grows.

For scale, square 21 alone holds 1,048,576 grains, about 42 pounds at 25,000 grains to a pound. By square 32, one square holds 2,147,483,648 grains, about 45 tonnes.

The Trap Most Candidates Fall Into

The first trap is guessing a familiar big number. Candidates say a million, a billion, or a trillion. The real answer is 18 quintillion, so a trillion is wrong by a factor of about 18 million. The interviewer is not testing arithmetic, but whether the candidate respects how fast doubling grows.

The second trap is forgetting the minus 1. It is 2 to the power of 64 minus 1, not 2 to the power of 64, because square 1 holds 2 to the power of 0, not 2 to the power of 1. A candidate who states the total as 2 to the power of 64 has the right idea and the wrong number.

The third trap is adding up 64 numbers by hand. That is slow, and it signals brute force instead of structure. The strong move is the small case first: work 8 squares, spot the pattern, and prove it with the doubling argument. The interviewer wants the pattern, not the addition.

The fourth trap is treating the first half as half the answer. It holds about 4.3 billion grains against a total of 18.4 quintillion. Saying the first half “hardly matters” is the correct reading of the numbers.

What the Interviewer Is Testing in the Rice Chessboard Puzzle Answer

This question tests four things, and none of them is arithmetic speed. First, it tests whether you shrink a big problem to a small case you can check, which is why the 8-square table is the strongest opening move. Starting at square 1 and working up to 8 sounds organised. Jumping straight to 2 to the power of 64 sounds rehearsed.

Second, it checks whether you turn a pattern into a proof. The table shows the total is one less than a power of 2, and the doubling argument proves it in two lines. That step, from pattern to proof, is what separates a good answer from a lucky guess.

Third, it looks at whether you can make a huge number meaningful. Quoting 18 quintillion is not enough. The strong candidate converts it into weight, then into years of world production. That is the skill the interviewer is hiring for: giving a number a scale a decision maker can use.

Finally, it tests how you handle a follow-up. A good interviewer asks what happens with 32 squares, with tripling instead of doubling, or with a heavier grain. The small case and the doubling proof answer all three at once, because the method never depended on the number 64.

Try Another Puzzle From the Series

If you liked the doubling here, try the bacteria puzzle: a colony doubles every minute and fills the dish in 60 minutes, so it is half full at minute 59: J.P. Morgan Bacteria Colony Interview Question.

For the same small-case habit, try the 100 doors puzzle: 100 doors are toggled 100 times, and only the perfect squares stay open: 100 Doors Puzzle Answer: 10 Open [Solved].

Frequently Asked Questions

How many grains of rice are on the 64th square?

Square 64 holds 2 to the power of 63 grains, which is 9,223,372,036,854,775,808, about 9.2 quintillion: more than half of the total reward on a single square.

How many grains are on the first half of the board?

The first 32 squares hold 2 to the power of 32 minus 1 grains, which is 4,294,967,295. Square 33 alone holds one grain more than that whole first half.

Why is the answer 2 to the power of 64 minus 1 and not 2 to the power of 64?

Square 1 holds 2 to the power of 0, which is 1 grain, so square n holds 2 to the power of n minus 1. Add the first 64 powers of 2, from 2 to the power of 0 to 2 to the power of 63, and the sum is 2 to the power of 64 minus 1.

Where does this question come from?

The rice chessboard puzzle is a classic brain teaser in interview puzzle collections and Fermi-problem sets, and it was a Fermi problem at the 2015 UBC Physics Olympics. The story is a legend first recorded in 1256 by Ibn Khallikan, and versions differ on the inventor’s name and on rice versus wheat. Wikipedia has the full background: Wheat and chessboard problem.

Enjoying this? Add StudyFromNotes as a preferred source on Google to see our latest notes and updates more often:

One response to “Rice Chessboard Puzzle Answer: 18 Quintillion Grains [Solved]”

Leave a Reply

Your email address will not be published. Required fields are marked *