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

let $m,n$ are positive integer numbers,and such $m<n$,if

$$p=\dfrac{n^2+m^2}{\sqrt{n^2-m^2}}$$ is prime number.

show that $$p\equiv 1 \pmod 8$$

My try: let $$p=\dfrac{n^2+m^2}{\sqrt{n^2-m^2}}=\dfrac{n^2-m^2+2m^2}{\sqrt{n^2-m^2}}=\sqrt{n^2-m^2}+\dfrac{2m^2}{\sqrt{n^2-m^2}}$$ Then I can't

share|cite|improve this question
up vote 1 down vote accepted

If $p$ divided either of $n$ and $m$, then it must also divide the other, so dividing by $p$ yields (with $n = p\nu,\, m = p\mu$)

$$1 = \frac{\nu^2 + \mu^2}{\sqrt{\nu^2-\mu^2}},$$

from which it follows that $\nu = 1,\, \mu = 0$ contradicting the positivity of $n$ and $m$. So $p$ divides neither $n$ nor $m$.

Now, for


to be an integer, we must have

$$n^2 - m^2 = k^2,$$

and hence

$$n^2 + m^2 = k^2 + 2m^2.$$

$p = 2$ is impossible, since $\dfrac{n^2+m^2}{\sqrt{n^2-m^2}} > \sqrt{n^2+m^2}$, which would force $n = m = 1$ to have $\sqrt{n^2+m^2} < 2$. So $p$ is an odd prime.

$p \mid n^2 + m^2$ implies that $-1$ is a quadratic residue modulo $p$, so $p \equiv 1 \pmod{4}$.

$p \mid k^2 + 2m^2$ implies that $-2$ is a quadratic residue modulo $p$, so $p \equiv 1 \pmod{8}$ or $p \equiv 3 \pmod{8}$. Since we have $p \equiv 1 \pmod{4}$ from above, it follows that $p \equiv 1 \pmod{8}$.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.