[Math] ny variation known to the sum of two squares theorem

abstract-algebradiophantine equationsnumber theoryprime factorization

Originally posed by Fermat and subsequently generalized as sum of two squares theorem, we can see the following statement.

An integer greater than one can be written as a sum of two squares if and only if its prime decomposition contains no factor $p^k$, where prime $p\equiv 3 \pmod {4}$ and $k$ is odd.

My question is simple.
Is there any variation known to this theorem?

Such as, when we refer the theorem above as $1 \pmod {4}$ version, I would like to know whether there are any $1 \pmod {6}$ version, $1 \pmod {8}$ version, $1 \pmod {12}$ version…and so on.

The Diophantine equation won't have to be necessarily similar with the two square version.
Such as, someone might find some property of prime decomposition regarding some modular restriction with a Diophantine equation higher that the degree 2.

I've tried to make the question simple, but I'm not sure whether they could have been conveyed to the readers. If the points were not clear, please let me clarify them with further comments. Thanks.

Edit: My question was posed to ask for some variation in regard of modular restriction of prime decomposition. For example let's think about some formula A which is a Diophantine polynomial.
$$ A = n $$
when $A = a^2 + b^2$, it is sum of two squares theorem, which I refer as $1 \pmod {4}$ version. My main question is, whether there is any $A$ that makes $n$ on the right hand side being factorized only with $1 \pmod {6}$ numbers, or $1 \pmod {8}$ numbers, or $1 \pmod {12}$ numbers. If there is any, we may refer them as $1 \pmod {6}$ version, $1 \pmod {8}$ version, $1 \pmod {12}$ version. I see that already some of users are sharing their examples which I appreciate.

Thank you for your interests on my question.

Best Answer

The sum of two squares theorem can be proved by working in $\Bbb Z[i]$.

By working in $\Bbb Z[\zeta_3]$ instead, where $\zeta_3$ is a third root of unity, one may prove that an integer greater than one can be written in the form $a^2+3b^2$ if and only if its prime decomposition contains no factor $p^k$ where $k$ is odd and $p$ is a prime $p \equiv 2 \pmod{3}$.

There is a similar statement for every quadratic number field with class number one. This may be proved by using unique factorization in the ring of integers, quadratic reciprocity and the characterization of splitting of primes in quadratic extensions in terms of Legendre symbols.

Here are some more examples:

By working in $\Bbb Z[\sqrt{2}]$, one gets that an integer greater than one can be written in the form $a^2-2b^2$ if and only if its prime decomposition contains no factor $p^k$ where $k$ is odd and $p$ is a prime $p \equiv 3,5 \pmod{8}$.

By working in $\Bbb Z[\sqrt{-2}]$, one gets that an integer greater than one can be written in the form $a^2+2b^2$ if and only if its prime decomposition contains no factor $p^k$ where $k$ is odd and $p$ is a prime $p \equiv 5,7 \pmod{8}$.

Related Question