Finding when two repeating cycles next coincide
Two cycles of 12 and 18 ticks that both begin at tick zero meet again at tick 36, the least common multiple. This guide shows the method and where it stops working.
When two repeats line up again
A cycle that repeats every 12 ticks produces events at 12, 24, 36 and so on. A cycle of 18 ticks produces events at 18, 36, 54 and so on. The first tick at which both have an event is 36, the smallest positive number that appears in both lists. That number is the least common multiple of 12 and 18. Questions of this kind show up in schedules, such as two machines with different service intervals, two lights flashing at different rates, or two bus routes leaving a depot together. The LCM calculator returns the answer directly for two integers, and the basic calculator checks how many cycles of each kind fit before the meeting.
Computing the LCM of 12 and 18
One route lists multiples. The multiples of 12 are 12, 24, 36, 48, and the multiples of 18 are 18, 36, 54, so the first match is 36. A faster route uses the greatest common divisor. The GCD of 12 and 18 is 6, and the LCM equals the product divided by the GCD: 12 times 18 is 216, and 216 divided by 6 is 36. The calculator uses the second formula, lcm(a, b) equal to the absolute value of a times b divided by gcd(a, b). The relation works because the product counts the shared factors twice, and dividing by the GCD removes the repeat.
Counting cycles to the meeting point
The meeting tick can be checked by dividing by each cycle length. Dividing 36 by 12 gives 3, so the first cycle completes three intervals. Dividing 36 by 18 gives 2, so the second completes two intervals. Both answers are whole numbers, which is the property that defines a common multiple. If either division left a remainder, the tick would not be a shared event. The counts 3 and 2 also have no common factor other than 1, which shows that 36 is the first meeting and not a later one. If the counts shared a factor, dividing both by it would give a smaller common tick. For example, a tick of 72 would give counts of 6 and 4, which share the factor 2, and halving them leads back to 36. The coprime counts are the signature of the least common multiple.
Other pairs and their meetings
Coprime cycle lengths meet only at their product. Cycles of 7 and 9 ticks share no factor, so they meet at 63. Cycles of 4 and 6 meet at 12, not at 24, because they share the factor 2. Bus routes leaving every 15 and 20 minutes from the same stop at the same moment meet again after 60 minutes. Cycles of 24 and 36 meet at 72. When one cycle length divides the other, such as 5 and 10, the longer one is the LCM. These patterns are quick to check with the calculator and give a feel for how shared factors shorten the wait.
The role of the common start
Everything above assumes both cycles have an event at tick zero. If they begin together, the events of each are multiples of its length, and the LCM is the first common multiple. If the second cycle starts at a different tick, its events are offset, and the common multiple no longer locates the first shared event. The LCM still gives the length after which the whole pattern repeats, but whether the two cycles ever coincide depends on the offset. The worksheet therefore states the shared start as a condition, not as a detail.
What an offset does
Suppose the 18-tick cycle starts at tick 5 so its events fall at 5, 23, 41 and so on, while the 12-tick cycle keeps events at 12, 24, 36. An event of the first cycle sits at 12a for a whole number a, and an event of the second at 5 plus 18b. Both 12a and 18b are multiples of 6, so their difference is a multiple of 6, and 5 is not. The cycles never coincide. In general two such cycles can meet only if the offset is a multiple of the GCD of the lengths, and in that case the first meeting needs a different calculation than the LCM alone.
Integer ticks and real calendars
The model uses ideal integer ticks and exact cycle lengths. Calendars break that. Months have 28 to 31 days, years sometimes have 366, daylight saving shifts local clocks and time zones change the offset. A weekly meeting and a monthly report do not form a cycle of fixed length. Even a 7-day cycle and a 30-day cycle starting together would meet after 210 days by the arithmetic, but a real calendar date is also affected by holidays and rescheduling. Use the LCM for abstract or regular cycles such as machine counters, and use a calendar tool for human dates.
Fractional or irregular cycles
Cycle lengths that are not whole numbers can still be handled by converting to a common unit. Cycles of 1.5 and 2.5 hours become 3 and 5 half-hours, whose LCM is 15 half-hours, or 7.5 hours. Irrational ratios never meet, and cycles whose lengths drift over time do not have a fixed LCM at all. If the lengths come from measurements, they are approximate, and a computed LCM can be very large and sensitive to small errors. The tool expects integers, so the conversion step is part of the work.
Sanity checks on the result
The LCM is at least as large as the larger input and at most the product of the two. For 12 and 18 that range is 18 to 216, and 36 lies inside it. The LCM is always divisible by both lengths. If one length divides the other, the LCM equals the larger one. If the lengths are coprime, it equals the product. These rules take a moment to apply and catch typing errors such as entering 21 for 12. A result outside the range, or one that does not divide cleanly by both, signals a wrong input. Another check uses the GCD relation. The product of the two lengths must equal the GCD times the LCM, so 12 times 18, which is 216, equals 6 times 36. If your own result breaks that equality, the GCD or the LCM was computed wrongly. Lengths of 1 reduce the question to the other length, and a length of zero has no multiples beyond zero, so the tool is meant for positive integers.
Reproduce the checks
Next shared tick
Open the LCM calculator and enter:
- First integer
12- Second integer
18
Expected output:
Least common multiple
36Both cycles share tick zero.
Count twelve-tick intervals
Open the Basic calculator and enter:
- First number
36- Second number
12- Operation
divide
Expected output:
Result
3The first cycle completes three intervals.
Count eighteen-tick intervals
Open the Basic calculator and enter:
- First number
36- Second number
18- Operation
divide
Expected output:
Result
2The second completes two intervals.
References and implementation scope
The examples describe the behavior of the linked Computandum tools. A successful local check does not establish that another application accepts the same format or applies the same limits.