1

Here :

http://mathworld.wolfram.com/SumofSquaresFunction.html

$r_2'(n)$ is a function calculating the number of solutions $a^2+b^2=n$ with integers $a,b$ satisfying $0<a\le b$

How can I calculate $P(n)$ , which shall be here the number of the primitive solutions ($\gcd(a,b)=1$) of $a^2+b^2=n$ with integers $a,b$ satisfying $0<a\le b$ ?

Some cases are relatively easy :

  • If $n$ is odd and squarefree, $\gcd(a,b)$ is necessarily satisfied. Hence we just have $P(n)=r_2'(n)$
  • If $n$ is an odd square of a squarefree number $m$ , then it can be shown that $P(n)=P(m)$ holds.

But how can I calculate $P(n)$ in general ?

Peter
  • 86,576
  • @DietrichBurde Apparently, the order is ignored, so $(1/2)$ and $(2/1)$ are considered to be the same solution. Also , apparently $0$ is excluded, but $a=b$ apparently allowed. – Peter Feb 14 '20 at 12:21
  • After trying some $n$ , for example $2^2\cdot 5^4$ and $2^3\cdot 5^4$, I came to this conclusion. – Peter Feb 14 '20 at 12:23
  • Somewhat related posts are this one and this one. – Dietrich Burde Feb 14 '20 at 12:24
  • $(1)$ In the link with score +2 , the necessary and sufficient condition seems to be that there is no prime factor of the form $4k+3$, but I do not understand why the exponent in $2^a$ can exceed $1$ $(2)$ This does not yet give the number of representations. – Peter Feb 14 '20 at 12:29
  • A proof seems to be here. – Dietrich Burde Feb 14 '20 at 12:29
  • @DietrichBurde OK, the condition makes sense. It remains to determine the number of solutions , if it is actually satisfied. – Peter Feb 14 '20 at 12:35

0 Answers0