Archimedes' cattle problem

Archimedes' cattle problem is a problem in Diophantine analysis whose solutions involve fairly large numbers.

A German translation of the problem was as follows:

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 $$=\left(\frac{1}{2} + \frac{1}{3}\right)$$ black bulls + yellow bulls,
 * Black bulls $$=\left(\frac{1}{4} + \frac{1}{5}\right)$$ dappled bulls + yellow bulls,
 * Dappled bulls $$=\left(\frac{1}{6} + \frac{1}{7}\right)$$ white bulls + yellow bulls,
 * White cows $$=\left(\frac{1}{3} + \frac{1}{4}\right)$$ black herd,
 * Black cows $$=\left(\frac{1}{4} + \frac{1}{5}\right)$$ dappled herd,
 * Dappled cows $$=\left(\frac{1}{5} + \frac{1}{6}\right)$$ yellow herd,
 * Yellow cows $$=\left(\frac{1}{6} + \frac{1}{7}\right)$$ 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 solution to the first part of the problem was determined to be 50,389,082 cattle, while the solution to the extended problem is very large, or over 7.76 * 10206544 cattle.