The problem remained unsolved for a number of years, due partly to the difficulty of computing the huge numbers involved in the solution. The general solution was found in 1880 by A. Amthor; he gave the exact solution using exponentials and showed that it was about cattle. The decimal form is too long for humans to calculate exactly, but multiple precision arithmetic packages on computers can easily write it out explicitly.
In 1769, Gotthold Ephraim Lessing was appointed librarian of the Herzog August Library in Wolfenbüttel, Germany, which contained many Greek and Latin manuscripts. A few years later, Lessing published translations of some of the manuscripts with commentaries. Among them was a Greek poem of forty-four lines, containing an arithmetical problem which asks the reader to find the number of cattle in the herd of the god of the sun. The name of Archimedes appears in the title of the poem, it being said that he sent it in a letter to Eratosthenes to be investigated by the mathematicians of Alexandria. The claim that Archimedes authored the poem is disputed, though, as no mention of the problem has been found in the writings of the Greek mathematicians.
The problem, from an abridgement of the German translations published by Nesselmann in 1842, and by Krumbiegel in 1880, states:
Compute, O friend, the number of the cattle of the sun which once grazed upon the plains of Sicily, divided according to color into four herds, one milk-white, one black, one dappled and one yellow. The number of bulls is greater than the number of cows, and the relations between them are as follows:
- White bulls black bulls + yellow bulls,
- Black bulls dappled bulls + yellow bulls,
- Dappled bulls white bulls + yellow bulls,
- White cows black herd,
- Black cows dappled herd,
- Dappled cows yellow herd,
- Yellow cows white herd.
If thou canst give, O friend, the number of each kind of bulls and cows, thou art no novice in numbers, yet can not be regarded as of high skill. Consider, however, the following additional relations between the bulls of the sun:
- White bulls + black bulls = a square number,
- Dappled bulls + yellow bulls = a triangular number.
If thou hast computed these also, O friend, and found the total number of cattle, then exult as a conqueror, for thou hast proved thyself most skilled in numbers.
The first part of the problem can be solved readily by setting up a system of equations. If the number of white, black, dappled, and yellow bulls are written as and , and the number of white, black, dappled, and yellow cows are written as and , the problem is simply to find a solution to:
which is a system of seven equations with eight unknowns. It is indeterminate, and has infinitely many solutions. The least positive integers satisfying the seven equations are:
which is a total of 50,389,082 cattle and the other solutions are integral multiples of these.
The general solution to the second part of the problem was found by A. Amthor in 1880. The following version of it was described by H. W. Lenstra , based on Pell's equation: the solution given above for the first part of the problem should be multiplied by