<s>[INST] Calculate list of all pairs $(x,y)$ The Number Theory question I am trying to solve is :-
Write $650$ as a product of irreducible elements in $\mathbb Z[i]$, then list all of the pairs $(x,y) \in$ $Z^2$ with $0 \le x \le y$ such that $x^2 + y^2 = 650$.
The way I approached this question is I computed the prime factorization of $650$ which is $2 \cdot 5^{2} \cdot 13$. Then I converted it into irreducible elements in $\mathbb Z[i]$ that came out to be $(1+i)(1-i)(2+i)^{2}(2-i)^{2}(3+2i)(3-2i)$. I am not able to get the second part of the question in which I need to list all the pairs $(x,y)$. I was able to compute the number of solution using Fermat's Sum of Two Squares which is $24$ but I am not able to list the pairs.
Can someone please help me with that part?
 [/INST] You need to multiply the values $(1+i),(1-i),(2+i),(2+i),(2-i),(2-i),(3+2i),(3-2i)$ in ways that make complimenary pairs. where $(x+yi)(x-yi)=x^2 + y^2 = 650$
Note that $(a+ bi)(c+di) = (ac-bd) + (bc+da)i$ while $(a-bi)(a-di)= (ac -bd)-(bc+da)i$
So the way to make complimentary pairs are $x+yi = (1+ i)(2\pm i)(2\pm i)(3\pm 2i)$ and $x-yi = (1- i)(2\mp i)(2\mp i)(3\mp 2i)$.  In all of these $x^2 + y^2 = 650$.
So there should be $8$ such pairs of $(x,y)$.
$(1+i)(2+i)(2+i)(3+2i)= (1+i)(3+4i)(3+2i)= (-1+7i)(3+2i)=-17+19i$ so $17^2 + 19^2=650$ and $(x,y) =(17,19)$.
$(1+i)(2+i)(2+i)(3-2i) = (-1+7i)(3-2i) = 11 +23i$ so $11^2 + 23^2 = 650$ and $(x,y)=(11,23)$.
And so on.
$(1+i)(2+i)(2-i)(3-2i)=(1+i)5(3-2i)=5(5+i)=25 + 5i$ so $25^2 + 5^ = 650$ and $(x,y)=(5,25)$.
But the is duplicated with $(1+i)(2-i)(2+1)(3-2i)$.
$(1+i)(2+i)(2-i)(3+2i)=5(1+i)(3+2i) = 5(1+5i)$ which is a permutation.
$(1+i)(2-i)^2(3\pm 2i)$ are the final $2$.  $(3-4i)(1+i)(3\pm 2i)=(7-i)(3\pm 2i)= \{23+11i;19-17i\}$.
Hmmm... not entirely sure how I could have avoided the duplicates....
But we have three such pairs $(5,25), (11,23), (17,19)$
</s>