Let $n$ be the product of $k$ distinct prime numbers of the form $4m+1$.
How can I prove that the number of solutions $n=a^2+b^2$ with integers $a,b$ satisfying $0<a<b$ is $2^{k-1}$ ?
I tried to use the idendity $$(a^2+b^2)(c^2+d^2)=(ad+bc)^2+(ac-bd)^2$$ and induction over the number of prime factors , but the problem is to show that the representations I get this way are actually distinct , so that the number of representations actually doubles with every new prime factor.
Let's show that the number of solutions $(a, b)$ with $0 \leq a, b$ equals $2^{k}$. Because $n$ is square-free, this implies that the number of solutions with $0 < a < b$ is $2^{k-1}$.
Call $R_2(n)$ the set of solutions $(a, b)$ with $0 \leq a, b$. Call $P(n)$ the set of ideals of $\mathbb Z[i]$ of norm $n$. The number of such ideals is equal to $2^k$, by unique factorization of ideals. We have a map $f : R_2(n) \to P(n)$ that sends $(a, b)$ to $(a+bi)$.