Add distinct list and greatest common factor