I'm trying to convert between pagination by starting index $i$ & length $l$ and pagination by page number $p$ & page size $s$. I've gotten far enough to know that:
for given $i$ and $l$ such that $ i\gt l $: $$\frac {i+l}{1+\lfloor \frac is \rfloor} \le s$$
How can I find the minimum $s$ for that inequality?
EDIT: Also, $ \{i,l,p,s\} \in \Bbb N$
$$i+l\le s-s\left\lfloor\frac is\right\rfloor=2s-i\bmod s.$$
Unfortunately, the function on the RHS is quite irregular. IMO exhaustive search is needed.