Finding integer solution to a quadratic equation in two unknowns

702 Views Asked by At

We have an equation: $$m^2 = n^2 + m + n + 2018.$$ Find all integer pairs $(m,n)$ satisfying this equation.

3

There are 3 best solutions below

0
On

Hint $$ (m+n)(m-n)= (m+n)+2018$$

so $$ (m+n)(m-n-1)= 2018$$

0
On

Guide: Write $m=n+k$ for some integer $k$, then $$n^2+2nk+k^2= n^2+2n+k+2018$$

so $$ n={-k^2+k+2018\over 2(k-1)}=-{k\over 2}+{1009\over k-1}$$

If $k$ is odd then there is no solution, so $k= 2s$ so $$2s-1\mid 1009$$

Can you finish?

0
On

Simpler start: separating variables to either side gives: $$m^2-m=n^2+n+2018$$ which then factors roughly for the variables as: $$m(m-1)=n(n+1)+2018$$

which since both pairs(m,m-1) and (n,n+1) are consecutive integers, you can divide both sides by two giving:

$$\frac{m(m-1)}{2}=\frac{n(n+1)}{2}+1009$$

But, $\frac{y(y+1)}{2}$ is the form of the y-th triangular number, so the solutions are such that 1009 is the difference of two triangular numbers $T_{\vert m-1 \vert}$ and $T_{\vert n \vert}$ . Solve for n, and m-1 .