Chakravala algorithm in Sage.
Example implementation of the Chakravala algorithm in Python used for reference.
Example of a large solution for d=100000000001.
Solution for the Archimedes cattle problem.