by John on (#73JXW)
If p is an odd prime, there is a theorem that says x^2 = -1 mod p has a solution if and only if p = 1 mod 4. When a solutionx exists, how do you find it? The previous two posts have discussed Stan Wagon's algorithm for expressing an odd prime p as a [...]The post Finding a square root of -1 mod p first appeared on John D. Cook.