Legendre Symbol Calculator

Enter an integer a and an odd prime p to compute the Legendre symbol.

How to use

  1. Enter your values in the fields above.
  2. Press Calculate to see your result instantly.
  3. Use the Share button to copy a link to your result.

About this calculator

The Legendre symbol (a/p), defined for an integer a and an odd prime p, is a compact way of answering a fundamental question in number theory: does the congruence x² ≡ a (mod p) have a solution? This calculator evaluates it using Euler's criterion: (a/p) ≡ a^((p-1)/2) (mod p), which equals 1 if a is a quadratic residue mod p, −1 if it is a non-residue, and 0 if p divides a exactly.

The Legendre symbol is a building block of quadratic reciprocity theory and shows up throughout computational number theory and cryptography — including primality tests, algorithms for computing modular square roots, and constructions in elliptic-curve cryptography — wherever it matters whether a number is a perfect square modulo a prime.

Was this helpful?

Comments (0)

  • Be the first to comment.

Popular calculators

All Calculators