I've been trying to prove the following, for $A \geq B$, both are strictly positive integers: $$A - \lfloor A/B \rfloor - \lceil A/B \rceil \leq (\lfloor A/B \rfloor + 1) \times B$$ Not sure if it's true. Can't find a counterexample so far. Anyone has an idea?
2 Answers
$ \newcommand{\f}[1]{\left\lfloor #1 \right\rfloor} \newcommand{\c}[1]{\left\lceil #1 \right\rceil} $ Note that $\f{A/B} \leq \c{A/B}$, so: $$ A - \f{A/B} - \c{A/B} \leq A - 2\f{A/B} \\ (\f{A/B} + 1)B = \f{A/B}B + B \geq (A/B - 1)B + B = A $$ Thus the inequality clearly holds as $\f{A/B} > 0$.
-
$\begingroup$ Thanks! I have another question here that I tried proving using a similar technique as well but didn't seem to work. math.stackexchange.com/questions/3797351/… $\endgroup$– NickAug 20, 2020 at 10:47
$A\ge B\implies\lfloor A/B \rfloor\ge 1$ and $\lceil A/B \rceil\ge 1$ $$A-\lfloor A/B\rfloor - \lceil A/B \rceil <A=A/B\times B\le \lceil A/B\rceil \times B \le (\lfloor A/B \rfloor +1)\times B$$
where the last inequality holds since $\lceil A/B \rceil = \lfloor A/B \rfloor $ if $A$ is divisible by $B$, otherwise $A/B$ is not an integer and $\lceil A/B \rceil = \lfloor A/B \rfloor +1$.