The general solution to the second part of the problem was first found by A. Amthor[10] in 1880. The following version of it was described by H. W. Lenstra,[2] based on Pell's equation: the solution given above for the first part of the problem should be multiplied by