Find the number of pairs $(m, n)$ of positive integers such that $\frac{ m}{n+1} < \sqrt{2} < \frac{m+1}{n}$ Find the number of pairs $(m, n)$ of positive integers such that $\frac{ m}{n+1} < \sqrt{2} < \frac{m+1}{n}$ Constraint: $m$ and $n$ are both less than or equal to 1000
I toiled over this problem for a bit. I tested the first few positive integers of m and found the corresponding values of $n$, but no real pattern seemed to emerge. Clearly $m \ge n$ . I believe that for each value of $m$, there were either two or one value(s) for $n$ in no clear order, which is the part that is messing me up. This is meant to be done by hand so I have not used any software on it.

I don't understand. Why such complexity?    
Inequality:  $$\frac{m}{n+1}<\sqrt{2}<\frac{m+1}{n}$$  
This is equivalent to the inequality :  
$$n\sqrt{2}-1<m<n\sqrt{2}+\sqrt{2}$$  
It is easy to see that one is " $n$ " - corresponds to one value " $m$ ".  
Or let's different.  $$\frac{m}{\sqrt{2}}-1<n<\frac{m+1}{\sqrt{2}}$$  
Set the number  " $m$ " - and integer " $2n$ " - and will be the number of all possible pairs.
$$1+\sqrt{2}=2,4142$$
So the number  of all possible pairs given " $m$ ".   't care. " $ 2n $ "  .
