<s>[INST] Anti-associativity of product of sum of squares $\newcommand{\P}{\mathbb{P}}$$\newcommand{\Z}{\mathbb{Z}}$ Let $\P$ be the set of prime numbers congruent to $1 \pmod 4$. I know that for every $p \in \P$ there's a unique couple $(a^2,b^2)\in \Z^2$ such that $p= a^2+b^2$ and $a < b \in \Z$. Moreover, if we take $p,q \in \P$ with $p=a^2+b^2$, $q=c^2+b^2$, we'll have $pq=(ac+bd)^2+(ad-bc)^2$. If we take $p,q,r \in \P$ different from each other, we have $2$ different associations: we can write $pq$ as a sum of squares and then, multiplying by $r$, we obtain a sum of squares; but we can also start with $qr$ and then multiply by $p$ (written as sums of squares) and possibly get different squares. For example, 
\begin{align}
5 \cdot 13 \cdot 17 &= [(1^2+2^2)(2^2+3^2)](1^2+4^2) = (1^2+8^2)(1^2+4^2) = 4^2+ 33^2 \\
&=(1^2+2^2)[(2^2+3^2)(1^2+4^2)] = (1^2+2^2)(5^2+14^2) = 24^2+ 23^2
\end{align}
My question is, if we start with $n$ different primes of $\P$, is it always true that every different association of those primes gives different squares?
 [/INST] I address a differently phrased question, but it should provide the answer to yours.
Suppose the positive integer $z$ is a product of primes $p_j$ all congruent to $1$ modulo $4$. Write $z = a^ 2 + b^2$, with $a, b$ positive, $a < b$. Then $$\tag{dec}z = (a + i b) (a - i b)$$ is the product of two conjugate Gaussian integers.
Now if $p_j = a_j^2 + b_j^2 = (a_j + i b_j)(a_j - i b_j)$ is the decomposition of $p_j$ as the product of two Gaussian primes, you obtain a decomposition (dec) by choosing, for each $j$, one of $a_j \pm i b_j$.
For instance $5 = 1^2 + 2^2$ and $13 = 2^2 + 3^2$, so we get
$$
5 \cdot 13 = (1 + 2 i) (2 + 3 i) \cdot (1 - 2 i) (2 - 3 i),
= (-4 + 7 i) (-4 - 7 i)
$$
which yields $65 = 4^2 + 7^2$, or
$$
5 \cdot 13 = (1 + 2 i) (2 - 3 i) \cdot (1 - 2 i) (2 + 3 i) = (8 - i) (8 + i),
$$
which yields $65 = 8^2 + 1^2$.
</s>