Calculating a p-adic square root, p an odd prime
This returns the first n p-adic digits of a p-adic sqroot x of a quadratic residue (mod p).
Here p is an odd prime and x ≡ b (mod p), where b2 ≡ a (mod p), 0 < b < p.
The arithmetic is done in base p.
This is a BCMATH translation of a BC program.
Also see lecture notes and solutions.
Last modified 22nd April 2004
Return to main page