The distance and parallax are inversely related. We can find the distance using the following equation:
[tex]d= \frac{1}{p} [/tex]
where d is distance and p is parallax.
We are given the parallax of the comet relative to the moon, and we are looking for the distance to the comet relative to the moon's distance, so wee can plug in the following value:
[tex]d= \frac{1}{ \frac{1}{40} } [/tex]
The distance is 40 times as far away as the moon.