Explanation:
the smallest common multiple of 15 and 18 gives us the answer.
the get the smallest common multiple we typically use prime factoring :
15 ÷ 2 no
15 ÷ 3 = 5
5 ÷ 3 no
5 ÷ 5 = 1 finish
18 ÷ 2 = 9
9 ÷ 2 no
9 ÷ 3 = 3
3 ÷ 3 = 1 finish
15 = 3×5
18 = 2×3×3
the smallest common multiple is the combination of the longest streaks per prime factor.
1 time 2, 2 times 3, 1 time 5
2×3×3×5 = 90
so, every 90 minutes they flash together.
that means the next time after 2 am would be
2 am + 90 minutes = 3:30 am