If there is an integer such that
(1) |
then q is said to be a quadratic nonresidue (mod p). If not, q is said to be a quadratic residue (mod p).
The following table summarizes the quadratic nonresidues for small p (Sloane's A105640).
p | quadratic nonresidues |
1 | (none) |
2 | (none) |
3 | 2 |
4 | 2, 3 |
5 | 2, 3 |
6 | 2, 5 |
7 | 3, 5, 6 |
8 | 2, 3, 5, 6, 7 |
9 | 2, 3, 5, 6, 8 |
10 | 2, 3, 7, 8 |
11 | 2, 6, 7, 8, 10 |
12 | 2, 3, 5, 6, 7, 8, 10, 11 |
13 | 2, 5, 6, 7, 8, 11 |
14 | 3, 5, 6, 10, 12, 13 |
15 | 2, 3, 5, 7, 8, 11, 12, 13, 14 |
16 | 2, 3, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15 |
17 | 3, 5, 6, 7, 10, 11, 12, 14 |
18 | 2, 3, 5, 6, 8, 11, 12, 14, 15, 17 |
19 | 2, 3, 8, 10, 12, 13, 14, 15, 18 |
20 | 2, 3, 6, 7, 8, 10, 11, 12, 13, 14, 15, 17, 18, 19 |
The numbers of quadratic nonresidues (mod p) for p = 1, 2, ... are 0, 0, 1, 2, 2, 2, 3, 5, 5, 4, 5, 8, 6, 6, ... (Sloane's A105641).
The smallest quadratic nonresidues for p = 3, 4, ... are 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 3, 2, 2, 3, 2, 2, ... (Sloane's A020649). The smallest quadratic nonresidues for p = 2, 3, 5, 7, 11, ... are 2, 2, 2, 3, 2, 2, 3, 2, 5, 2, 3, 2, 3, ... (Sloane's A053760).
If the extended Riemann hypothesis is true, then the first quadratic nonresidue of a number (mod p) is always less than (Wedeniwski 2001) for p > 3.
The following table gives the values of p such that the least quadratic nonresidue is n for small n.
n | Sloane | p such that 2 is the smallest quadratic nonresidue |
2 | A025020 | 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 15, ... |
3 | A025021 | 7, 14, 17, 31, 34, 41, 49, 62, 79, 82, ... |
5 | A025022 | 23, 46, 47, 73, 94, 97, 146, 167, 193, ... |
7 | A025023 | 71, 142, 191, 239, 241, 359, 382, ... |
Sloane, N. J. A. Sequences A020649, A025020, A025021, A025022, A025023, A053760, A105640, and A105641 in "The On-Line Encyclopedia of Integer Sequences." http://www.research.att.com/~njas/sequences/.