# solving for $P=a^{2}+b^{2}$

Fermat's Two-Square Theorem:
Given a prime $p$, there exist integers $a, b$ such that $a^2 + b^2 = p$ iff $p = 2$ or $p \equiv 1 \bmod 4$. Consequently, a number $n$ is expressible in the form $a^2 + b^2$ iff the primes congruent to $3 \bmod 4$ in its prime factorization each divide $n$ an even number of times.

But for example, if we take $49$ whose prime factorisation is $7^2$, all the primes congruent to $3 \bmod 4$ have their power as even, so $49$ should be expressible as sum of squares of two integers, although $49$ can't be expressed as $a^2 + b^2$.

• Note that $49=0^2+7^2$ – Mark Bennet Oct 3 '15 at 11:30
• that was helpful . – rahul_mishra01 Oct 3 '15 at 17:49

## 2 Answers

As Mark Bennet points out, $49$ can be written as the sum of two squares, namely $49 = 7^2+0^2$.

Since $49$ is obviously equal to the sum of two squares, $0^2 + 7^2$, perhaps Rahul meant to say that there exist no integers for $a$ and $b$ in the equation $a^2 + b^2 = 49$ such that $(a,b) > 0$. Perhaps it would be better to say that there exists no such "natural number" for $a$ and $b$ since $0$ is not a natural number. In fact, all numbers equal to and below $0$ are not natural numbers, but we know for any number $n$, $n^2 = (-n)^2$.