- Jacobi symbol
The Jacobi symbol is a generalization of the
Legendre symbol introduced by Jacobi in 1837 [C.G.J.Jacobi "Uber die Kreisteilung und ihre Anwendung auf die Zahlentheorie", "Bericht Ak. Wiss. Berlin" (1837) pp 127-136] . It is of theoretical interest inmodular arithmetic and other branches ofnumber theory , but its main use is incomputational number theory , especiallyprimality testing andinteger factorization ; these in turn are important incryptography .Motivation
The Legendre symbol is defined for all integers "a" and all odd primes "p" by
:
If = 1, "a" is called a
quadratic residue (mod "p"). If = −1, "a" is called aquadratic nonresidue (mod "p").
Zero is usually treated as a special case.The by-hand algorithms used in the 19th century for primality testing and factorizing [Gauss, DA arts 329-334.] , and also many calculations needed for the ongoing development of
algebraic number theory , required the calculation of numerous Legendre symbols.There is a formula for the Legendre symbol called
Euler's criterion :Although relatively easy today, calculating : by hand (even with a mechanical calculator) is not very practical. [Gauss, DA, art. 106 says it's useless if the numbers are at all large.] [Euler's criterion takes O(log3 "n") steps. Bach & Shallit, p. 122] Using the most efficient modern powering algorithms, the example requires a dozen or so multiplies of four-digit numbers, and as many divisions by 9907. It's too laborious to be practical when the numbers are larger than a few million.
Now the Legendre symbol obeys a couple of rules
:
:
that are easily deduced from its definition, and also the
law of quadratic reciprocity , (which isn't so easily deduced! ),:
and its supplements
:
:
Calculations using the Legendre symbol
Calculation using these rules is "much" easier than raising a number to the 4953 rd power (mod 9907):
:
::
::
::
:
That was fun. Now calculate
The first step is finding that 2183 = 59 × 37. Before electronic computers, factorizing numbers "really" slowed down calculations and even today, if the numbers involved are at all large, factorization is a fairly slow process. For arbitrary [I.e, not
Fermat number s orMersenne number s or something of the sort for which there are special algorithms] numbers bigger than a few hundred digits it is impossible with known [Don't forget that WWII British Intelligence hadAlan Turing on the codebreaking staff.] hardware and algorithms.:
::
:::
::
:
Of course, it is possible that some of the numbers in the intermediate steps would need to be factorized as well. What Jacobi discovered was a way to calculate the Legendre symbol without factorizing any numbers.
Definition
For any integer "a" and any positive odd integer "n" the Jacobi symbol is defined as the product of the Legendre symbols corresponding to the prime factors of "n":
:
Following the normal convention for the empty product,
Properties of the Jacobi symbol
These facts, even the reciprocity laws, are straightforward deductions from the definition of the Jacobi symbol and the corresponding properties of the Legendre symbol. [Almost any textbook on elementary number theory, e.g. Ireland & Rosen pp 56-57]
:
:
:
:
:
:
:
:
Like the Legendre symbol,
:
:
But, unlike the Legendre symbol
:
This is because for "a" to be a residue (mod "n") it has to be a residue modulo "every" prime that divides "n", but for ("a"|"n") to = 1, it can be a non-residue modulo zero, two (or any even number) of the primes dividing "n".
The same calculations, using the Jacobi symbol
:
::
::
:
::
::
::
The sequence where the top number is reduced modulo the bottom number, the top and bottom are switched, the top is reduced modulo the bottom, ... is what happens when the
greatest common divisor is calculated usingEuclid's algorithm , [The only real difference is the way even numbers are treated and the fact that the sign is flipped in the Jacobi calculation when both numbers are ≡ 3 (mod 4))] so calculating the Jacobi symbol (or the Legendre symbol if the bottom number is prime) is computationally exactly as hard as Euclid's algorithm. [ O(log "n" log "a") steps. Bach & Shallit p. 68 ff] (This shouldn't be surprising, since if ("a"|"b") = 0, gcd("a", "b") > 1.)The facts that (2183|9907) = 1 and 9907 is prime imply that 2183 is a quadratic residue (mod 9907), but give no hint about what square it is congruent to. The
Shanks-Tonelli algorithm is a way to find out. SeeQuadratic residue for more details.9082 ≡ 2183 (mod 9907).
Primality testing
There is another way the Jacobi and Legendre symbols differ. If the Euler criterion formula is used modulo a composite number, the result may or may not be the value of the Jacobi symbol.
So if it's not known whether a number "n" is prime or composite, we can pick a random number "a", calculate the Jacobi symbol ("a"|"n") and compare it with Euler's formula; if they differ, "n" is composite; if they're the same for many different values of "a", "n" is "probably prime".
This is the basis for the
Solovay-Strassen probabilistic primality test and its refinement theMiller-Rabin test.ee also
*The
Kronecker symbol is a generalization of the Jacobi symbol to all integers.Notes
References
*citation
last1 = Bach | first1 = Eric
last2 = Shallit | first2 = Jeffrey
title = Algorithmic Number Theory (Vol I: Efficient Algorithms)
publisher =The MIT Press
location = Cambridge
date = 1966
isbn = 0-262-02045-5*citation
last1 = Lemmermeyer | first1 = Franz
title = Reciprocity Laws: from Euler to Eisenstein
publisher =Springer
location = Berlin
date = 2000
isbn = 3-540-66967-4*citation
last1 = Ireland | first1 = Kenneth
last2 = Rosen | first2 = Michael
title = A Classical Introduction to Modern Number Theory (Second edition)
publisher =Springer
location = New York
date = 1990
isbn = 0-387-97329-X*citation
last1 = Gauss | first1 = Carl Friedrich
last2 = Maser | first2 = H. (translator into German)
title = Untersuchungen uber hohere Arithmetik (Disquisitiones Arithemeticae & other papers on number theory) (Second edition)
publisher = Chelsea
location = New York
date = 1965
isbn = 0-8284-0191-8*citation
last1 = Gauss | first1 = Carl Friedrich
last2 = Clarke | first2 = Arthur A. (translator into English)
title = Disquisitiones Arithemeticae (Second, corrected edition)
publisher =Springer
location = New York
date = 1986
isbn = 0387962549External links
* [http://www.math.fau.edu/richman/jacobi.htm Calculate Jacobi symbol] gives a display like the ones in the examples.
Wikimedia Foundation. 2010.