Prove that the product of any two numbers between two consecutive squares is never a perfect square

elementary-number-theorynumber theory

In essence, I want to prove that the product of any two distinct elements in the set $\{n^2, n^2+1, … , (n+1)^2-1\}$ is never a perfect square for a positive integers $n$. I have no idea on how to prove it, but I've also yet to find a counterexample to this statement. Can anyone help?

Best Answer

First, note that $n^2$ can't be one of the elements as the other element would also need to be a perfect square for the product to be a perfect square. As gnasher729 commented to the answer, this is why $\left(n + 1\right)^2$ is not included.

Assume there are $2$ such elements, $n^2 + a$ and $n^2 + b$, with $a \neq b$, $1 \le a, b \le 2n$ and, WLOG, $a \lt b$. Thus, consider their product to be a perfect square of $n^2 + c$, i.e.,

$$\left(n^2 + a\right)\left(n^2 + b\right) = \left(n^2 + c\right)^2 \tag{1}\label{eq1}$$

for some integer $a \lt c \lt b$. As such, for some positive integers $d$ and $e$, we have that

$$a = c - d \tag{2}\label{eq2}$$ $$b = c + e \tag{3}\label{eq3}$$

Substitute \eqref{eq2} and \eqref{eq3} into \eqref{eq1} to get

$$\left(n^2 + \left(c - d\right)\right)\left(n^2 + \left(c + e\right)\right) = \left(n^2 + c\right)^2 \tag{4}\label{eq4}$$

Expanding both sides gives

$$n^4 + 2cn^2 + \left(e - d\right)n^2 + c^2 + c\left(e - d\right) - ed = n^4 + 2cn^2 + c^2 \tag{5}\label{eq5}$$

Removing the common terms on both sides and moving the remaining terms, apart from the $n^2$ one, to the right gives

$$\left(e - d\right)n^2 = -c\left(e - d\right) + ed \tag{6}\label{eq6}$$

Note that $e \le d$ doesn't work because the LHS becomes non-positive but the RHS becomes positive. Thus, consider $e \gt d$, i.e., let

$$e = d + m, \text{ where } m \ge 1 \tag{7}\label{eq7}$$

Using \eqref{eq3} - \eqref{eq2}, this gives

$$b - a = e + d \lt 2n \Rightarrow 2d + m \lt 2n \Rightarrow d \lt n - \frac{m}{2} \tag{8}\label{eq8}$$

Also,

$$ed = \left(d + m\right)d \lt \left(n + \frac{m}{2}\right)\left(n - \frac{m}{2}\right) = n^2 - \frac{m^2}{4} \lt n^2 \tag{9}\label{eq9}$$

Since $e \gt d$ means that $-c\left(e - d\right) \lt 0$, the RHS of \eqref{eq6} cannot be a positive integral multiple of $n^2$, so it can't be equal to the LHS.