greatest common divisor with prog