0

I know all primes, $p\equiv 1{\pmod 4}$ are the sum of two squares https://en.wikipedia.org/wiki/Fermat%27s_theorem_on_sums_of_two_squares

I vaguely recall that all composite integers, $x\equiv 1{\pmod 4}$ can also be expressed as the sum of two squares (and in more than one way), but I can’t remember, or find, a proof.

It’s certainly true all the examples I’ve tried, but please will somebody point me to a simple proof?

Update 10th August 2017 I can agree, at a push, that the candidate duplicate does provide an answer to this question, but I fail to see that it’s reasonable to expect me to recognise $$n = p_1.p_2.p_3 \cdots p_k.m^2$$ and $$x\equiv 1{\pmod 4}$$ as having the same meaning, especially as it was not flagged when I entered the question.

However, my question has been fully answered, so it matters little.

I apologise, both for posting and for forgetting such an elementary fact.

Old Peter
  • 1,357

2 Answers2

2

An odd integer greater than $1$ is the sum of two squares if and only if every prime factor of the form $4k+3$ in the factorization occurs with a power with even exponent.

Since the product of two distinct prime numbers of the form $4k+3$ results in a number of the form $4k+1$, such a product is a counterexample.

Peter
  • 84,454
1

As it has been shown in comments, it is not true that every positive integer $\equiv 1\pmod 4$ is the sum of two squares. The theorem that you are looking for says:

A positive, odd integer $n$ is the sum of two squares if and only if every prime $p\mid n$ is congruent to $1$ modulo $4$ or has even exponent in the factorization of $n$.

ajotatxe
  • 65,084
  • You can do even also... for any $n$, you just need if $p \mid n$ and $p \equiv 3 \pmod{4}$, then the exponent of $p$ is even. – mathworker21 Aug 09 '17 at 18:48