If the positive odd integer has prime factorization
its Jacobi symbol is
where each factor is a Legendre symbol; by convention . Thus the symbol is zero exactly when .
The quadratic reciprocity law for the Jacobi symbol says that for coprime positive odd integers ,
To prove it, write and . The quadratic reciprocity law for distinct odd primes states
Multiplying this identity over with multiplicities gives the required product of Jacobi symbols. Its sign exponent modulo two is
because multiplication of odd integers adds the quantities modulo two. This proves the law.
For the requested value, two applications of reciprocity give
since , , and is a quadratic nonresidue modulo .
Put . The odd integer is an Euler pseudoprime to the coprime base when
where is the Jacobi symbol.
Let be the unit group of residue classes modulo , and partition it into the set of bases satisfying the displayed congruence and the set of Euler witnesses that do not. If , multiplication by maps injectively into : indeed, if and also lay in , then the multiplicativity of the Jacobi symbol would give
Cancelling the invertible congruence for would say that , a contradiction. Hence , so at least half of the coprime bases are witnesses.
It remains to construct one witness for every odd composite number . If is not squarefree, choose an odd prime number with . The Chinese remainder theorem gives a unit such that for the full power and modulo every other prime-power factor. The binomial theorem gives
Since , this is neither nor modulo , whereas the Jacobi symbol is always or . Thus is a witness.
If is squarefree and composite, choose distinct primes . By the Chinese remainder theorem, choose to be a quadratic nonresidue modulo and to satisfy modulo every other prime divisor of . Then , while , so the Euler congruence again fails. This proves the existence of an Euler witness for every odd composite integer.
Write with odd primes . The Jacobi symbol is
where each factor on the right is a Legendre symbol. The supplementary law is
For coprime positive odd , quadratic reciprocity gives
Applying this with gives
Finally, factor with odd. The supplementary laws for and , followed by reciprocity on every odd prime factor of , express solely in terms of the residue class of the positive odd integer modulo when or . If , all those factors, including the zero cases, agree; hence