We have that F is proportional to m1. Hence, we have that F=m1*c when we change the first mass. We also have that F=m2*c when we only change the 2nd mass. Since F scales inversely with the square of the distance, we have that

. Combining all of the facts above, we get that F=c*

where c is a constant.