This question is related with the topic: Solving $x^2 + y^2 = M$ over integers
I have understood the formula used to determine $(x,y)$ such that $x^2+y^2=M$ with $M$ composite. But what if $M$ is a large prime such as $M=1000000241$ do I have to do only bruteforcing? Are there other methods?
EDIT:
I know that $M$ must be a prime of the form $4k+1$ but how to find $(x,y)$?
Thanks