$$ x^2+y^2=N $$
$N$ integer,
Find $x,y$ integer so that the Diophantine equation is fulfilled.
If $N$ is a prime number, we can calculate all solutions very fast via Gauß reduction.
Is it also possible to calculate all solutions when $N$ is not a prime number?
Do you need to know the divisors of N, in order to find a solution?
It is possible.
I'll choose a relatively simple example. $N$ will be the product of two $4n+1$ different primes.
$$N=65=5\cdot 13$$
becomes
$$N=(2+i)(2-i)(3+2i)(3-2i)$$
now this product can be rearranged basically in two ways:
$$N=(2+i)(3+2i)(2-i)(3-2i)\qquad(1)$$
$$N=(2+i)(3-2i)(2-i)(3+2i)\qquad(2)$$
From (1) we get
$$N=(4+7i)(4-7i)=4^2+7^2$$
and from (2),
$$N=(8-i)(8+i)=8^2+1^2$$
However, if $n$ has a $4n+3$ prime factor with odd multiplicity, it is not possible.