Problem 66 - Diophantine equation

 - After some digging, found solution on wikipedia's entry for Pells equation