What is the apparent rotation time for a planet relative to an other planet? Just my curiosity. This is not my assignment etc.

Let planet A take m Earth days to complete one full round around the Sun, and planet B take n Earth days for one full round around the Sun. Assuming that both are orbiting in the same direction, what is the duration recorded by an observer on the planet A, as the number of Earth days the planet B took to complete one full round around planet A?
Note, an observer on Planet A can't see a rotation of Planet B. He can see a the Sun orbiting around him, and Planet B orbiting around the Sun. Thus


If Planet B has an orbit of smaller radius than Planet A, then the observer can see Planet B sometimes before, sometimes after its Sun.
If Planet B has an orbit of larger radius than Planet A, then the observer can see Planet B to cycle on the sky, roughly on the plane of the Ecliptics,  but a little bit faster as the Sun.


The calculation is this:


Planet A takes $\frac{1}{m}$ full circle in a day.
Planet B takes $\frac{1}{n}$ full circle in a day.
Thus, the observer on Planet A can see an $|\frac{1}{m}-\frac{1}{n}|$ full circle of rotation of Planet B in a day.
Thus, he can see a period of Planet B of $\frac{1}{|\frac{1}{m}-\frac{1}{n}|}$ Earth days, which is in simplified form


$$\underline{\underline{|\frac{mn}{m-n}|}}.$$