Jacobi Symbol Calculator
Enter integers a and n.

Jacobi Symbol Fundamentals

The Jacobi symbol (a/n) generalizes the Legendre symbol from prime moduli to any odd positive integer n. It plays a central role in number theory, particularly in quadratic reciprocity and primality testing. While the symbol may take on values -1, 0, or 1, it does not directly indicate whether a is a quadratic residue modulo n unless n is prime. Instead it factors into the Legendre symbols of a with respect to each prime power in n's factorization.

Recursive Properties

The Jacobi symbol obeys several useful properties that allow efficient computation. It is multiplicative in the top argument: (ab/n)=(a/n)(b/n). When a is even, repeated halving introduces a sign depending on n modulo 8. Additionally, if a and n are odd, swapping them triggers a sign change when both are congruent to 3 mod 4. These relationships give rise to a recursive algorithm similar to the Euclidean algorithm for the greatest common divisor.

Quadratic Reciprocity Connection

A cornerstone theorem in number theory, quadratic reciprocity, links the solvability of x2โ‰กa(modp) to a symmetry between a and the prime p. The Jacobi symbol compactly expresses these relationships even when the modulus is composite. This makes it valuable in algorithms such as the Solovayโ€“Strassen primality test, where random values of a are checked against a candidate n.

Using the Calculator

Provide integers a and n with n odd. The script repeatedly applies the properties above: it removes factors of two from a, swaps arguments when necessary, and reduces a modulo n. Once a becomes zero, the symbol is 0 unless n equals one. When a eventually equals one, the accumulated sign yields the Jacobi symbol.

Practical Insights

Although primarily a theoretical construct, the Jacobi symbol surfaces in cryptography and computational number theory. It allows quick assessment of quadratic residues and forms part of advanced algorithms for integer factorization. Exploring its values for different a and n builds familiarity with modular arithmetic and reveals deeper patterns underlying prime numbers.

Related Calculators

PCA Calculator - Explore Principal Components

Perform principal component analysis on a small dataset to visualize directions of maximum variance.

PCA calculator principal components dimensionality reduction

Gram-Schmidt Calculator - Orthonormalize Vectors

Perform the Gram-Schmidt process on a set of 2D or 3D vectors to obtain an orthonormal basis.

Gram-Schmidt calculator orthonormalization linear algebra

Cauchy-Schwarz Inequality Calculator - Verify Vector Bounds

Test the Cauchy-Schwarz inequality for two vectors and explore its geometric interpretation with an in-depth explanation.

Cauchy-Schwarz inequality calculator inner product vector norm