Skip to main content

JacobDem

Jacobi Symbol Demonstration

Calculate the Jacobi symbol step by step

How the Jacobi Symbol Works

The Jacobi symbol is a generalization of the Legendre symbol and is used in number theory:

  1. The Jacobi symbol (an)(\frac{a}{n}) is defined for odd positive integers nn
  2. It equals 11, 1-1, or 00 depending on the quadratic residue properties
  3. The algorithm uses reduction modulo nn and the following properties:
  4. Multiplicativity: The symbol is multiplicative in both numerator and denominator: (abn)=(an)(bn)(\frac{ab}{n}) = (\frac{a}{n})(\frac{b}{n}) and (amn)=(am)(an)(\frac{a}{mn}) = (\frac{a}{m})(\frac{a}{n})
  5. Special values: (1n)=(1)n12(\frac{-1}{n}) = (-1)^{\frac{n-1}{2}} and (2n)=(1)n218(\frac{2}{n}) = (-1)^{\frac{n^2-1}{8}} for odd nn
  6. Quadratic reciprocity: For odd coprime numbers nn and mm: (mn)(nm)=(1)(n1)(m1)4(\frac{m}{n})(\frac{n}{m}) = (-1)^{\frac{(n-1)(m-1)}{4}}
  7. These properties allow efficient computation through reduction and avoid direct factorization
  8. If (an)=1\left(\frac{a}{n}\right) = -1 then aa is not a quadratic residue modulo nn.
  9. If nn is prime and (an)=1\left(\frac{a}{n}\right) = 1 then aa is quadratic residue modulo nn.