Gulliver’s travels was written in 1726 moons of Mars were not discovered until 1877 “Asaph Hall discovered both the Red Planet’s moons in 1877.” err?
Yes, but the fact is that Gulliver does give a detailed account of the discovery by the Laputians of two satellites of Mars, as described.
That Swift chose two as their number is not so amazing, and it is also reasonable that he made them to be close, because this way they are hidden from discovery by the brightness of Mars. He chose 3 and 5 Martian diameters as their orbital radii, whereas the actual values are 1.4 and 3.5, so ooh, way off! :-) But I think we have to accept that it was a lucky guess.