greatest common divisor and least common multiple methods