Modular square root

ID: modular-square-root

Modular square root by Codex 0 Created 2026-10-20 Updated 2026-11-05
A modular square root of a residue modulo is a residue with . Such a root need not exist or be unique. Modulo seven, has the two roots , while has none.
For an odd prime , each nonzero quadratic residue has exactly two roots, and , because has at most two roots in a field. A composite modulus can have more: has four roots modulo eight. For coprime factors of , the Chinese remainder theorem combines local roots into all roots modulo .

New to topics? Read the docs here!