I am designing a planetary system for a role playing game with 3 moons with different orbits. I have created an excel spreadsheet to plan a day in the "current" year where all three moons are in the "new moon" or hidden from the planet stage but I wanted to know how to calculate just how rare this event was. I would like a general purpose solution. I realize that with certain moon orbits the solution is simply it can't be possible (for example if they all have the same orbit).
I know that the system of equations for this problem is the following
$$M_1(t) = \left| (t + S_1 \mod P_1) - \frac {P_1}2\right|$$ $$M_2(t) = \left| (t + S_2 \mod P_2) - \frac {P_2}2\right|$$ $$M_3(t) = \left| (t + S_3 \mod P_3) - \frac {P_3}2\right|$$
Where:
$$M_1,M_2,M_3\text{ represent the current phase of the moon on a given day}$$ $$S_1,S_2,S_3\text{ represent the position of the moon at t=0}$$ $$P_1,P_2,P_3\text{ represent how many days it takes the moon to orbit the planet}$$
And I want to know for what values of t does $M_1=M_2=M_3=0$
As I said, I want a general formula if it exists (or at least a mechanism for solving it) to determine the period. But I would be happy with just a specific solution for $$S_1=4,S_2=20,S_4=18,P_1=14,P_2=30,P_3=34$$
EDIT: I had the wrong formula for the current phase, I forgot that it goes up and then down and not immediately back to 0
EDIT 2: I might be completely wrong about this whole methodology using this system of complex equations...if that's the case, I really just want to know the answer to my question "How often does a planet with 3 moons have no moon in the sky?"