How to Use
Enter a and n:
- QR?: Is a a quadratic residue mod n?
- Roots: All x with x²≡a
- List: All QRs mod n
Properties
- QR × QR = QR
- NR × NR = QR
- QR × NR = NR
- −1 is QR mod p iff p≡1 (mod 4)
Square Root Algorithms
For p≡3 (mod 4): x = a^((p+1)/4). General: Tonelli-Shanks algorithm. For composite n: combine solutions via CRT after factoring n.
Step-by-Step Instructions
- 1Enter a.
- 2Enter modulus n.
- 3Check QR.
- 4Find square roots.
- 5View QR list.