Legendre Symbol in LaTeX (\left(\frac{a}{p}\right))

(ap)\left(\frac{a}{p}\right)
LaTeX command
\left(\frac{a}{p}\right)
Package
No package needed: built into LaTeX
Mode
Math mode only

Where it is used

Legendre symbol (a/p): 1, -1 or 0 depending on whether a is a quadratic residue mod p.

For an odd prime p, \left(\frac{a}{p}\right) equals 1 if a is a nonzero square modulo p, -1 if it is not, and 0 if p \mid a. Quadratic reciprocity is the famous identity relating \left(\frac{p}{q}\right) and \left(\frac{q}{p}\right) through the sign (-1)^{\frac{p-1}{2}\frac{q-1}{2}}. \left( \right) sizes the parentheses to the fraction automatically. Do not use \binom, which omits the fraction bar the symbol requires; \genfrac{(}{)}{}{}{a}{p} is an equivalent alternative. Euler's criterion computes it as a^{(p-1)/2} modulo p.

Minimal compilable example

Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.

(ap)≡a(p−1)/2(modp)\left(\frac{a}{p}\right) \equiv a^{(p-1)/2} \pmod{p}
\documentclass{article}
\begin{document}
Legendre Symbol: $\left(\frac{a}{p}\right)$

\[ \left(\frac{a}{p}\right) \equiv a^{(p-1)/2} \pmod{p} \]
\end{document}

Related symbols

All 정수론 →

Frequently asked questions

How do I write Legendre Symbol in LaTeX?
Type \left(\frac{a}{p}\right) in math mode, for example $\left(\frac{a}{p}\right) \equiv a^{(p-1)/2} \pmod{p}$. It works in plain LaTeX without loading any package.
Which package do I need for \left(\frac{a}{p}\right)?
None. \left(\frac{a}{p}\right) is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
Can I use \left(\frac{a}{p}\right) in text mode, or only in math mode?
Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $\left(\frac{a}{p}\right)$ in running text.
Math poweredAI로 LaTeX 작성

최고의 AI LaTeX 편집기, Overleaf 대안

Octree는 15개 이상의 대학의 연구자들이 AI를 사용하여 논문을 더 빠르게 작성하도록 도움

  • AI로 아름다운 TikZ 다이어그램 생성
  • 이미지를 업로드하고 LaTeX로 원활하게 변환
  • 논문 작성 및 서식에 대한 즉각적인 지원 받기