词条 | Jacobi symbol | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
释义 |
The Jacobi symbol is a generalization of the Legendre symbol. Introduced by Jacobi in 1837,[1] it is of theoretical interest in modular arithmetic and other branches of number theory, but its main use is in computational number theory, especially primality testing and integer factorization; these in turn are important in cryptography. DefinitionFor any integer a and any positive odd integer n, the Jacobi symbol {{big|(}}{{sfrac|a|n}}{{big|)}} is defined as the product of the Legendre symbols corresponding to the prime factors of n: where is the prime factorization of n. The Legendre symbol {{big|(}}{{sfrac|a|p}}{{big|)}} is defined for all integers a and all odd primes p by Following the normal convention for the empty product, {{big|(}}{{sfrac|a|1}}{{big|)}} = 1. When the lower argument is an odd prime, the Jacobi symbol is equal to the Legendre symbol. Table of valuesThe following is a table of values of Jacobi symbol {{big|(}}{{sfrac|k|n}}{{big|)}} with n ≤ 59, k ≤ 30, n odd.
PropertiesThe following facts, even the reciprocity laws, are straightforward deductions from the definition of the Jacobi symbol and the corresponding properties of the Legendre symbol.[2] The Jacobi symbol is defined only when the upper argument ("numerator") is an integer and the lower argument ("denominator") is a positive odd integer. 1. If n is (an odd) prime, then the Jacobi symbol {{big|(}}{{sfrac|a|n}}{{big|)}} is equal to (and written the same as) the corresponding Legendre symbol. 2. If {{nowrap|a ≡ b (mod n)}}, then {{big|(}}{{sfrac|a|n}}{{big|)}} = {{big|(}}{{sfrac|b|n}}{{big|)}}. 3. If either the top or bottom argument is fixed, the Jacobi symbol is a completely multiplicative function in the remaining argument: 4. 5. The law of quadratic reciprocity: if m and n are odd positive coprime integers, then 6. and its supplements 7. 8. Combining property 4 and 8 gives: 9. Like the Legendre symbol:
But, unlike the Legendre symbol: If {{big|(}}{{sfrac|a|n}}{{big|)}} = 1 then a may or may not be a quadratic residue modulo n. This is because for a to be a quadratic residue modulo n, it has to be a quadratic residue modulo every prime factor of n. However, the Jacobi symbol equals one if, for example, a is a non-residue modulo exactly two of the prime factors of n. Although the Jacobi symbol cannot be uniformly interpreted in terms of squares and non-squares, it can be uniformly interpreted as the sign of a permutation by Zolotarev's lemma. The Jacobi symbol {{big|(}}{{sfrac|a|n}}{{big|)}} is a Dirichlet character to the modulus n. Calculating the Jacobi symbolThe above formulas lead to an efficient {{nowrap|O(log a log b)}}[3] algorithm for calculating the Jacobi symbol, analogous to the Euclidean algorithm for finding the gcd of two numbers. (This should not be surprising in light of rule 2.)
Implementation in Lua'''function Jacobi'''(n,k) '''if''' n < 0 '''then''' t = -1 '''elseif''' n == 0 '''then''' '''return''' 0 '''else''' t = 1 '''end''' '''while''' n ~= 0 '''do''' '''while''' n % 2 == 0 '''do''' n = n / 2 r = k % 8 '''if''' r == 3 or r == 5 '''then''' t = -t '''end''' '''end''' n, k = k, n '''if''' n % 4 == k % 4 == 3 '''then''' t = -t '''end''' n = n % k '''end''' '''if''' k == 1 '''then''' '''return''' t '''else''' '''return''' 0 '''end''' '''end''' Example of calculationsThe Legendre symbol {{big|(}}{{sfrac|a|p}}{{big|)}} is only defined for odd primes p. It obeys the same rules as the Jacobi symbol (i.e., reciprocity and the supplementary formulas for {{big|(}}{{sfrac|−1|p}}{{big|)}} and {{big|(}}{{sfrac|2|p}}{{big|)}} and multiplicativity of the "numerator".) Problem: Given that 9907 is prime, calculate {{big|(}}{{sfrac|1001|9907}}{{big|)}}. Using the Legendre symbolUsing the Jacobi symbolThe difference between the two calculations is that when the Legendre symbol is used the "numerator" has to be factored into prime powers before the symbol is flipped. This makes the calculation using the Legendre symbol significantly slower than the one using the Jacobi symbol, as there is no known polynomial-time algorithm for factoring integers.[4] In fact, this is why Jacobi introduced the symbol. Primality testingThere 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, and in fact may not even be −1 or 1. For example, So if it is unknown whether a number n is prime or composite, we can pick a random number a, calculate the Jacobi symbol {{big|(}}{{sfrac|a|n}}{{big|)}} and compare it with Euler's formula; if they differ modulo n, then n is composite; if they have the same residue modulo n for many different values of a, then n is "probably prime". This is the basis for the probabilistic Solovay–Strassen primality test and refinements such as the Baillie-PSW primality test and the Miller–Rabin primality test. As an indirect use, it is possible to use it as an error detection routine during the execution of the Lucas-Lehmer primality test which, even on modern computer hardware, can take weeks to complete when processing Mersenne numbers over (the largest known Mersenne prime as of December 2018). In nominal cases, the Jacobi symbol: This also holds for the final residue and hence can be used as a verification of probable validity. However, if an error occurs in the hardware, there is a 50% chance that the result will become 0 or 1 instead, and won't change with subsequent terms of (unless another error occurs and changes it back to -1). See also
Notes1. ^{{cite journal|first=C. G. J.|last=Jacobi|title=Über die Kreisteilung und ihre Anwendung auf die Zahlentheorie|journal=Bericht Ak. Wiss. Berlin|date=1837|page=127–136}} 2. ^Almost any textbook on elementary or algebraic number theory, e.g. Ireland & Rosen pp. 56–57 or Lemmermeyer p. 10 3. ^Cohen, pp. 29–31 4. ^The number field sieve, the fastest known algorithm, requires:operations to factor n. See Cohen, p. 495 References
| last1 = Cohen | first1 = Henri | title = A Course in Computational Algebraic Number Theory | publisher = Springer | location = Berlin | date = 1993 | isbn = 3-540-55640-0}}
| 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}}
| last1 = Lemmermeyer | first1 = Franz | title = Reciprocity Laws: from Euler to Eisenstein | publisher = Springer | location = Berlin | date = 2000 | isbn = 3-540-66957-4}} External links
1 : Modular arithmetic |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。