extended euclidean algorithm, number theory