those primes with and the latter numbers and are precisely the quadratic residues modulo . Therefore, except for , we have that is a quadratic residue modulo iff is a quadratic residue modulo . The law of quadratic reciprocity gives a similar characterization of prime divisors of for any prime q, which leads to a characterization for any integer . Patterns among quadratic residues Let p be an odd prime. A number modulo p is a quadratic residue whenever it is congruent to a square (mod p); otherwise it is a quadratic non-residue. ("Quadratic" can be dropped if it is clear from the context.) Here we exclude zero as a special case. Then as a consequence of the fact that the multiplicative group of a finite field of order p is cyclic of order p-1, the following statements hold: There are an equal number of quadratic residues and non-residues; and The product of two quadratic residues is a residue, the product of a residue and a non-residue is a non-residue, and the product of two non-residues is a residue. For the avoidance of doubt, these statements do not hold if the modulus is not prime. For example, there are only 3 quadratic residues (1, 4 and 9) in the multiplicative group modulo 15. Moreover, although 7 and 8 are quadratic non-residues, their product 7x8 = 11 is also a quadratic non-residue, in contrast to the prime case. Quadratic residues are entries in the following table: This table is complete for odd primes less than 50. To check whether a number m is a quadratic residue mod one of these primes p, find a ≡ m (mod p) and 0 ≤ a < p. If a is in row p, then m is a residue (mod p); if a is not in row p of the table, then m is a nonresidue (mod p). The quadratic reciprocity law is the statement that certain patterns found in the table are true in general. Legendre's version Another way to organize the data is to see which primes are residues mod which other primes, as illustrated in the following table. The entry in row p column q is R if q is a quadratic residue (mod p); if it is a nonresidue the entry is N. If the row, or the column, or both, are ≡ 1 (mod 4) the entry is blue or