A tool designed for computing the Legendre symbol efficiently determines whether a given integer is a quadratic residue modulo a prime number. For example, determining whether 2 is a quadratic residue modulo 7 (i.e., if there exists an integer x such that x2 2 (mod 7)) can be easily accomplished with such a tool. The result, typically represented as (a|p), is +1 if a is a quadratic residue modulo p (and a is not divisible by p), -1 if a is a quadratic nonresidue modulo p, and 0 if a is divisible by p.
This type of computation plays a critical role in number theory, particularly in areas like primality testing and cryptography. Its historical roots lie in the work of Adrien-Marie Legendre, who introduced the symbol in the late 18th century. The ability to efficiently compute this symbol has become increasingly important with the rise of computational number theory and its applications in modern computer science.