Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
$a^2-b^2 = x$ where $a,b,x$ are natural numbers

I'm trying to find all the $(m,n)$ pairs that satisfy $m^2-n^2=r$, where $r$ is a given positive odd integer, $m>n>0$, $\gcd (m,n) =1$, and $m$ and $n$ are of opposite parity.

For example: Given $m^2-n^2=21$, I'm supposed to figure out that the only solutions are (5,2) and (11,10).

My course materials state that that the method is to systematically try $n=1,2,3,...,10$ (i.e. $1\leq n<\frac r2=\frac{21}2$). But why can't $n$ exceed $\frac r2$?

On a related note, for $m^2+n^2=r$ satisfying the same conditions as above, I can see that $1\leq n<\sqrt \frac r2$. (Please correct me if I'm wrong about this.)

Thank you.

share|cite|improve this question

marked as duplicate by ShreevatsaR, Phira, Thomas, Henry T. Horton, Emily Nov 1 '12 at 16:08

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

up vote 3 down vote accepted

If $(m+n)(m-n)=d$ and we take $m>n>0$, we can see that the largest difference between the two factors occurs when $m+n=d$, and $m-n=1$.

Taking the difference we get $2n=d-1$ so that the greatest possible value of $n$ is $\frac {d-1}2$.

share|cite|improve this answer
Thank you, Mark. – Ryan Nov 1 '12 at 15:06

The differences between squares increase as the squares themselves increase. If $n,\ m > 10$ then the smallest difference possible is $$12^2 - 11^2 = (12 - 11)(12 + 11) = 23$$ which is already larger than your answer.

By the way, these are not Pythagorean triples.

share|cite|improve this answer
Thank you, EuYu. – Ryan Nov 1 '12 at 15:20

Not the answer you're looking for? Browse other questions tagged or ask your own question.