This site is supported by donations to The OEIS Foundation.

# Jacobi symbol

The Jacobi symbol $\left({\frac {n}{m}}\right)\,$ is a generalization of the Legendre symbol. Given two coprime integers $m$ and $n$ , with the former the product of $\Omega (m)$ primes $p_{i}$ (not necessarily distinct), the Jacobi symbol is

$\left({\frac {n}{m}}\right)=\prod _{i=1}^{\Omega (m)}\left({\frac {n}{p_{i}}}\right)$ where $\left({\frac {n}{p_{i}}}\right)$ is the Legendre symbol. Here are two examples with $n=2$ :

$\left({\frac {2}{15}}\right)=\left({\frac {2}{3}}\right)\left({\frac {2}{5}}\right)=(-1)(-1)=1$ $\left({\frac {2}{45}}\right)=\left({\frac {2}{3}}\right)\left({\frac {2}{3}}\right)\left({\frac {2}{5}}\right)=(-1)(-1)(-1)=-1$ There is no problem with confusing the Legendre and Jacobi symbols; one has a prime for the second argument, the other a composite. In fact, at least one computer algebra system (Wolfram Mathematica) does not offer a separate LegendreSymbol[a, p] command, instead "overloading" JacobiSymbol[n, m].

However, the notation remains confusing because it looks like a fraction: the examples above could be misunderstood to mean that 2 fifteenths is the same thing as 4 fifteenths and 1, or that 2 forty-fifths is the same thing as 8 forty-fifths and –1.

1. By $\Omega (n)$ we're referring to Omega(n), number of prime factors of n (with multiplicity).
2. But one can certainly define it if one feels that strongly about it.