great common divisor GCDab positive integer b equal big integer d integers b divisible d there efficient algorithm find great common divisor GCDab example Euclid algorithm Formally find big integer d integer aa1a2b divisible d to problem complicate allow b googol 10100 number fit 64bit integer type