So... hmmm dunno either planet, I assume they're on the solar system and therefore orbiting the same planet, the sun, or whoever.
but, in short, what I can make out is, when do 6 and 9 have the same LCM, least common multiple, or a factor that's common to both 6 and 9, and therefore meet at such.
well, let's do a prime factoring of 6, is 2 and 3 only, ok,
now a prime factoring of 9, is 3 and 3 only, ok.
now, we have 3 as common to both, so, to get an LCD or LCM, we'll use repeated factors but once only for each instance for each.
therefore

so, after 18 years.