Ivars Peterson's MathTrek

April 20, 1998

Cattle of the Sun

The story goes that Archimedes of Syracuse (287-212 B.C.) was annoyed with Apollonius of Perga (262-190 B.C.), who had criticized Archimedes' work on the multiplication of large numbers. For revenge, Archimedes devised a fiendish computational problem that involved truly immense numbers. He proposed the problem in the form of a 44-line poem, and he sent it in a letter to Eratosthenes of Cyrene (275-195 B.C.), the chief librarian at Alexandria.

Whether Archimedes actually invented the problem and wrote the letter isn't known. Indeed, the conundrum didn't reappear in the mathematical literature until 1773, when a manuscript containing the poem was discovered in a German library and subsequently published. About 200 years later, mathematicians finally managed to compute all the digits of the gargantuan answer Archimedes apparently had in mind.

The poem begins: "If thou art diligent and wise, O stranger, compute the number of cattle of the Sun, who once upon a time grazed on the fields of the Thrinacian isle of Sicily, divided into four herds of different colors, one milk white, another a glossy black, a third brown, and the last dappled."

The problem states that, among the bulls, the number of white bulls was equal to one-half plus one-third the number of black bulls plus the number of brown bulls. The number of black bulls was one-quarter plus one-fifth the dappled bulls plus the brown bulls. The number of spotted bulls was one-sixth plus one-seventh the white plus the brown bulls.

Among the cows, the number of white cows was one-third plus one-quarter of the whole black herd. The number of black cows was one-quarter plus one-fifth the total of the dappled. The number of dappled cows was one-fifth plus one-sixth the total of the brown, and the number of brown cows was one-sixth plus one-seventh the total of the white cattle.

Contained in the first 30 lines of the poem, these simple relationships allow one to write down seven equations in eight unknowns: the number of bulls (A, B, C, D) and the number of cows (a, b, c, d) in the four different-colored herds.

A = (1/2 + 1/3)B + C; B = (1/4 + 1/5)D + C; D = (1/6 + 1/7)A + C; a = (1/3 + 1/4)(B + b); b = (1/4 + 1/5)(D + d); c = (1/6 + 1/7)(A + a); d = (1/5 + 1/6)(C + c).

Solving the equations, one obtains the following set of answers:

 Bulls Cows White A = 10,366,482 a = 7,206,360 Black B = 7,460,514 b = 4,893,246 Brown C = 4,149,387 c = 5,439,213 Dappled D = 7,358,060 d = 3,515,820 Total = 50,389,082

In fact, there are infinitely many solutions, the smallest one of which is given above.

But that's not all. According to the poem, getting to this point meant that you "wouldst not be called unskilled or ignorant of numbers, but not yet shalt thou be numbered among the wise." The poem's final section imposes two additional constraints on the solution's possible values. The white and black bulls together form a square, and the brown and dappled bulls together form a triangle (triangular number). A triangular number, m, has the form 1 + 2 + 3 + . . . + m = m(m + 1)/2, where m is a positive integer.

So, A + B = a square; C + D = m(m + 1)/2. Those constraints make the problem surprisingly difficult and send the possible solutions into the digital stratosphere.

In the April American Mathematical Monthly, Ilan Vardi of Occidental College in Los Angeles notes, "The simple nature of the question and the difficulty of its solution makes this a perfect example of a challenge problem and shows once more that Archimedes is one of the greatest mathematicians of all time."

The poem itself concludes, "If thou art able, O stranger, to find out all these things and gather them together in your mind, giving all the relations, thou shalt depart crowned with glory and knowing that thou hast been adjudged perfect in this species of wisdom."

By 1880, mathematicians knew that it is possible to reduce all the equations and constraints to an expression known as Pell's equation:

u^2 - 4,729,494v^2 = 1; where u = 109,931,986,732,829,734,979,866,232,821,433,543,901,088,049 and v = 50,549,485,234,315,033,074,477,819,735,540,408,986,340.

They could then determine that the smallest possible answer for the herd's total size is a 202,545-digit number, starting with 776. Those digits were finally calculated in 1965. Another effort in 1981 by Harry L. Nelson produced 47 pages of printout from a Cray 1 supercomputer at the Lawrence Livermore National Laboratory, which was published in small type in the Journal of Recreational Mathematics.

Nowadays, the use of a symbolic algebra program such as Mathematica or Maple allows one to explore the cattle problem in considerable detail. Vardi shows what can be done with such tools in the April American Mathematical Monthly. He describes a number of relatively simple formulas to generate solutions of the cattle problem. His neatest result is that the smallest possible value for the total number of cattle can be written as the smallest integer greater than or equal to the following humongous expression:

(25,194,541/184,119,152)(u + vSQRT[4,729,494])^4,658.

"It seems very unlikely that Archimedes would have been able to solve the complete problem due to the tremendous size of the answer," Vardi argues. It's also unlikely that he even knew that an answer existed. That would have required Archimedes to know that a large Pell equation always has a solution.

In the Sand Reckoner, Archimedes proposed a system for expressing large numbers. If he had solved the cattle problem, Vardi speculates, he might have expressed it as follows:

7 units of 2 myriad 5819th numbers, and 7602 myriad 7140 units of 2 myriad 5818th numbers, and 6486 myriad 8182 units of 2 myriad 5817th numbers, . . . and 9737 myriad 2340 units of 3rd numbers, and 6626 myriad 7194 units of 2nd numbers, and 5508 myriad 1800.

No matter how you state the number, that's a lot of cattle -- a tremendous herd that only a godly cowboy could handle.