It follows pretty clearly that the difference of two consecutive squares is given by $$(a + 1)^2 - a^2 = 2a + 1.$$ My question is whether there exists a general relationship between floor functions $$ \left\lfloor \frac{(a + 1)^2}{d}\right\rfloor - \left\lfloor \frac{a^2}{d}\right\rfloor $$ where $a$ is a positive integer and $ 1 < d < a^2$.
2026-03-31 17:45:14.1774979114
On
Difference of consecutive square floor functions.
67 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
2
There are 2 best solutions below
0
On
Let $a^2=qd+r$ where $q,r$ are the quotient and the remainder of $a^2$ on division by $d$. Our expression becomes:
$$\lfloor \frac{qd+r+2a+1}{d}\rfloor - \lfloor \frac{qd+r}{d}\rfloor$$ $$=q+\lfloor (r+2a+1)/d \rfloor -q-\lfloor r/d \rfloor=\lfloor (r+2a+1)/d \rfloor$$
Which written in terms of $a,d$ only is: $\lfloor (a^2 \mod d+2a+1)/d \rfloor$. I'm not sure if you had something else in mind.
As Robert pointed out, since $r/d$ is less than $1$, we have this inequality:
$$\lfloor (2a+1)/d \rfloor \leq$$ $$\lfloor (a^2 \mod d+2a+1)/d \rfloor\leq$$ $$ 1+\lfloor (2a+1)/d \rfloor$$
Let $f(x) = \lfloor x^2/d \rfloor$.
Thus $x^2/d - 1 < f(x) \le x^2/d$. So $$ \frac{(a+1)^2}{d} - \frac{a^2}{d} - 1 < f(a+1) - f(a) < \frac{(a+1)^2}{d} - \frac{a^2}{d} + 1 $$ i.e. $$ \frac{2a+1}{d} - 1 < f(a+1) - f(a) < \frac{2a+1}{d} + 1 $$