Add consecutive integer checking algorithm to get the greatest common divisor