The Euclidean Algorithm and Diophantine Equations