Excluding those subsets which have gcd > i but not i i . e . which have gcd as multiple of i in the subset . for ex : { 2 , 3 , 4 } considering i = 2 and subset we need to exclude are those having gcd as 4
sub += subsets [ j * i ] NEW_LINE j += 1 NEW_LINE