# If $m$ and $n$ are odd positive integers, then $n^2+m^2$ is not a perfect square.

True of False: If $$m$$ and $$n$$ are odd positive integers, then $$n^2+m^2$$ is not a perfect square.

Anyway it is already appear here,but I want check my solution!

The statement is true, because , suppose $$n^2+m^2=k^2$$ Then $$n^2=k^2-m^2=(k-m)(k+m)$$. Here divisors of $$n^2$$ are $$1,n,n^2$$, so either

• $$k-m=1$$ and $$k+m=n^2$$
• $$k-m=n$$ and $$k+m=n$$
• $$k-m=n^2$$ and $$k+m=1$$

Suppose the first bullet is true. Then $$m=\frac{(n-1)(n+1)}{2}$$, an even number,since $$n-1$$ and $$n+1$$ are even. Contradict the fact $$m$$ is odd. Similarly we get contradictions of latter two. Hence the statement is true.

Is this correct? If not,what I'm doing wrong ?

Edit:I realize my mistake. If $$n$$ is prime, then my count is correct. Kindly add other information about this to your answer if you wish

No, that is not correct. We don't know much about $$n$$, so it is very likely to be composite - which then means that $$n^2$$ would have more factors than those listed. Factor $$n^2$$ in some other way, and it all breaks down.
• Oh sorry,if $n$ is prime, then my count is correct! Am i right? – Chinnapparaj R Dec 24 '18 at 11:55
Every odd positive interger $$n$$ can be written as $$n =2m+1$$ where $$m$$ is an interger and $$m \geqslant 0$$. So let $$\tilde{n}=2n+1$$ and $$\tilde{m} = 2m+1$$. So $$\tilde{m}^2+ \tilde{n}^2 = (2n+1)^2 + (2m+1)^2= 4n^2 +4n +1 +4m^2 + 4m + 1$$ =$$2(2n^2+2m^2+2m+2n+1)$$
Call what is inside the parenthesis $$\alpha$$, so $$\sqrt{\tilde{m}^2+ \tilde{n}^2}= \sqrt{ 2\alpha} = \sqrt {2} \sqrt{\alpha}$$. Clearly, $$\alpha$$ id odd, so we can't cancel out the $$\sqrt{2}$$ factor, so it cant't be a perfect square.