Archimedes' Cattle Problem/Difficult Version

Classic Problem
In addition:


 * All the white and black bulls were arranged in a square


 * All the dappled and brown bulls were arranged in a triangle.

What was the composition of the herd?

Solution
Reduction of the system of simultaneous equations results in the Pell's Equation:


 * $t^2 - 4 \, 729 \, 494 u^2 = 1$

The smallest solution set to this equation is found to be:

In this case, the total number of cattle is approximately:
 * $W + B + D + Y + w + b + d + y = 7 \cdotp 760271 \ldots \times 10^{206 \, 544}$