How do I make an object have an increasing attraction to a point the closer it gets?

In my 2d game a ship is being pulled to a planet (like spacewar!)and much like real gravity I want the gravity to be stronger the closer you are to the planet. I know that I have to do something like: 1 / (distance between the objects squared). But the C# engine does not accept vectors being squared. Anything helps, thank you in advance!

float distance = Vector3.Distance(planetCenterPoint, shipPosition);
float gravityFactor = 1 / (distance * distance); // possibility 1
float gravityFactor = 1 / Mathf.Pow(distance, 2); // possibility 2
float gravityFactor = 1 / Mathf.Pow(Vector3.Distance(planetCenterPoint, shipPosition), 2); // possibility 3