by John on (#73JXX)
The previous post briefly mentioned Stan Wagon's algorithm for expressing an odd prime p as a sum of two squares when it is possible (i.e. when p = 1 mod 4). Wagon's algorithm requires first finding a non-square modp, i.e. a number c such that c d^2 mod p for any d in 1, [...]The post Finding a non-square mod p first appeared on John D. Cook.