When will the moons and the planet all be on one straight line again? 
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.
 A: The hard question has a different answer from the easy one for two reasons.
Firstly, the moons need not all be on the same side of the planet, and secondly, the line that they form can be in a different orientation from the original line.
The simplest way to handle the orientation problem, is to imagine you are standing on the slowest of the moons. Then replace the values for $t_i$ by new ones that are relative to your view from the slow moon. If $s$ is the orbital time period of your moon, and $t$ the orbital time of any other moon, then the time it takes for that moon to line up again on this side of the planet (i.e. the new relative orbital period) is
$$t_{rel} = \frac{1}{\frac1t-\frac1s}$$
You can derive this by thinking about angular speeds instead of time.
If you allow a moon to line up on the opposite side of the planet, then simply halve the $t_{rel}$.
Finally find the smallest length of time that is an integer multiple of the $t_{rel}$ (or $t_{rel}/2$) of all of the other moons. Note that it is incorrect to refer to this as an LCM, since that is only defined for integers. In practice they will never exactly line up, and you will have to allow a small tolerance.
A: 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.
