3
$\begingroup$

The number of representations of $n$ by sum of 2 squares is known as sum of square function $r_2 (n)$. It is known that if prime factorization of $n$ is given as $$2^{a_0}p_1^{a_1}p_2^{a_2}\cdots q_1^{b_1}q_2^{b_2}\cdots$$ , where $p_i$s are primes of the form $4k+1$ and $q_i$s are primes of $4k+3$, then $r_2 (n)=0$ if any of $b_i$ is odd and $r_2 (n)=4(a_1+1)(a_2+1)\cdots$ if not.

However, I can't find any result that counts the number of representations of $n$ by sum of 2 coprime squares given its factorization. Can you find one?

By simple brute force and searching OEIS, I found that https://oeis.org/A000089 looks nearly identical to the function $r_{2, coprime}(n)$ I explained.

Can you prove or disprove $r_{2, coprime}(n) = A000089(n)$?

$\endgroup$
5
  • $\begingroup$ First of all , we have stronger necessary conditions for the existence of such a representation : The number is not divisible by $4$ and there is no prime factor of the form $4k+3$. $\endgroup$
    – Peter
    Commented Mar 18, 2022 at 14:07
  • $\begingroup$ @Peter if we allow equal squares the following would be counter examples for your constraints: $2^2+2^2 = 8$ and $3^2 + 3^2 = 18$. Am I missing something? $\endgroup$ Commented Mar 18, 2022 at 15:55
  • 1
    $\begingroup$ You know, $(2, 2)$ and $(3, 3)$ are not coprimes $\endgroup$
    – didgogns
    Commented Mar 18, 2022 at 15:57
  • $\begingroup$ One strategy for trying to count the sums of coprime squares is to notice that when the squares are not coprime, they have common factors, so they are counted by the $r_2$ of a divisor of $n$. $\endgroup$ Commented Mar 18, 2022 at 16:03
  • $\begingroup$ @didgogns Of course. I assumed the comment was about your definition of $r_2$ and not about the coprime case, my bad. $\endgroup$ Commented Mar 18, 2022 at 16:05

1 Answer 1

2
$\begingroup$

We will just use that $\mathbb{Z}[i]$ is a factorial ring. As before $n=\prod_{i=1}^{k}p_i^{\alpha_i}$ where $p_1=2$ and $\alpha_1=0,1$ or $p_i\equiv 1 \pmod{4}$ for $i\geq 2$. Then each $p_i$ with $i\geq 2$ factors uniquely as $q_i\overline{q_i}$. Writing $n=a^2+b^2$ corresponds to factoring $n$ as $(a+bi)(a-bi)$ where $(a+bi)$ and $(a-bi)$ are corpime. Then the statement is clear each factor of $(a+bi)$ is either $q_i^{\alpha_i}$ or $\overline{q_i}^{\alpha_i}$, and if you have $2|n$ you also have a choice for $(1+i)$ and $(1-i)$. Thus you get exactly $2^k$ such writings.

$\endgroup$
1
  • 1
    $\begingroup$ P.S the fact that is concides with the number of solutions of the congruence is trivial in one direction; if $n=a^2+b^2$ and $(a,b)$ are coprime then they are coprime with $n$ so $x=a^{-1}b$. The map backwards relies on Thue's lemma; namely for each such $x$ you can construct $a,b\leq \sqrt{n}$ with $a\equiv xb\pmod{n}$. $\endgroup$
    – Vlad Matei
    Commented Mar 19, 2022 at 18:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .