# What is the origin of the “wheat and chessboard” legend?

The "wheat and chessboard" fable describes a geometric problem that is often quoted in stories about the invention of chess. According to Wikipedia, the main theme of the fable is:

When the creator of the game of chess (in some tellings an ancient Indian mathematician, in others a legendary dravida vellalar named Sessa or Sissa) showed his invention to the ruler of the country, the ruler was so pleased that he gave the inventor the right to name his prize for the invention. The man, who was very wise, asked the king this: that for the first square of the chess board, he would receive one grain of wheat (in some tellings, rice), two for the second one, four on the third one, and so forth, doubling the amount each time. The ruler, arithmetically unaware, quickly accepted the inventor's offer, even getting offended by his perceived notion that the inventor was asking for such a low price, and ordered the treasurer to count and hand over the wheat to the inventor. However, when the treasurer took more than a week to calculate the amount of wheat, the ruler asked him for a reason for his tardiness. The treasurer then gave him the result of the calculation, and explained that it would take more than all the assets of the kingdom to give the inventor the reward. The story ends with the inventor becoming the new king. (In other variations of the story the king punishes the inventor.)

In some variations, wheat is replaced by rice.

What are the origins of the fable? More specifically, and since chances are the fable was passed down through oral tradition, what are the earliest recorded instances of it?

-
What does not convince you in the answer below? – astabada Jan 14 '13 at 13:11
@astabada Your answer is great, and I've already upvoted it, but I generally avoid rushing to accept answers, it severely limits the visibility of the question (and its answers). – Yannis Jan 14 '13 at 14:21
I've heard versions which required doubling with every square, or with half the squares. The half-the-squares version would yield a quantity of rice or wheat which, while extremely generous, a king might be physically capable of supplying. Interestingly, computers nowadays routinely work with numeric types that could handle even the full chessboard, and in some cases work with numbers that are much bigger than that. If one raises a number x to a power y, and computes the remainder of that value mod z, then "y" has meaning as a "number", in that increasing it by one... – supercat Nov 5 '14 at 20:10
...would effectively cause one more multiplication to be performed. When y is big, one would need to use numerical shortcuts rather than performing y sequential multiply operations, but the value of (x^y mod z) is defined as what would be computed if one started with t=1 and performed the instruction "t=t*x mod z" y times. In a typical RSA encryption protocol, one could replace every grain on the chessboard with a whole chessboard "full" of rice, and repeat that substitution a few times, without the number of grains of rice exceeding commonly used RSA exponents. – supercat Nov 5 '14 at 20:46

## 2 Answers

If the following seems too long, you can directly jump at the end for the conclusion ins the TL;DR section.

I'm not an historian and (almost) everything I tell below comes from internet research. More precisely, the whole stuff I tell below finds its source in various articles by the assyriologist Jens Høyrup.

## The king and the chess board in Indian and Islamic tradition

This legend is very common and universal, I remember my father telling me this story in Paris the 1980's. Less anecdotally, Stith Thompson gives a place to this motif in his folktales-motif index (Z21.1).

Georges Ifrah tells a variant of it in his Universal history of numbers [3,4], where the king's accountant does not manage to compute the doubling because he uses an abacus, which makes these big numbers impractical. The wise man was then the the only one able to count how many grains of wheat were needed, because he used the 10 digits of what we now call the Hindu-Arabic numeral system. Chess and Hindu-Arabic numerals where both find their origins in India in the middle-ages, and both followed the same Persian route towards the Islamic empire, there association in this mathematically themed legend might point to the origin of this 64 doubling problem.

According to [2], the last chapter Abu'l-Hasan al-Uqlidisi book on arithmetic with Hindu numeral is On Doubling One, Sixty-Four times. This book was probably written in 952. Apparently, Al-Khwārizmī, who died a century earlier, wrote a (lost ?) treaties on the question. Jens Høyrup states in [2] that

[this] tale is found in various Islamic writers from the 9th century onwards; he mentions a text by al Ya'qubi, [2, note 30].

This text should be older than Firdowsi's text mentioned in astabada's answer. Given the association of the number 64 and the chessboard, older versions of this legend might be found in Indian texts between the 6th and the 9th century.

However, as seen below, this story has much older roots.

## A variant of an older mathematical folktale: the 30 doubling problem

Something I find interesting, is that popular these doubling problems/riddles/tales appear only in two forms: either one doubles 64 times, or one doubles 30 times. This observation has already be made by al-Uqlidsi in 952:

This is a question many people ask. Some ask about doubling one 30 times, and others ask about doubling it 64 times.

This implies that all these tales are somehow related, and that cannot be interpreted as independent discovery of the exponential progression! Furthermore, the variant with 64 doubling only appears quite late, at a time were the chessboard (and hindu-arabic numerals) existed. Furthermore, the "obvious" relation between 30 and the length of a month seems to only appear lately, so it is probably not the source of the number 30.

And actually, the 30 doubling problems, with other recreational mathematical problems are spread over a vast area, from western Europe to China and [1,2] following [5] attributes it to:

the community of traders and merchants interacting along the Silk Road, the combined caravan and sea route reaching from China to Cadiz.

(I have no access to ref [5] which is long book in German, but I'd like to!)

The narration around these 30 doubling problems is often different than the chessboard tale, except maybe for the earliest. I'll give here some examples in reverse chronological order.

### 21st century CE: Today's version, still alive!

If you search for "double a penny", you'll find that the modern avatars of the old "community of trader" still propagate the same story. The narrative round these two examples correspond exactly with the proposed context in Høyrup's paper!

### 8th century: Carolingian Europe's king's problem

The 13th problem Carolingian recreational mathematics treaty Propositiones ad Acuendos Juvenes (en: Problems to Sharpen the Young), maybe due to Alcuin, has a very different tale to this 30 doubling problem :

The Latin version, from Vikifons (i.e. latin wikisource).

### XIII. PROPOSITIO DE REGE.

Quidam rex iussit famulo suo colligere de XXX uillis exercitum, eo modo, ut ex unaquaque uilla tot homines sumeret, quotquot illuc adduxisset. Ipse tamen ad uillam primam solus uenit; ad secundam cum altero; iam ad tertiam tres uenerunt. Dicat, qui potest, quot homines fuissent collecti de XXX uillis.

• Solutio*

In prima igitur mansione duo fuerunt; in secunda IIII, in tertia VIII, in quarta XVI, in quinta XXXII, in sexta LXIIII, in septima CXXVIII, in octaua CCLVI, in nona DXII, in decima ¬I XXIIII, in undecima ¬I¬I XLVIII, in duodecima ¬I¬I¬I¬I XCVI, in quarta decima ¬X¬V¬I CCCLXXXIIII. In quinta decima ¬X¬X¬X¬I¬I DCCLXVIII, etc.

Its English translation, by J. J. O'Connor and E. F. Robertson, at the MacTutor history of mathematics archive is:

### 13. Puzzle of the king's army.

A king ordered his servant to collect an army from 30 villages as follows: He should bring back from each successive village as many men as he had taken there. The servant went to the first village alone; he went with one other man to the second village; he went with three other men to the third village. How many men were collected from the 30 villages.

(I don't reproduce their modern solution.)

### 1st century (CE or BCE): a Ptolemaic papyrus in Egypt

In [6] Jöran Friberg (de.wiki,publications) mentions the Ptolemaic papyrus P. IFAO 88 transcribed here. This manuscript simply corresponds to the calculations (with a mistake !) of 30 doubling of 5 (ε) copper drachma (either a monetary unit (like the modern penny above) or a weight unit.)

Jöran Friberg speculates The presence of this text in Egypt might be connected with with the medieval chess legend, since the Egyptian game of Senet has 30 squares. However, it is only a speculation, and as much as I would like to read about an Egyptian legend involving a Pharaoh, the inventor of the game of Senet, and single grain of wheat doubled at each square, I'm not ready bet a few grains of wheat for the finding of such a papyrus !

As noticed by Jöran Friberg, this text is also parallel to a much older texts, where the smallest weight unit is called a barley-corn (see below).

### 18th century BCE: an Old Babylonian cuneiform tablet from Mari

The oldest written source of the 30 doubling problem is the cuneiform tablet M 08613, from the first half of the 18th century BCE (according to the middle chronology). This tablet is heavily discussed in [1,2,6]. As the Ptolemaic papyrus, this tablet only contains the computation of 30 successive doubling of a small weight unit (~0.05 g). However, this time, the unit is litterally called a "barley-corn". The text starts this way (translation from [here]((http://www.cdli.ucla.edu/P390441)

A barley-corn: to a single barley-corn I increased, 2 barley-corns in the 1st day; 4 barley-corns in the 2nd day; 8 barley-corns in the 3rd day;

and so on (including the unit changes and various problems and errors linked to Mari's specific centesimal/sexagesimal number system). It ends at the reverse of the tablet with

1 ‘thousand’ 3 ‘hundred’ 48 talents 30 minas 16 1/6 shekels 2 barley-corns in the 29th day; 2 ‘thousand’ 7 ‘hundred’ 37 talents 1/2 mina 2 1/3 shekels 4 barley-corns in the 30th day.

If I understand correctly the comments ‘thousand’ should in fact be read as sexagesimal 600, and ‘hundred’ as sexagesimal 60. Any way, the final weight corresponds to slightly less than 50 tons. It is likely that this computation was linked with a narrative, but the fable has not be found (yet).

Høyrup explains that the position of Mari, as well as the originality in style of this tablet (it's not a standard scribe exercise) makes the connection with a merchant's tradition likely.

## TL;DR: The answer to your question

To make long story short. Your questions were:

What are the origins of the fable? More specifically, and since chances are the fable was passed down through oral tradition, what are the earliest recorded instances of it?

My (or in fact Høyrup's and Friberg's) answer is:

• The origin of the fable can be traced back to the 18th century BCE in Mesopotamia.
• Computations related to the fable are recorded in the cuneiform tablet M 08613 which is the earliest instance of it.
• This tale was transmitted, along with other mathematical riddles along the silk road on a wide area, ranging from western Europe to China. It was probably transmitted by merchants, and various modern versions are still alive on the internet.

## References

1. Jens Høyrup, Sub-Scientific Mathematics. Observations on a Pre-Modern Phenomenon. History of Science 28 (1990), 63–86. It can be found at page 394 of this big pdf file.
2. The Formation of «Islamic Mathematics». Sources and Conditions. Science in Context 1 (1987), 281–329. pdf
3. George Ifrah, Universal History of Numbers: From Prehistory to the Invention of the Computer. Translated by David Bellos, E.F. Harding, Sophie Wood and Ian Monk. Harville Press, London, 1998 (ISBN 978-1860463242).
4. George Ifrah, Histoire universelle des chiffres, 2nd edition. (Seghers, puis Bouquins, Robert Laffont, 1994)
5. Tropfke, J./Vogel, Kurt, et al, 1980. Geschichte der Elementarmathematik. 4. Auflage. Band 1: Arithmetik und Algebra. Vollständig neu bearbeitet von Kurt Vogel, Karin Reich, Helmuth Gericke. Berlin & New York: W. de Gruyter.
6. Jöran Friberg (2005) Unexpected Links between Egyptian and Babylonian Mathematics, World Scientific, Singapore (Reviewed by José Barrios Garcia, Metascience (2007) 16:295-298) isbn:981-256-328-8, Chapter 1: Two Curious Mathematical Cuneiform Texts from Old Babylonian Mari (830 KB)
-
I just found here an unsourced Indian version, but with 30 doublings jwilson.coe.uga.edu/EMT668/EMAT6680.F99/Martin/… – Frédéric Grosshans Jun 7 '13 at 15:41

The earliest record (I have) found (searching the Internet) is the Persian Book Shahnameh, of which I know nothing more than the Wikipedia entry:

The Shahnameh or Shah-nama (Persian: شاهنامه‎ Šāhnāmeh, "The Book of Kings") is a long epic poem written by the Persian poet Ferdowsi between c. 977 and 1010 AD and is the national epic of Iran and related societies. Consisting of some 60,000 verses, the Shahnameh tells mainly the mythical and to some extent the historical past of (Greater) Iran from the creation of the world until the Islamic conquest of Persia in the 7th century.

Incidentally, it might be interesting to know for western ignorant folk (like me) that this book was "pivotal in reviving Persian language after the Arabic infulence". Back on topic, because I do not have a copy of it at hand, I relied on a random website for the translation of the relevant passage, as reported in Yalom's book [7] (pages 4-5):

The Persian epic Book of Kings (Shah-nameh), written by the great poet Firdausi (c. 935–1020), gives an amusing account of how chess made its way from India to Persia. As the story goes, in the sixth century the raja of India sent the shah a chess set made of ivory and teak, telling him only that the game was "an emblem of the art of war," and challenging the shah's wise men to figure out the moves of the individual pieces. Of course, to the credit of the Persians (this being a Persian story), one of them was able to complete this seemingly impossible assignment. The shah then bettered the raja by rapidly inventing the game of "nard" (a predecessor of backgammon), which he sent back to India with the same challenge. Despite its simplicity relative to chess, the intricacies of nard stumped the raja's men. This intellectual gambling proved to be extremely costly for the raja, who was obliged to pay a heavy toll: two thousand camels carrying "Gold, camphor, ambergris, and aloe-wood,/As well as raiment, silver, pearls, and gems,/With one year's tribute, and dispatched it all/From his court to the portal of the Shah."

Another story in the Shah-nameh tells how chess was originally invented. In this tale, an Indian queen was distraught over the enmity between her two sons, Talhand and Gav, half brothers with respective claims to the throne. When she heard that Talhand had died in warfare, she had every reason to think Gav had killed him. The sages of the kingdom, the tale has it, developed the chessboard to recreate the battle, and show the queen clearly that Talhand had died of battle fatigue, rather than at his brother's hands. The Persian term shah mat, used in this episode, eventually came down to us as "check mate," which literally means "the king was dumbfounded," though it is often translated as "the king died."

The Shah-nameh version of the birth of chess vied with another popular legend in which a man named Sissa ibn Dahir invented the game for an Indian king, who admired it so much that he had chessboards placed in all the Hindu temples. Wishing to reward Sissa, the king told him to ask for anything he desired. Sissa replied, "Then I wish that one grain of wheat shall be put on the first square of the chessboard, two on the second, and that the number of grains shall be doubled until the last square is reached: whatever the quantity this might be, I desire to receive it." When the king realized that all the wheat in the world would not suffice, he commended Sissa for formulating such a wish and pronounced it even more clever than his invention of chess.

Another source [8], also discusses this legend, and the earliest recorded occurence is again in Firdausi. However the author speculates about the earlier development of the theme. According to al-Masudi's early history of India, shatranj, or chess

was inventend under an Indian king, who expressed his preference for this game over backgammon. [...] The Indians, he adds, also calculated an arithmetical progression with the squares of the chessboard. [...] The early fondness of the Indians for enormous calculations [9] is well known to students of their mathematics, and is exemplified in the writings of the great astronomer Āryabaṭha (born 476 A.D.). [10]. [...] An additional argument for the Indian origin of this calculation is supplied by the Arabic name for the square of the chessboard, (بيت, "beit"), 'house'. [...] For this has doubtless a historical connection with its Indian designation koṣṭhāgarā, 'store-house', 'granary' [...].

(emphasis added). Now this is really all I could find.

Hope this can mitigate your thirst, cheerio!

[7]: Birth of the Chess Queen, M. Yalom, HarperCollins Publishers

[8]: Art. XIII.—The Origin and Early History of Chess, A. A. Macdonell, Journal of the Royal Asiatic Society, Volume 30, Issue 01, January 1898, pp. 117-141, DOI: 10.1017/S0035869X00146246, Link: http://journals.cambridge.org/abstract_S0035869X00146246

[9]: Indiens Litteratur und Kultur, L. v. Schroeder, pp. 723-4

[10]: Cf. the arithmetical progression attributed to Āryabhaṭa by Sadgurusisya, ed. Macdonell, p. 180

-