 To test if 3 is a quadratic residue modulo 17, we calculate 3(17 − 1)/2 = 38 ≡ 16 ≡ −1 (mod 17), so it is not a quadratic residue.Euler's criterion is related to the Law of quadratic reciprocity.In practice, it is more efficient to use an extended variant of Euclid's algorithm to calculate the Jacobi symbol formula_47.