Ratio of Orbital Distance to Transit Time

I was reading Gullivers Travels to my son over Christmas and in a voyage to Laputa there is a passage illustrating their prowess at astronomy. The passage goes:

They have likewise discovered two lesser stars, or satellites, that revolve about Mars, whereof the innermost is distant from the centre of the primaryplanet exactly three of his diameters, and the outermost five; the former revolves in the space of ten hours, and the latter in twenty-one and a half; so that the squares of their periodical times are very near the same proportion with the cubes of their distance from the centre of Mars, which evidently shows them to be governed by the same law of gravitation, that influences the other heavenly bodies.

Not being an expert in planetary physics I was wondering is this passage:

a) Correct, in which case what are the actual equations?
b) Incorrect, but was generally believed true in 1726 when the book was written?
c) Just a piece of fancy of "the Mad Parson" Jonathan Swift?

In part 3 chapter 3 (the "Voyage to Laputa") of Jonathan Swift's famous satire Gulliver's Travels, a fictional work written in 1726, the astronomers of Laputa are described as having discovered two satellites of Mars orbiting at distances of 3 and 5 Martian diameters, and periods of 10 and 21.5 hours, respectively. The actual orbital distances and periods of Phobos and Deimos are 1.4 and 3.5 Martian diameters, and 7.6 and 30.3 hours, respectively. This is regarded as a fascinating coincidence; no telescope in Swift's day would have been even remotely powerful enough to discover these satellites.​