Consider a system of $n+1$ celestial bodies - e.g. a sun, a planet, a moon, a satellite of the moon and a satellite of the satellite - which run around each other on circles in the same plane but with possibly different periods. In this snapshot all bodies are in conjunction:
The blue planet draws a circle, the red moon draws an epicycloid, the satellites draw ever higher epicyloids.
With the sun in the origin, the curve drawn by the last satellite can be given by a function $f_n: \mathbb{R} \rightarrow \mathbb{C}$ by
$f_1(t) = r_1 e^{i(\omega_1 t + \varphi_1)}$ (the planet draws a circle)
$f_2(t) = f_1(t) + r_2 e^{i(\omega_2 t + \varphi_2)}$ (the moon draws an epicycloid)
$\dots$
$f_n(t) = f_{n-1}(t) + r_n e^{i(\omega_n t + \varphi_n)}$
or simply
$$\boxed{f_n(t) = \sum_{k=1}^n c_k e^{i\omega_k t}}$$
with $c_k = r_k e^{i\varphi_k}$.
In the picture above (all bodies are in conjunction) we have $\varphi_k = 0$, so $c_k = r_k \in \mathbb{R}$.
This is another case with $c_k \not\in \mathbb{R}$:
It's an astonishing fact that when choosing the right number of satellites, radii, periods and phases:
The curve drawn by the last satellite can approximate any sufficiently smooth closed curve arbitrarily well.
There is a beautiful demonstration here:
Even though this fact is astonishing (i.e. not obvious), it is elementary. What is obvious is another elementary fact:
When all periods are pairwise rationally related, i.e. $\frac{\omega_i}{ \omega_j}$ is a rational number, then the curves of all bodies are closed, especially the curve of the last satellite.
My question concerns the other direction:
Is it true (and how to prove) that when the curve of the last satellite is closed then all periods are pairwise rationally related?



WOLOG, we will assume all $c_j \ne 0$ and $\omega_j$ are distinct.
By closed, I will assume you mean $f_n(t)$ is periodic for some period $T$. If that is the case, then all its derivatives are periodic. For $k = 1, \ldots, n$, we have $$f^{(k-1)}_n(T) = f^{(k-1)}_n(0) \quad\iff\quad \sum_{j=1}^n \omega_j^{k-1} c_j(e^{i\omega_j T}-1) = 0 $$ Let
Above equation is equivalent to $A u = 0$. For distinct $\omega_j$, $A$ has the form of a Vandermonde matrix and is known to be invertible. This leads to $u = 0$. This means for any $j = 1,\ldots, n$,
$$c_j (e^{i\omega_j T} - 1 ) = 0 \quad\implies\quad e^{i\omega_j T} = 1 \quad\implies\quad \omega_j = \frac{2\pi m_j}{T}\quad\text{ for some } m_j \in \mathbb{Z}$$
From this, we can deduce $T$ is "a" period of $f_\ell(t)$ for $\ell = 1,\ldots,n$.