I'm working on modernizing Rosetta Code's infrastructure. Starting with communications. Please accept this time-limited open invite to RC's Slack.. --Michael Mol (talk) 20:59, 30 May 2020 (UTC)

# Talk:Jacobi symbol

This task is well defined and has many implementation. Any objection to promoting this draft task to a task?

--DavidFashion (talk) 22:55, 5 February 2020 (UTC)

I rewrote the lead to use LaTeX, but Mathoid wasn't working when I tried to preview it, so I'm dumping it here so that I don't lose it. Disregard the errors if it doesn't re-render by the time you see this. -happy5214 06:22, 6 February 2020 (UTC)

The Jacobi symbol is a multiplicative function that generalizes the Legendre symbol. Specifically, the Jacobi symbol $a}{n$

equals the product of the Legendre symbols Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("<p>There was a problem during the HTTP request: 404 Not Found


$a}{p_i}\right)^{k_i$ , where $k_1}p_2^{k_2}\cdots p_i^{k_i$

is the prime factorization of ${\displaystyle n}$ and the Legendre symbol Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("<p>There was a problem during the HTTP request: 404 Not Found


$a}{p$

denotes the value of  Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("<p>There was a problem during the HTTP request: 404 Not Found


$(p-1)/2} \pmod{p} = \begin{cases} 1 & \text{if a is a square} \pmod{p} \\ -1 & \text{if a is not a square} \pmod{p} \\ 0 & \text{if } a \equiv 0 \pmod{p} \end{cases$

If n is prime, then the Jacobi symbol $a}{n$

equals the Legendre symbol Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("<p>There was a problem during the HTTP request: 404 Not Found


$a}{n$ .

Calculate the Jacobi symbol $a}{n$ .