How was Newton able to guess that gravitational force is inversely proportional to distance squared? This question is puzzling me since I learnt about the gravitation law in school. Why did Newton guess/assume that gravitational force is inversely proportional to the square of distance?
Did he verify that experimentally? (I remember hearing that the first experimental verification of the law of gravitation was after Newton's death.)
If the answer to the above question is no, is it for example more plausible to suppose that $F\propto1/r^2$ than to suppose that $F\propto1/r^4$? Did Newton carry out a thought experiment that makes $F\propto1/r^2$ a plausible guess?
So in summary: Why did Newton choose exponent of $-2$ instead of any other exponent? Was it a guess that depended on pure luck or an educated guess?
 A: For a uniform circular orbit of radius $r$, the acceleration is
$$\tag{A} a~=~ \omega^2r, \qquad \omega~=~\frac{2\pi}{T},$$
where $T$ is the orbital period. Comparing eq. (A) with Kepler's third law 
$$\tag{B} T^2 ~\propto~ r^3,$$ 
we conclude that the gravitational acceleration
$$\tag{C} a~\propto~ r^{-2} $$ 
is proportional to the inverse square distance $r$.
A: An inverse square law for gravity was already being considered in several places prior to Newton taking it up, and Newton was probably at least partly inspired to consider it by Hooke and Halley (exactly to what extent would be the subject of one of Newton's several priority disputes).
The basic reason for choosing an inverse square as opposed to some other function was picturing gravity arising from some sort of constant physical emanation.  Since the surface at a given distance goes as $1/r^2$, presumably whatever caused gravity would fall in the same proportion.
Newton went further then his contemporaries, however, by showing that under such a force an orbiting object would follow Kepler's laws.  
A: Well, for one, if $F$ goes like $r^{-4}$, all orbits except the unstable circular orbit will fly out or will collapse into the center! So that's a no-no. (I know that because Newton's laws in a central force field give conservation of angular momentum, and in that case, if $U$ is your potential, you can get a differential equation for $r$, the radius, as $\ddot{r}=-\frac{\partial}{\partial r}(U(r)+\frac{M}{2r^2})$. With $U=-\frac{1}{r}$ you have a nice stable dip in which $r$ can oscillate. With $U=\frac{1}{r^3}$ a particle can always lose potential energy by moving in the same direction.)
I haven't read the history in detail, but I believe that the order of events was something like this:
First, Kepler shows that "The orbit of every planet is an ellipse with the Sun at one of the two foci." from wikipedia
Then, Newton shows that an elliptical orbit together with the methods of Newtonian mechanics, implies that the force must act as an inverse square. (A proof of this can be found in A P French's Newtonian Mechanics, though I forget how much history is given there and how geometric his methods are).
Disclaimer: You can see my sources are shaky. There may be more to the story.
