Espress $2017$ as sum of two squares.
attempt: by Fermat's Theorem on sums of squares, the prime $p = 2017$ is the sum of two squares $2017 = a^2 + b^2$ , $a,b \in \mathbb{Z}$, if and only if $p \equiv 1 mod 4$.
And The irreducible elements in the Gaussian integers $\mathbb{Z[i]}$ are as follows $(a + bi)(a - bi) $ for primes $p\in \mathbb{Z}$ with $p \equiv 1 mod 4$ (both of which have norm $p$).
Then since $2017 \equiv 1 (mod 4)$ Then $2017 = a^2 + b^2$ .
Notice that $\sqrt2017 $ is approximately $44.91$. So $a^2, b^2 $ will be between values $1,2^2,....,44^2$ .
Then plugging different values from the above squares in $2017 - a^2 = b^2$
we find $2017 - 44^2 = 81 = 9^2$
So $2017 = 44^2 + 9^2$.
However, I found them using that approach. But is there a way to find them without doing this approach?
I dont' know how to use $p = a^2 + b^2 = (a + bi)(a - bi) $ for primes $p\in \mathbb{Z}$ with $p \equiv 1 mod 4$ (both of which have norm $p$).
So $2017 = a^2 + b^2 = (a+ bi)(a - bi) $. I don't' know how I would proceed assuming I would not have found the values . Any feedback or better approach would be appreciated it. Thank you!