Number of subsets with GCD equal to ' i ' is Math . pow ( 2 , add ) - 1 - sub
subsets . put ( i , ( 1 << add ) - 1 - sub ) ; } for ( int i = 0 ; i < m ; i ++ ) System . out . print ( " Number ▁ of ▁ subsets ▁ with ▁ gcd ▁ " + gcd [ i ] + " ▁ is ▁ " + subsets . get ( gcd [ i ] ) + "NEW_LINE"); }