Suppose we have a planet $P$ (which we will assume to be stationary) and $n \in \mathbb N_{> 1}$ moons $M_1, \ldots, M_n$ orbiting $P$ in a circular fashion, all in the clockwise direction, but at different distances, so that it takes them $t_1, \ldots, t_n \in \mathbb N_{> 0}$ (say $t_1 < \ldots < t_n$) time units to circumnavigate $P$, respectively. Suppose that at time $t = 0$, there is a straight line segment on which all moons and the planet lies. What is the first time $t > 0$ that this will happen again?
(We assume that $P, M_1, \ldots, M_n$ are points without any width, so they can't obstruct each other or influence each others positions in any other way.)
The motivation for this question came from an easy question we conceived for 7-th graders: if we instead ask what the earliest time is that the moons will all be again at the same position, the answer is $\hat{t} := \text{lcm}(t_1, \ldots, t_n)$, the least common multiple of all orbiting times.
Unfortunately, it can happen that the planets lie on one line segment with the planet much earlier, even for $n = 2$. We couldn't figure out any line of attack for the difficult version of this question state above. Maybe an a priori assumption that will simplify this problem is that all moons start off at the same side of the planet, i.e., the line segment $M_1, \ldots, M_n, P$ lie on does not intersect $P$, it only touches it.
I'd be also grateful for any improvements on the statement of the question, thanks to @Albert for the first suggestion in that direction.
Are all of the moons going in the same direction? I'll assume so but it should be possible to adjust my idea if they are not.
Let's look at the system from above and use clock times to label the moon positions. In your easier version, the moons all start at 12 and your lcm tells you when they will all be at 12 again. I interpret your harder version as whether they will all be in a line but not necessarily at 12.
Try this, walk around the planet at a speed which makes the slowest moon appear stationary. Since I have assumed that they are all going in the same direction, the others will still appear to be moving in the same direction but more slowly. You should be able to recalculate the apparent orbit periods for the remaining moons. Now take the lcm of these apparent orbit periods.