add check prime
update greatest common divisor