Keith's method for finding GCD