Finding all pairs $(m,n)$ of positive integers such that $m(n + 1) + n(m − 1) = 2013$ 
Find all pairs $(m, n)$ of positive integers such that
$$m(n + 1) + n(m − 1) = 2013$$

What I've done: I tried to make the problem simpler by $2mn+m-n$ and factoring it equals $(2m-1)(2n+1)$
Where do I go now?
 A: You started OK but you didn't see how easy it is to solve for $m$.
\begin{align*}
&m(n + 1) + n(m − 1) = 2013\\
&\implies 2 m n + m - n - 2013 = 0\\
&\implies m(2 n + 1) = n + 2013\\
&\implies m = \frac{n + 2013}{2 n + 1}\quad \land\quad 2 n + 1\ne0
\end{align*}
Since $2n$ is always even, adding or subtracting $1$ from it will never yield zero so $n\in\mathbb{N}$ but not all values of $n$ will yield integers for $m$.
For $\quad 0\le n\le 2100\quad $ there are $11$ integer pairs $(m,n)$ and these appear to be the only solutions, according the descending-m and ascending-n pattern seen here.
$$
(403,2)\quad 
(288,3)\quad  
(88,11)\quad 
(81,12)\quad 
(58,17)\quad 
(18,57)\\ 
(13,80)\quad 
(12,87)\quad 
(4,287)\quad 
(3,402)\quad 
(1,2012)\quad 
 $$
A: We have $$2mn+m-n=2013\implies4mn+2m-2n-1=4025$$
$$\implies(2m-1)(2n+1)=4025=5^2\times7\times23=1^0\times5^2\times7^1\times23^1$$
Hence there are $1\times3\times2\times2 =12$ factors that each bracket could correspond to so you have to check one bracket for each factor of $4025$, and the other bracket for each corresponding factor as you go along.
For example letting
$$2m-1=1, ~~2n+1=4025$$
yields $m=1,~n=2012$ and so on for all the other pairs of factors. Note, you don't have to look for values of $m$ and $n$ for $2n+1=1$ as that would result in a negative value for $n$ which isn't allowed by the question.
If you don't understand something, or you need any more help, please don't hesitate to ask :)
A: If you've gotten $m(n+1) + n(m-1)= 2mn + m -n$
And $(2m-1)(2n+1) = 4mn +2m - 2n - 1$ so your factoring is not correct.
However if $m(n+1) + n(m-1) = 2mn + m -n = 2013$ then
$(2m-1)(2n+1) = 4mn + 2m -2n - 1 = 2(2mn + m -n) - 1 = 2*2013 - 1 = 4025$.
So now it's a matter of prime factoring $4025$.
Clearly $25|4025$ so $4025 =  161*5^2$ and $161=7*23$ so $4025 = 5^2*7*23$ and so
$(2m-1)(2n + 1) = 5^2 *7*23$ so you have the following problems to solve.
If you break $4025= 5^2*7*23$ into two factors, $4025 = A*B$ you will be get several ($24$) sets of equations to solve and several ($24$) pairs of solutions..
$2m-1 = A$ and $2n+1 = B$ so $m = \frac {A+1}2$ and $n = \frac {B-1}2$.
Where $(A,B) = $
$(1, 4025)$
$(5, 805)$
$(7, 575)$
$(23, 175)$
$(25, 161)$
$(35, 115)$,
..... etc..... (Don't forget the reverse pairs $A = 4025$ and $B=1$ and $A=805$ and $B = 5$ as well as $A=1; B=4025$ and $A=5;B=805$)....
