Struggling to solve an equation containing a floor function
Solution 1:
$$ 2\lfloor{(x+1)^2+8}\rfloor=(x+1)(2x+3) \tag{1} $$
Let $~~(x+1) = P + r ~: ~P \in \Bbb{Z}, ~0 \leq r < 1.$
Then, in (1) above,
the LHS equals
$\displaystyle 2\lfloor (P + r)^2 + 8\rfloor =
2P^2 + 16 + 2\lfloor 2Pr + r^2\rfloor$
and the RHS equals
$\displaystyle (P+r)(2P+2r+1) = 2P^2 + 4Pr + 2r^2 + P + r.$
Therefore
$~~\displaystyle
(P - 16) + (4Pr + 2r^2 + r) = 2\lfloor 2Pr + r^2\rfloor.$
Therefore
$$2(2Pr + r^2) - 2\lfloor 2Pr + r^2\rfloor
= (16 - P - r). \tag2$$
Note
For any Real Number $s$, you must have that
$0 \leq \left(s - \lfloor s \rfloor \right) < 1.$
This implies that $0 \leq 2s - 2\lfloor s\rfloor < 2.$
Therefore, in (2) above, $0 \leq LHS < 2.$
Therefore, either $~P = 15, ~$ or $~P = 14$.
Edit
$P = 16, r = 0$ also satisfies the constraints.
Further, in (2) above,
$\displaystyle \lfloor 2Pr + r^2\rfloor =
\lfloor r(2P + r)\rfloor \leq \lfloor 2P + r\rfloor = 2P.$
Therefore, $~~2\lfloor 2Pr + r^2\rfloor \leq 4P$.
Therefore, there must exist some $k \in \{0,1,2,\cdots,4P\}$ such that $k = 2\lfloor 2Pr + r^2\rfloor.$
$\underline{\text{Case 1: }~P = 15}$
Examining (2) above, $~~P = 15 \implies ~\exists ~k \in \{0,1,2,\cdots,60\}$ such that
$\displaystyle 2(30r + r^2) - k = 1-r.$
This implies that
$\displaystyle 2r^2 + 61r - (k+1) = 0 \implies $
$\displaystyle
r = \frac{1}{4} \left[-61 \pm \sqrt{61^2 + 8k + 8}\right].$
Since $r \geq 0$, this implies that
$\displaystyle
r = \frac{1}{4} \left[\sqrt{61^2 + 8k + 8} - 61\right]
= \frac{1}{4} \left[\sqrt{3729 + 8k} - 61\right] ~: ~k \in \{0,1,\cdots, 60\}.$
Here, since $(x + 1) = P + r = 15 + r$,
you have that $x = 14 + r.$
The Case 1 candidate solutions are
- $x = 14 + r$.
- $r = \frac{1}{4} \left[\sqrt{3729 + 8k} - 61\right]$.
- $k \in \{0,1,2,\cdots,60\}$.
On the RHS of (1) above, you have
$(15 + r) (31 + 2r) = 465 + 61r + 2r^2 = 465 + (k + 1) = 466 + k.$
Therefore, values of $k \in \{0,1,2,\cdots, 60\}$ must be inspected with respect to the LHS of equation (1) above, to see if they match the RHS of equation (1) above.
On the LHS of equation (1) above,
$(15 + r)^2 + 8 = 233 + 30r + r^2 \implies $
the LHS of equation (1) equals
$(2 \times 233) + 2\lfloor r^2 + 30r\rfloor.$
As $k$ ranges from $0$ through $60$, $r$ will be strictly between $0$ and $1$.
From the analysis, $2r^2 + 61r = (k+1)$.
Further, $~-1 < -r < 0 \implies k < 2r^2 + 60r < k+1.$
Therefore, $\displaystyle \frac{k}{2} < r^2 + 30r < \frac{k + 1}{2}$.
Therefore $\displaystyle\left\lfloor \frac{k}{2} \right\rfloor = \lfloor r^2 + 30r\rfloor.$
Therefore, if $k$ even, you have that $2\lfloor r^2 + 30r\rfloor = 2 \times \lfloor\frac{k}{2}\rfloor = 2 \times \frac{k}{2} = k.$
However, if $k$ odd, you have that $2\lfloor r^2 + 30r\rfloor = 2 \times \lfloor\frac{k}{2}\rfloor = 2 \times \frac{k-1}{2} = k-1.$
Therefore, in Case 1, the LHS of equation (1) above will match the RHS of equation (1) above only if $k$ is even.
Therefore, the Case 1 solutions are
- $x = 14 + r$
- $r = \frac{1}{4} \left[\sqrt{3729 + 8k} - 61\right]$
- $k \in \{0,2,4,6,\cdots,60\}$
$\underline{\text{Case 2: }~P = 14}$
Examining (2) above, $~~P = 14 \implies ~\exists ~k \in \{0,1,2,\cdots,56\}$ such that
$\displaystyle 2(28r + r^2) - k = 2-r.$
This implies that
$\displaystyle 2r^2 + 57r - (k+2) = 0 \implies $
$\displaystyle
r = \frac{1}{4} \left[-57 \pm \sqrt{57^2 + 8k + 16}\right].$
Since $r \geq 0$, this implies that
$\displaystyle
r = \frac{1}{4} \left[\sqrt{57^2 + 8k + 16} - 57\right]
= \frac{1}{4} \left[\sqrt{3265 + 8k} - 57\right] ~: ~k \in \{0,1,\cdots, 56\}.$
Here, since $(x + 1) = P + r = 14 + r$,
you have that $x = 13 + r.$
The Case 2 candidate solutions are
- $x = 13 + r$.
- $r = \frac{1}{4} \left[\sqrt{3265 + 8k} - 57\right]$.
- $k \in \{0,1,2,\cdots,56\}$.
On the RHS of (1) above, you have
$(14 + r) (29 + 2r) = 406 + 57r + 2r^2 = 406 + (k + 2) = 408 + k.$
Therefore, values of $k \in \{0,1,2,\cdots, 56\}$ must be inspected with respect to the LHS of equation (1) above, to see if they match the RHS of equation (1) above.
On the LHS of equation (1) above,
$(14 + r)^2 + 8 = 204 + 28r + r^2 \implies $
the LHS of equation (1) equals
$(2 \times 204) + 2\lfloor r^2 + 28r\rfloor.$
As $k$ ranges from $0$ through $56$, $r$ will be strictly between $0$ and $1$.
From the analysis, $2r^2 + 57r = (k+2)$.
Further, $~-1 < -r < 0 \implies k+1 < 2r^2 + 56r < k+2.$
Therefore, $\displaystyle \frac{k+1}{2} < r^2 + 28r < \frac{k + 2}{2}$.
Therefore $\displaystyle\left\lfloor \frac{k+1}{2} \right\rfloor = \lfloor r^2 + 28r\rfloor.$
Therefore, if $k$ even, you have that $2\lfloor r^2 + 28r\rfloor = 2 \times \lfloor\frac{k+1}{2}\rfloor = 2 \times \frac{k}{2} = k.$
However, if $k$ odd, you have that $2\lfloor r^2 + 28r\rfloor = 2 \times \lfloor\frac{k+1}{2}\rfloor = 2 \times \frac{k+1}{2} = k+1.$
Therefore, in Case 2, the LHS of equation (1) above will match the RHS of equation (1) above only if $k$ is even.
Therefore, the Case 2 solutions are
- $x = 13 + r$
- $r = \frac{1}{4} \left[\sqrt{3265 + 8k} - 57\right]$
- $k \in \{0,2,4,\cdots,56\}.$