the problem states that is a square number, and is a triangular number. The general solution to this part of the problem was first 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 where j is any positive integer and Equivalently, squaring w results in where is the fundamental solution of the Pell equation The size of the smallest herd that could satisfy both the first and second parts of the problem is then given by j = 1 and is about (first solved by Amthor). Modern computers can easily print out all digits of the answer. This was first done at the University of Waterloo, in 1965 by Hugh C. Williams, R. A. German, and Charles Robert Zarnke. They used a combination of the IBM 7040 and IBM 1620 computers. Pell equation The constraints of the second part of the problem are straightforward and the actual Pell equation that needs to be solved can easily be given. First, it one asks that B + W should be a square, or using the values given above, thus one should set k = (3)(11)(29)(4657)q2 for some integer q. That solves the first condition. For the second, it requires that D + Y should be a triangular number: Solving for t, Substituting the value of D + Y and k and finding a value of q2 such that the discriminant of this quadratic is a perfect square p2 entails solving the Pell equation Amthor's approach discussed in the previous section was essentially to find the smallest such that it is integrally divisible by . The fundamental solution of this equation has more than 100,000 decimal digits. References Further reading External links —Complete decimal solution to the second problem Diophantine equations Large integers Works by Archimedes Cattle in literature