Finding integer solution to a quadratic equation in two unknowns 
We have an equation:
  $$m^2 = n^2 + m + n + 2018.$$
  Find all integer pairs $(m,n)$ satisfying this equation. 


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 .
