WOLFRAM

gives the Kronecker symbol .

Details

  • KroneckerSymbol is also known as the Jacobi symbol or Legendre symbol.
  • Integer mathematical function, suitable for both symbolic and numerical manipulation.
  • KroneckerSymbol[n,1] gives 1.
  • KroneckerSymbol[n,-1] gives 1 whenever n is non-negative and otherwise.
  • For a number with a unit and primes, TemplateBox[{n, m}, KroneckerSymbol] returns TemplateBox[{n, u}, KroneckerSymbol] TemplateBox[{n, {p, _, 1}}, KroneckerSymbol] ...TemplateBox[{n, {p, _, l}}, KroneckerSymbol].

Examples

open allclose all

Basic Examples  (2)Summary of the most common use cases

Compute Kronecker symbols:

Out[1]=1
Out[1]=1

Plot the KroneckerSymbol sequence with respect to the second argument:

Out[1]=1

Scope  (9)Survey of the scope of standard use cases

Numerical Evaluation  (3)

KroneckerSymbol works over integers:

Out[3]=3

Compute for large arguments:

Out[1]=1

KroneckerSymbol threads elementwise over lists:

Out[1]=1

Symbolic Manipulation  (6)

TraditionalForm formatting:

Reduce expressions:

Out[1]=1

Solve equations:

Out[1]=1

Use KroneckerSymbol in a sum:

Out[1]=1

Recurrence equation:

Out[1]=1

Generating function:

Out[1]=1

Applications  (11)Sample problems that can be solved with this function

Basic Applications  (2)

Table of values of the Kronecker symbol with n, m up to 10:

Out[1]=1

Plot the nontrivial values of the Kronecker symbol:

Out[1]=1

Number Theory  (9)

For congruent integers m and n modulo p, KroneckerSymbol[m,p]==KroneckerSymbol[n,p]:

Out[3]=3
Out[2]=2

Find EulerJacobi pseudoprimes to base : [more info]

Out[2]=2

The law of quadratic reciprocity for distinct primes n and m :

Out[2]=2
Out[3]=3

Construct eigenvectors of the discrete Fourier transform:

Out[1]=1
Out[2]=2

Evaluate Gauss sums in closed form:

Out[2]=2

The congruence equation has a solution if KroneckerSymbol[a,p] == 1:

Out[1]=1
Out[2]=2

KroneckerSymbol[n,k] is a real DirichletCharacter modulo k for odd integers k:

Out[1]=1
Out[2]=2

A real primitive character χ modulo k can be written in terms of KroneckerSymbol[χ[-1]k,n]:

Out[1]=1
Out[2]=2

Nonprimitive real characters can be written in terms of KroneckerSymbol at integers coprime to k:

Out[3]=3
Out[4]=4

KroneckerSymbol is the generalization of the Jacobi symbol for all integers:

Out[2]=2

Properties & Relations  (5)Properties of the function, and connections to other functions

KroneckerSymbol gives for non-coprime integers:

Out[1]=1
Out[1]=1

KroneckerSymbol is a completely multiplicative function for each argument:

Out[1]=1
Out[2]=2

The law of quadratic reciprocity for distinct primes n and m :

Out[2]=2
Out[3]=3

Use KroneckerSymbol to compute real DirichletCharacter modulo k for odd integers k:

Out[1]=1
Out[2]=2

Check that the following relation holds for any odd integer:

Out[1]=1

Neat Examples  (4)Surprising or curious use cases

The array plot of KroneckerSymbol:

Out[4]=4

Plot the arguments of the Fourier transform of KroneckerSymbol:

Out[1]=1

Successive differences of KroneckerSymbol modulo 2:

Out[1]=1

Plot the Ulam spiral of KroneckerSymbol:

Out[2]=2
Wolfram Research (2007), KroneckerSymbol, Wolfram Language function, https://reference.wolfram.com/language/ref/KroneckerSymbol.html.
Wolfram Research (2007), KroneckerSymbol, Wolfram Language function, https://reference.wolfram.com/language/ref/KroneckerSymbol.html.

Text

Wolfram Research (2007), KroneckerSymbol, Wolfram Language function, https://reference.wolfram.com/language/ref/KroneckerSymbol.html.

Wolfram Research (2007), KroneckerSymbol, Wolfram Language function, https://reference.wolfram.com/language/ref/KroneckerSymbol.html.

CMS

Wolfram Language. 2007. "KroneckerSymbol." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/KroneckerSymbol.html.

Wolfram Language. 2007. "KroneckerSymbol." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/KroneckerSymbol.html.

APA

Wolfram Language. (2007). KroneckerSymbol. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/KroneckerSymbol.html

Wolfram Language. (2007). KroneckerSymbol. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/KroneckerSymbol.html

BibTeX

@misc{reference.wolfram_2025_kroneckersymbol, author="Wolfram Research", title="{KroneckerSymbol}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/KroneckerSymbol.html}", note=[Accessed: 03-May-2025 ]}

@misc{reference.wolfram_2025_kroneckersymbol, author="Wolfram Research", title="{KroneckerSymbol}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/KroneckerSymbol.html}", note=[Accessed: 03-May-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_kroneckersymbol, organization={Wolfram Research}, title={KroneckerSymbol}, year={2007}, url={https://reference.wolfram.com/language/ref/KroneckerSymbol.html}, note=[Accessed: 03-May-2025 ]}

@online{reference.wolfram_2025_kroneckersymbol, organization={Wolfram Research}, title={KroneckerSymbol}, year={2007}, url={https://reference.wolfram.com/language/ref/KroneckerSymbol.html}, note=[Accessed: 03-May-2025 ]}