I am trying to calculate if a specific minute is within a pomodoro (work interval) or if it's within a rest interval. Assuming I am taking breaks in the following intervals:
- Work for 25 minutes (Pomodoro).
- Rest for 5 minutes.
- Go to step one until four pomodoros have passed.
- Once four pomodoros have passed, instead of resting for 5 minutes, rest for 30.
My first Pomodoro would be $0..25$ and my first small rest in $25..30$. The first ample rest would be in the range of $115..140$.
To calculate if a minute is in rest, I could divide the given minute by the minute when the first rest ends and check if the remainder is greater or equal to the minute where that rest started:
\begin{align*} \text{inShortBreak}(m) &= m \bmod 30 \geq 25 \\ \text{inLongBreak}(m) &= m \bmod 140 \geq 115\end{align*}
The problem is that the fifth Pomodoro would be in the $140..165$ range, but according to the previous functions, there would be another small rest at minute 145.
My question is: How can I calculate if a given minute is within the work/rest ranges?
P.D.: I mostly do programming, and I don't have much experience with math. I am sorry if I used the wrong concepts when explaining my problem.