By assumption, there is an integer t such that n2−1=t(m2+1−n2). Put k=t+1. It is clear that k=0. We have k(n2−1)=tm2. Note that (k,t)=1 we get there is an integer l such that n2−1=lt (which gives l=m2+1−n2) and m2=lk=k(m2+1−n2)=(t+1)(m2+1−n2). Therefore, it suffices to prove that k is a perfect square.
Let S be the set of ordered pairs (x,y) of integers such that
(x+y)2=k(1+4xy).
Then, the pair (2m+n,2m−n)∈S, and this shows that S is non-empty. Put
a=min{∣x∣;∃(x,y)∈S}.
We show that a=0 whence k=y2.
If (x,y)∈S⇒(−x,−y)∈S, then (a,y)∈S. We have (a+y)2=k(1+4ay). The two roots b1,b2 of the equation are integers with ∣b1∣,∣b2∣⩾a. (Since (a,bi)∈S⇒(bi,a)∈S ). On the other hand,
b1+b2=4ak−2a,b1b2=a2−k.
We get (a+b1)(a+b2)=(4a2−1)k.
If k<0 then b1b2>0,b1+b2⩽0⇒b1,b2<0. Since ∣bi∣>a, it follows that a+bi<0⇒(a+b1)(a+b2)>0. This means that (4a2−1)k>0. Since k<0, we get a=0. Now, assume that k>0 and a=0 (a>0).
In this case, b1+b2>0,(a+b1)(a+b2)>0⇒b1,b2>0. By the choice of a, we get a2⩽b1b2, which contradicts to the equality b1b2=a2−k. So a=0.