As has already been said to calculate the gravitational attraction of two objects you can use:
GM1M2/r^2
But this only works for two objects you cant add a third object to this equation which means AFAIK we can not predict the attraction of a 3-or-more-body system (also called n-body problem)
Kold91 t1_ixw9hoi wrote
Reply to How would one calculate the gravity of a planet? by LoreCriticizer
As has already been said to calculate the gravitational attraction of two objects you can use:
GM1M2/r^2
But this only works for two objects you cant add a third object to this equation which means AFAIK we can not predict the attraction of a 3-or-more-body system (also called n-body problem)