A binary array $t = [t_1, t_2, t_3, t_4, t_5]$ with each element a binary integer variable taking values 0 or 1. You can think this vector as slots with 1 representing the slot being taken and 0 otherwise.
Constraints: Now 2 appointments need to be scheduled with the first one taking 1 slot and the second one taking 2 slots. The second appointment must be scheduled at or after the second slot ($t_2$).
Objective: Maximize the number of consecutive zeros in array $t$.(Intend to leave a long range empty slots for future planning)
Solutions: One of the optimal solutions is to put first appointment into $t_1$ and the second appointment into $t_2$ and $t_3$, $t = [1,1,1,0,0]$, which has a consecutive zero number 2. A feasible but non-optimal solution is to put first appointment into $t_1$ and the second appointment into $t_3$ and $t_4$, $t=[1,0,1,1,0]$, which has a consecutive zero number 1.
Optimal Constraints: How to formulate the question in a linear/integer/mixed-integer way that can be solved by an optimization solver? Constraints can be definitely formulated in a linear integer way but I am having a hard time for the objective.