simplify integer via gcd