Jacobi Symbol Calculator

(a/n) = Π(a/pᵢ)

CalculatorsFreeNo Signup
4.6(567 reviews)
All Tools

Loading tool...

About Jacobi Symbol Calculator

A Jacobi symbol calculator computing (a/n) for odd n by factoring n and multiplying Legendre symbols. Uses properties like reciprocity and supplements for efficient computation. Shows step-by-step evaluation. All client-side.

Jacobi Symbol Calculator Features

  • (a/n)
  • Factorization
  • Step-by-step
  • Reciprocity
  • Table
Jacobi symbol (a/n): for odd n = p₁^e₁·...·pₖ^eₖ, (a/n) = Π(a/pᵢ)^eᵢ. Generalizes Legendre symbol to composite moduli. (a/n)=1 doesn't guarantee a is a QR mod n. Used in Solovay-Strassen primality test.

How to Use

Enter a and odd n:

  • (a/n): Product of Legendre symbols
  • Factors: Factorization of n
  • Steps: Evaluation process

Properties

  • (a/n) = 0 iff gcd(a,n)>1
  • (ab/n) = (a/n)(b/n)
  • (a/mn) = (a/m)(a/n)
  • Reciprocity still holds

Algorithm

Efficient computation without factoring n: use reciprocity, (−1/n), (2/n) supplements, and reduction mod n. Runs in O(log²n) — same as GCD.

Step-by-Step Instructions

  1. 1Enter a.
  2. 2Enter odd n.
  3. 3Get (a/n).
  4. 4View steps.
  5. 5See factorization.

Jacobi Symbol Calculator — Frequently Asked Questions

How does Jacobi differ from Legendre?+

Legendre (a/p) requires p prime and tells if a is a QR. Jacobi (a/n) allows composite odd n but (a/n)=1 doesn't mean a is a QR mod n — it means the product of Legendre symbols equals 1. However, (a/n)=−1 does guarantee a is not a QR.

How is Jacobi used in primality testing?+

Solovay-Strassen test: for odd n, pick random a. If (a/n) ≢ a^((n-1)/2) (mod n), then n is composite. If they agree for many a, n is probably prime. This uses the fact that for primes, Jacobi equals Euler's criterion.

Can Jacobi be computed without factoring?+

Yes! Using reciprocity and supplement rules: (a/n) can be reduced via (a mod n/n), flipping via reciprocity, and handling factors of 2 and −1 with supplement formulas. This runs in O(log²n), similar to the Euclidean algorithm.

Share this tool: