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

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.


For any two numbers $n^2+a,\ n^2+b;\ 0<a<b<(2n+1)$, their product will satisfy $n^4<n^4+(a+b)n^2+ab<(n^2+2n+1)^2$.

All of the squares between $n^4$ and $(n^2+2n+1)^2$ will have the form $(n^2+m)^2=n^4+2mn^2+m^2;\ 1\le m\le 2n$

If $n^4+(a+b)n^2+ab$ is a perfect square, it will be one of the squares between $n^4$ and $(n^2+2n+1)^2$ and hence equal to $n^4+2mn^2+m^2$ for some $m$.

Thus $(a+b)=2m;\ ab=m^2$ for some $m$

Rearranging, we get $m^2=\frac{a^2+2ab+b^2}{4}=ab=\frac{4ab}{4}$, or $a^2+b^2=2ab$.

This implies both $a\mid b$ and $b\mid a$, meaning $b=a$ and the numbers being multiplied to obtain a perfect square are not distinct.

Added by edit: John Omielan comments (for the specific case $k=1$) that my original answer fails to consider possible solutions of the form $a+b=2m-k;\ ab=m^2+kn^2$. He separately provides a more complete answer that addresses those cases. Marty Cohen comments that I can only properly conclude $n^4+(a+b)n^2+ab=n^4+2mn^2+m^2 \Rightarrow n^2(a+b-2m)=(m^2-ab)$. Let me address those shortcomings.

If $(n^2+a)(n^2+b)=(n^2+m)(n^2+m)$ then either $a=b=m$ (addressed in my original answer) or $a<m<b$ (which this edit will address). If $n^2(a+b-2m)=(m^2-ab)$, then $(m^2-ab)$ is divisible by $n^2$, so $(m^2-ab)=kn^2=n^2(a+b-2m)$, or $(a+b-2m)=k\Rightarrow a+b=2m+k$.

$m,a,b$ have limits on their sizes. $m<b\le 2n\Rightarrow m^2< 4n^2$. Also $a<b\le2n \Rightarrow ab<4n^2$ Hence, $|(m^2-ab)|<4n^2 \Rightarrow |k|=(a+b-2m)<4$. For $(a+b)=2m+k,\ |k|=0,1,2,3$, where $k=0$ corresponds to the case where $a=b=m$.

The midpoint $t$ between $a$ and $b$ is the average $t=\frac{a+b}{2}$. Let $b-t=r,\ t-a=r$. Note that if $a$ and $b$ have different parity, $t$ and $r$ may have half integral values. Finally, $b-a=2r$, but since $b\le2n,\ a\ge 1$, then $2r=b-a<2n\Rightarrow r<n$.

$(n^2+a)(n^2+b)=((n^2+t)-r)((n^2+t)+r)=(n^2+t)^2-r^2$. Therefore, unless $m>t$, $(n^2+a)(n^2+b)<(n^2+m)^2$. But $t=\frac{a+b}{2}=m-\frac{k}{2}$. $m-t=\frac{1}{2},1,\frac{3}{2}$. Within the constraints of the original question, $m$ must be larger than the average of $a$ and $b$, but it must be very close to that average.

Substituting $t-\frac{k}{2}$ for $m$ in $(n^2+m)^2$, we get $((n^2+t)-\frac{k}{2})^2$. Can that equal $(n^2+a)(n^2+b)=((n^2+t)-r)((n^2+t)+r)=(n^2+t)^2-r^2$? Letting $s=(n^2+t)$ for simplicity in keeping track during expansion, we ask whether $(s-\frac{k}{2})^2=(s-r)(s+r)=s^2-r^2\Rightarrow ks-\frac{k^2}{4}=r^2\Rightarrow k(n^2+t)-\frac{k^2}{4}=r^2$?

$r<n\Rightarrow r^2<n^2$. It is obvious for $3\ge k>1$ that $k(n^2+t)-\frac{k^2}{4}>n^2>r^2$. For $k=1$, $n^2+t-\frac{1}{4}>n^2 \iff t>\frac{1}{4}$. For $a<m<b$, $\min(a+b)=4 \Rightarrow \min(t)=2; 2>\frac{1}{4}$.

There are no solutions to the question for $a<m<b$.