JacobiSymbol[n,m]
gives the Jacobi symbol
.
JacobiSymbol
JacobiSymbol[n,m]
gives the Jacobi symbol
.
Details
- Integer mathematical function, suitable for both symbolic and numerical manipulation.
- For prime m, the Jacobi symbol reduces to the Legendre symbol. The Legendre symbol is equal to
depending on whether n is a quadratic residue modulo m. - JacobiSymbol automatically threads over lists.
Examples
open all close allBasic Examples (2)
Scope (3)
JacobiSymbol[10 ^ 10 + 1, Prime[1000]]JacobiSymbol[7, 6]TraditionalForm formatting:
JacobiSymbol[n, k]//TraditionalFormGeneralizations & Extensions (2)
JacobiSymbol threads element-wise over lists and arrays:
JacobiSymbol[{2, 3, 5, 7, 11}, 3]JacobiSymbol works for negative first arguments:
JacobiSymbol[-3, {1, 3, 5, 7}]Applications (5)
Find Euler–Jacobi pseudoprimes:
Select[Range[10000], GCD[#, 2] === 1 && Not[PrimeQ[#]] && JacobiSymbol[2, #] == Mod[2 ^ ((# - 1) / 2), #]&]JacobiSymbol[p, q]JacobiSymbol[q, p] == (-1) ^ ((p - 1) / 2 (q - 1) / 2)Table[If[GCD[p, q] == 1, %, True], {p, 3, 10, 2}, {q, 3, 10, 2}] //Flatten//UnionConstruct eigenvectors of the discrete Fourier transform:
With[{p = 13}, Table[JacobiSymbol[k, p], {k, 0, p - 1}]]//NFourier[%]//ChopEvaluate Gauss sums in closed form:
With[{h = 4, p = 11}, {Underoverscript[∑, k = 1, p]If[GCD[k, p] == 1, E^(2 π I h k^2/p), 0], JacobiSymbol[h, p] I^((p - 1/2))^2 Sqrt[p] - 1}]//FullSimplifyPlot the nontrivial values of the Jacobi symbol:
ArrayPlot[Table[JacobiSymbol[n, m], {n, 0, 40}, {m, 1, 2n, 2}], ColorRules -> {1 -> Red, -1 -> Blue}]Properties & Relations (1)
Reduce equations containing JacobiSymbol:
Reduce[JacobiSymbol[p, 3] == 2JacobiSymbol[p + 1, 3] - 1 && -5 < p < 5, p, Integers]Neat Examples (1)
Successive differences of JacobiSymbol modulo 2:
ArrayPlot[Mod[NestList[Differences, JacobiSymbol[Range[100], 77], 100], 2]]See Also
KroneckerSymbol FactorInteger MoebiusMu DirichletCharacter
Function Repository: QuadraticResidues
Tech Notes
Related Guides
Related Links
History
Introduced in 1988 (1.0)
Text
Wolfram Research (1988), JacobiSymbol, Wolfram Language function, https://reference.wolfram.com/language/ref/JacobiSymbol.html.
CMS
Wolfram Language. 1988. "JacobiSymbol." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/JacobiSymbol.html.
APA
Wolfram Language. (1988). JacobiSymbol. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/JacobiSymbol.html
BibTeX
@misc{reference.wolfram_2026_jacobisymbol, author="Wolfram Research", title="{JacobiSymbol}", year="1988", howpublished="\url{https://reference.wolfram.com/language/ref/JacobiSymbol.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_jacobisymbol, organization={Wolfram Research}, title={JacobiSymbol}, year={1988}, url={https://reference.wolfram.com/language/ref/JacobiSymbol.html}, note=[Accessed: 12-June-2026]}